From 374996ecc45f138ff48ed1812fee3dc59837c556 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 22 Sep 2023 13:42:46 +0000 Subject: [PATCH] only read h2odata, ozdata and noahmp table when they are needed --- physics/GFS_phys_time_vary.fv3.F90 | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index e6bf24186..4100bdf6e 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -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) & @@ -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 @@ -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 @@ -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 @@ -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