Skip to content
Snippets Groups Projects
Commit 3af665af authored by ESCOBAR Juan's avatar ESCOBAR Juan
Browse files

Juan 15/01/2022:ZSOLVER/ice_adjust.f90, for GPU check , compute budget in...

Juan 15/01/2022:ZSOLVER/ice_adjust.f90, for GPU check , compute budget in kernels via ZTEMP_BUD if needed
parent cd8e1e2b
No related branches found
No related tags found
No related merge requests found
......@@ -291,7 +291,8 @@ REAL, DIMENSION(:,:,:), POINTER, CONTIGUOUS &
ZLS, & ! guess of the Ls at t+1
ZW1,ZW2, & ! Work arrays for intermediate fields
ZCRIAUT, & ! Autoconversion thresholds
ZHCF, ZHR
ZHCF, ZHR
REAL, DIMENSION(:,:,:), pointer , contiguous :: ZTEMP_BUD
!
!-------------------------------------------------------------------------------
!
......@@ -362,6 +363,7 @@ allocate( zw2 (IIU, IJU, IKU ) )
allocate( zcriaut(IIU, IJU, IKU ) )
allocate( zhcf (IIU, IJU, IKU ) )
allocate( zhr (IIU, IJU, IKU ) )
allocate( ZTEMP_BUD (IIU, IJU, IKU ) )
#else
!Pin positions in the pools of MNH memory
CALL MNH_MEM_POSITION_PIN()
......@@ -381,14 +383,35 @@ CALL MNH_MEM_GET( zw2 , IIU, IJU, IKU )
CALL MNH_MEM_GET( zcriaut, IIU, IJU, IKU )
CALL MNH_MEM_GET( zhcf , IIU, IJU, IKU )
CALL MNH_MEM_GET( zhr , IIU, IJU, IKU )
CALL MNH_MEM_GET( ZTEMP_BUD , IIU, IJU, IKU )
!$acc data present( gtemp, zsigs, zsrcs, zt, zrv, zrc, zri, zcph, zlv, zls, zw1, zw2, zcriaut, zhcf, zhr )
#endif
if ( lbudget_th ) call Budget_store_init( tbudgets(NBUDGET_TH), trim( hbuname ), pths(:, :, :) * prhodj(:, :, :) )
if ( lbudget_rv ) call Budget_store_init( tbudgets(NBUDGET_RV), trim( hbuname ), prvs(:, :, :) * prhodj(:, :, :) )
if ( lbudget_rc ) call Budget_store_init( tbudgets(NBUDGET_RC), trim( hbuname ), prcs(:, :, :) * prhodj(:, :, :) )
if ( lbudget_ri ) call Budget_store_init( tbudgets(NBUDGET_RI), trim( hbuname ), pris(:, :, :) * prhodj(:, :, :) )
if ( lbudget_th ) then
!$acc kernels
ZTEMP_BUD(:,:,:) = pths(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_init( tbudgets(NBUDGET_TH), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
if ( lbudget_rv ) then
!$acc kernels
ZTEMP_BUD(:,:,:) = prvs(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_init( tbudgets(NBUDGET_RV), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
if ( lbudget_rc ) then
!$acc kernels
ZTEMP_BUD(:,:,:) = prcs(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_init( tbudgets(NBUDGET_RC), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
if ( lbudget_ri ) then
!$acc kernels
ZTEMP_BUD(:,:,:) = pris(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_init( tbudgets(NBUDGET_RI), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
!
ITERMAX=1
!
......@@ -636,26 +659,34 @@ IF(PRESENT(POUT_TH)) POUT_TH=ZT / PEXN(:,:,:)
! ----------------------
!
if ( lbudget_th ) then
!$acc update self(pths)
call Budget_store_end( tbudgets(NBUDGET_TH), trim( hbuname ), pths(:, :, :) * prhodj(:, :, :) )
!$acc kernels
ZTEMP_BUD(:,:,:) = pths(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_end( tbudgets(NBUDGET_TH), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
if ( lbudget_rv ) then
!$acc update self(prvs)
call Budget_store_end( tbudgets(NBUDGET_RV), trim( hbuname ), prvs(:, :, :) * prhodj(:, :, :) )
!$acc kernels
ZTEMP_BUD(:,:,:) = prvs(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_end( tbudgets(NBUDGET_RV), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
if ( lbudget_rc ) then
!$acc update self(prcs)
call Budget_store_end( tbudgets(NBUDGET_RC), trim( hbuname ), prcs(:, :, :) * prhodj(:, :, :) )
!$acc kernels
ZTEMP_BUD(:,:,:) = prcs(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_end( tbudgets(NBUDGET_RC), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
if ( lbudget_ri ) then
!$acc update self(pris)
call Budget_store_end( tbudgets(NBUDGET_RI), trim( hbuname ), pris(:, :, :) * prhodj(:, :, :) )
!$acc kernels
ZTEMP_BUD(:,:,:) = pris(:, :, :) * prhodj(:, :, :)
!$acc end kernels
call Budget_store_end( tbudgets(NBUDGET_RI), trim( hbuname ), ZTEMP_BUD(:,:,:) )
end if
!$acc end data
#ifndef MNH_OPENACC
deallocate( gtemp, zsigs, zsrcs, zt, zrv, zrc, zri, zcph, zlv, zls, zw1, zw2, zcriaut, zhcf, zhr )
deallocate( gtemp, zsigs, zsrcs, zt, zrv, zrc, zri, zcph, zlv, zls, zw1, zw2, zcriaut, zhcf, zhr , ZTEMP_BUD )
#else
!Release all memory allocated with MNH_MEM_GET calls since last call to MNH_MEM_POSITION_PIN
CALL MNH_MEM_RELEASE()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment