Skip to content

Commit

Permalink
only read h2odata, ozdata and noahmp table when they are needed
Browse files Browse the repository at this point in the history
  • Loading branch information
SamuelTrahanNOAA committed Sep 22, 2023
1 parent 7332c8e commit 374996e
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions physics/GFS_phys_time_vary.fv3.F90
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ subroutine GFS_phys_time_vary_init (
!$OMP shared (xlat_d,xlon_d,imap,jmap,errmsg,errflg) &
!$OMP shared (levozp,oz_coeff,oz_pres,ozpl) &
!$OMP shared (levh2o,h2o_coeff,h2o_pres,h2opl) &
!$OMP shared (iamin, iamax, jamin, jamax) &
!$OMP shared (iamin, iamax, jamin, jamax, lsm_noahmp) &
!$OMP shared (iaerclm,iaermdl,ntrcaer,aer_nm,iflip,iccn) &
!$OMP shared (jindx1_o3,jindx2_o3,ddy_o3,jindx1_h,jindx2_h,ddy_h) &
!$OMP shared (jindx1_aer,jindx2_aer,ddy_aer,iindx1_aer,iindx2_aer,ddx_aer) &
Expand All @@ -240,6 +240,7 @@ subroutine GFS_phys_time_vary_init (

!$OMP section
!> - Call read_o3data() to read ozone data
need_o3data: if(ntoz > 0) then
call read_o3data (ntoz, me, master)

! Consistency check that the hardcoded values for levozp and
Expand All @@ -259,9 +260,11 @@ subroutine GFS_phys_time_vary_init (
oz_coeff, " /= ", size(ozpl, dim=3)
call copy_error(myerrmsg, myerrflg, errmsg, errflg)
end if
endif need_o3data

!$OMP section
!> - Call read_h2odata() to read stratospheric water vapor data
need_h2odata: if(h2o_phys) then
call read_h2odata (h2o_phys, me, master)

! Consistency check that the hardcoded values for levh2o and
Expand All @@ -281,6 +284,7 @@ subroutine GFS_phys_time_vary_init (
myerrflg = 1
call copy_error(myerrmsg, myerrflg, errmsg, errflg)
end if
endif need_h2odata

!$OMP section
!> - Call read_aerdata() to read aerosol climatology, Anning added coupled
Expand Down Expand Up @@ -330,10 +334,12 @@ subroutine GFS_phys_time_vary_init (

!$OMP section
!> - read in NoahMP table (needed for NoahMP init)
myerrflg = 0
myerrmsg = 'read_mp_table_parameters failed without a message'
call read_mp_table_parameters(myerrmsg, myerrflg)
call copy_error(myerrmsg, myerrflg, errmsg, errflg)
if(lsm == lsm_noahmp) then
myerrflg = 0
myerrmsg = 'read_mp_table_parameters failed without a message'
call read_mp_table_parameters(myerrmsg, myerrflg)
call copy_error(myerrmsg, myerrflg, errmsg, errflg)
endif

!$OMP end sections

Expand Down

0 comments on commit 374996e

Please sign in to comment.