From 4e100f808df35c9485c9a9a0b3cc95848b137a4d Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 16:32:33 +0000 Subject: [PATCH 01/11] Add optional attribute to GWD files. --- physics/GWD/cires_ugwp_post.F90 | 5 ++-- physics/GWD/drag_suite.F90 | 15 ++++++------ physics/GWD/gwdc_post.f | 2 +- physics/GWD/gwdps.f | 6 ++--- physics/GWD/rayleigh_damp.f | 3 ++- physics/GWD/ugwpv1_gsldrag.F90 | 23 +++++++++-------- physics/GWD/ugwpv1_gsldrag_post.F90 | 38 ++++++++++++++--------------- physics/GWD/unified_ugwp.F90 | 23 ++++++++--------- physics/GWD/unified_ugwp_post.F90 | 35 +++++++++++++------------- 9 files changed, 79 insertions(+), 71 deletions(-) diff --git a/physics/GWD/cires_ugwp_post.F90 b/physics/GWD/cires_ugwp_post.F90 index f12237e2f..3efb2b7e8 100644 --- a/physics/GWD/cires_ugwp_post.F90 +++ b/physics/GWD/cires_ugwp_post.F90 @@ -33,8 +33,9 @@ subroutine cires_ugwp_post_run (ldiag_ugwp, dtf, im, levs, & real(kind=kind_phys), intent(in), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw - real(kind=kind_phys), intent(in), dimension(:,:) :: gw_dtdt, gw_dudt, gw_dvdt, dudt_mtb, dudt_ogw, dudt_tms - real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw + real(kind=kind_phys), intent(in), dimension(:,:) :: gw_dtdt, gw_dudt, gw_dvdt, dudt_mtb, dudt_tms + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_ogw + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt character(len=*), intent(out) :: errmsg diff --git a/physics/GWD/drag_suite.F90 b/physics/GWD/drag_suite.F90 index ff68f4216..8f292cde7 100644 --- a/physics/GWD/drag_suite.F90 +++ b/physics/GWD/drag_suite.F90 @@ -328,9 +328,10 @@ subroutine drag_suite_run( & logical, intent(in) :: lprnt integer, intent(in) :: KPBL(:) real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, cdmbgwd(:) - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) logical, intent(in) :: ldiag3d - integer, intent(in) :: dtidx(:,:), index_of_temperature, & + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_of_temperature, & & index_of_process_orographic_gwd, index_of_x_wind, index_of_y_wind integer :: kpblmax @@ -353,7 +354,7 @@ subroutine drag_suite_run( & real(kind=kind_phys), intent(in) :: var(:),oc1(:), & & oa4(:,:),ol4(:,:), & & dx(:) - real(kind=kind_phys), intent(in) :: varss(:),oc1ss(:), & + real(kind=kind_phys), intent(in), optional :: varss(:),oc1ss(:), & & oa4ss(:,:),ol4ss(:,:) real(kind=kind_phys), intent(in) :: THETA(:),SIGMA(:), & & GAMMA(:),ELVMAX(:) @@ -361,8 +362,8 @@ subroutine drag_suite_run( & ! added for small-scale orographic wave drag real(kind=kind_phys), dimension(im,km) :: utendwave,vtendwave,thx,thvx real(kind=kind_phys), intent(in) :: br1(:), & - & hpbl(:), & & slmsk(:) + real(kind=kind_phys), intent(in), optional :: hpbl(:) real(kind=kind_phys), dimension(im) :: govrth,xland !real(kind=kind_phys), dimension(im,km) :: dz2 real(kind=kind_phys) :: tauwavex0,tauwavey0, & @@ -374,7 +375,7 @@ subroutine drag_suite_run( & !SPP real(kind=kind_phys), dimension(im) :: var_stoch, varss_stoch, & varmax_fd_stoch - real(kind=kind_phys), intent(in) :: spp_wts_gwd(:,:) + real(kind=kind_phys), intent(in), optional :: spp_wts_gwd(:,:) integer, intent(in) :: spp_gwd real(kind=kind_phys), dimension(im) :: rstoch @@ -383,12 +384,12 @@ subroutine drag_suite_run( & real(kind=kind_phys), intent(inout) :: & & dusfc(:), dvsfc(:) !Output (optional): - real(kind=kind_phys), intent(inout) :: & + real(kind=kind_phys), intent(inout), optional :: & & dusfc_ms(:),dvsfc_ms(:), & & dusfc_bl(:),dvsfc_bl(:), & & dusfc_ss(:),dvsfc_ss(:), & & dusfc_fd(:),dvsfc_fd(:) - real(kind=kind_phys), intent(inout) :: & + real(kind=kind_phys), intent(inout), optional :: & & dtaux2d_ms(:,:),dtauy2d_ms(:,:), & & dtaux2d_bl(:,:),dtauy2d_bl(:,:), & & dtaux2d_ss(:,:),dtauy2d_ss(:,:), & diff --git a/physics/GWD/gwdc_post.f b/physics/GWD/gwdc_post.f index 62891ffd4..ab2043fec 100644 --- a/physics/GWD/gwdc_post.f +++ b/physics/GWD/gwdc_post.f @@ -79,4 +79,4 @@ subroutine gwdc_post_run( & end subroutine gwdc_post_run - end module gwdc_post \ No newline at end of file + end module gwdc_post diff --git a/physics/GWD/gwdps.f b/physics/GWD/gwdps.f index 273c2d5dc..ca2efeef4 100644 --- a/physics/GWD/gwdps.f +++ b/physics/GWD/gwdps.f @@ -315,11 +315,11 @@ subroutine gwdps_run( & & THETA(:), SIGMA(:), GAMMA(:) real(kind=kind_phys), intent(inout) :: DUSFC(:), DVSFC(:), & & RDXZB(:) - real(kind=kind_phys), intent(inout) :: dtaux2d_ms(:,:), & + real(kind=kind_phys), intent(inout), optional :: dtaux2d_ms(:,:), & & dtauy2d_ms(:,:), dtaux2d_bl(:,:), & & dtauy2d_bl(:,:) - real(kind=kind_phys), intent(inout) :: dusfc_ms(:), dvsfc_ms(:), & - & dusfc_bl(:), dvsfc_bl(:) + real(kind=kind_phys), intent(inout), optional :: dusfc_ms(:), & + & dvsfc_ms(:), dusfc_bl(:), dvsfc_bl(:) integer, intent(in) :: nmtvr logical, intent(in) :: lprnt logical, intent(in) :: ldiag_ugwp diff --git a/physics/GWD/rayleigh_damp.f b/physics/GWD/rayleigh_damp.f index abbac041c..f8b4ac6a6 100644 --- a/physics/GWD/rayleigh_damp.f +++ b/physics/GWD/rayleigh_damp.f @@ -70,7 +70,8 @@ subroutine rayleigh_damp_run ( & real(kind=kind_phys),intent(in) :: U1(:,:), V1(:,:) real(kind=kind_phys),intent(inout) :: A(:,:), B(:,:), C(:,:) real(kind=kind_phys),optional, intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), & + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: & & index_of_process_rayleigh_damping, index_of_temperature, & & index_of_x_wind, index_of_y_wind character(len=*), intent(out) :: errmsg diff --git a/physics/GWD/ugwpv1_gsldrag.F90 b/physics/GWD/ugwpv1_gsldrag.F90 index 9303e0221..09eda6b1d 100644 --- a/physics/GWD/ugwpv1_gsldrag.F90 +++ b/physics/GWD/ugwpv1_gsldrag.F90 @@ -82,7 +82,7 @@ subroutine ugwpv1_gsldrag_init ( & integer, intent (in) :: me integer, intent (in) :: master integer, intent (in) :: nlunit - character(len=*), intent (in) :: input_nml_file(:) + character(len=*), intent (in), optional :: input_nml_file(:) integer, intent (in) :: logunit integer, intent (in) :: jdat(:) integer, intent (in) :: lonr @@ -378,8 +378,9 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, real(kind=kind_phys), intent(in), dimension(:) :: elvmax real(kind=kind_phys), intent(in), dimension(:,:) :: clx, oa4 - real(kind=kind_phys), intent(in), dimension(:) :: varss,oc1ss,dx - real(kind=kind_phys), intent(in), dimension(:,:) :: oa4ss,ol4ss + real(kind=kind_phys), intent(in), dimension(:) :: dx + real(kind=kind_phys), intent(in), dimension(:), optional :: varss,oc1ss + real(kind=kind_phys), intent(in), dimension(:,:), optional :: oa4ss,ol4ss !===== !ccpp-style passing constants, I prefer to take them out from the "call-subr" list @@ -398,7 +399,8 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, integer, intent(in), dimension(:) :: kpbl real(kind=kind_phys), intent(in), dimension(:) :: rain - real(kind=kind_phys), intent(in), dimension(:) :: br1, hpbl, slmsk + real(kind=kind_phys), intent(in), dimension(:) :: br1, slmsk + real(kind=kind_phys), intent(in), dimension(:), optional :: hpbl ! ! moved to GFS_phys_time_vary ! real(kind=kind_phys), intent(in), dimension(:) :: ddy_j1tau, ddy_j2tau @@ -407,7 +409,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, !Output (optional): - real(kind=kind_phys), intent(out), dimension(:) :: & + real(kind=kind_phys), intent(out), dimension(:), optional :: & du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, & du_osscol, dv_osscol, du_ofdcol, dv_ofdcol ! @@ -417,11 +419,11 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg real(kind=kind_phys), intent(out), dimension(:) :: tau_ogw, tau_ngw, tau_oss - real(kind=kind_phys), intent(out) , dimension(:,:) :: & + real(kind=kind_phys), intent(out) , dimension(:,:), optional :: & dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, & dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd - real(kind=kind_phys), intent(out) , dimension(:,:) :: dudt_ngw, dvdt_ngw, kdis_ngw + real(kind=kind_phys), intent(out) , dimension(:,:), optional :: dudt_ngw, dvdt_ngw, kdis_ngw real(kind=kind_phys), intent(out) , dimension(:,:) :: dudt_gw, dvdt_gw, kdis_gw real(kind=kind_phys), intent(out) , dimension(:,:) :: dtdt_ngw, dtdt_gw @@ -431,14 +433,15 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, ! real(kind=kind_phys), intent(inout), dimension(:,:) :: dudt, dvdt, dtdt - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), & + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: & index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_orographic_gwd, index_of_process_nonorographic_gwd real(kind=kind_phys), intent(out), dimension(:) :: rdxzb ! for stoch phys. mtb-level - real(kind=kind_phys), intent(in) :: spp_wts_gwd(:,:) + real(kind=kind_phys), intent(in), optional :: spp_wts_gwd(:,:) integer, intent(in) :: spp_gwd character(len=*), intent(out) :: errmsg diff --git a/physics/GWD/ugwpv1_gsldrag_post.F90 b/physics/GWD/ugwpv1_gsldrag_post.F90 index 8c6704dc5..1d3703001 100644 --- a/physics/GWD/ugwpv1_gsldrag_post.F90 +++ b/physics/GWD/ugwpv1_gsldrag_post.F90 @@ -40,25 +40,25 @@ subroutine ugwpv1_gsldrag_post_run ( im, levs, ldiag_ugwp, & real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw real(kind=kind_phys), intent(in), dimension(:,:) :: dtdt_gw, dudt_gw, dvdt_gw - real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_obl, dvdt_obl, dudt_ogw - real(kind=kind_phys), intent(in), dimension(:,:) :: dvdt_ogw, dudt_ofd, dvdt_ofd - real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_oss, dvdt_oss - real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms - real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_ngw, dv3dt_ngw - real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_ngw, dvdt_ngw, dtdt_ngw - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw - real(kind=kind_phys), intent(inout), dimension(:,:) :: dws3dt_ogw, dws3dt_obl - real(kind=kind_phys), intent(inout), dimension(:,:) :: dws3dt_oss, dws3dt_ofd - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldu3dt_obl - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_oss, ldu3dt_ofd - real(kind=kind_phys), intent(in), dimension(:) :: du_ogwcol, dv_ogwcol - real(kind=kind_phys), intent(in), dimension(:) :: dv_oblcol - real(kind=kind_phys), intent(in), dimension(:) :: du_osscol, dv_osscol - real(kind=kind_phys), intent(in), dimension(:) :: dv_ofdcol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_ogwcol, dv3_ogwcol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_oblcol, dv3_oblcol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_osscol, dv3_osscol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_ofdcol, dv3_ofdcol + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_obl, dvdt_obl, dudt_ogw + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dvdt_ogw, dudt_ofd, dvdt_ofd + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_oss, dvdt_oss + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_mtb, du3dt_ogw, du3dt_tms + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_ngw, dv3dt_ngw + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_ngw, dvdt_ngw, dtdt_ngw + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_ogw, dws3dt_obl + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_oss, dws3dt_ofd + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_ogw, ldu3dt_obl + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_oss, ldu3dt_ofd + real(kind=kind_phys), intent(in), dimension(:), optional :: du_ogwcol, dv_ogwcol + real(kind=kind_phys), intent(in), dimension(:), optional :: dv_oblcol + real(kind=kind_phys), intent(in), dimension(:), optional :: du_osscol, dv_osscol + real(kind=kind_phys), intent(in), dimension(:), optional :: dv_ofdcol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_ogwcol, dv3_ogwcol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_oblcol, dv3_oblcol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_osscol, dv3_osscol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_ofdcol, dv3_ofdcol real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt diff --git a/physics/GWD/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 index fcdee3b5d..4f880573c 100644 --- a/physics/GWD/unified_ugwp.F90 +++ b/physics/GWD/unified_ugwp.F90 @@ -75,7 +75,7 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, & integer, intent (in) :: me integer, intent (in) :: master integer, intent (in) :: nlunit - character(len=*), intent (in) :: input_nml_file(:) + character(len=*), intent (in), optional :: input_nml_file(:) integer, intent (in) :: logunit integer, intent (in) :: jdat(:) integer, intent (in) :: lonr @@ -272,10 +272,11 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt integer, intent(in), dimension(:) :: kpbl real(kind=kind_phys), intent(in), dimension(:) :: ak, bk real(kind=kind_phys), intent(in), dimension(:) :: oro, oro_uf, hprime, oc, theta, sigma, gamma - real(kind=kind_phys), intent(in), dimension(:) :: varss,oc1ss, dx + real(kind=kind_phys), intent(in), dimension(:), optional :: varss,oc1ss + real(kind=kind_phys), intent(in), dimension(:) :: dx !vay-nov 2020 - real(kind=kind_phys), intent(in), dimension(:,:) :: oa4ss,ol4ss + real(kind=kind_phys), intent(in), dimension(:,:), optional :: oa4ss,ol4ss logical, intent(in) :: flag_for_gwd_generic_tend @@ -292,20 +293,19 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt logical, intent(in) :: do_tofd, ldiag_ugwp, ugwp_seq_update !Output (optional): - real(kind=kind_phys), intent(out) :: & + real(kind=kind_phys), intent(out), optional :: & & dusfc_ms(:),dvsfc_ms(:), & & dusfc_bl(:),dvsfc_bl(:), & & dusfc_ss(:),dvsfc_ss(:), & & dusfc_fd(:),dvsfc_fd(:) - real(kind=kind_phys), intent(out) :: & + real(kind=kind_phys), intent(out), optional :: & & dtaux2d_ms(:,:),dtauy2d_ms(:,:), & & dtaux2d_bl(:,:),dtauy2d_bl(:,:), & & dtaux2d_ss(:,:),dtauy2d_ss(:,:), & & dtaux2d_fd(:,:),dtauy2d_fd(:,:), & & dudt_ngw(:,:),dvdt_ngw(:,:),dtdt_ngw(:,:) - + real(kind=kind_phys), intent(in), optional :: hpbl(:) real(kind=kind_phys), intent(in) :: br1(:), & - & hpbl(:), & & slmsk(:) real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg @@ -314,14 +314,15 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt real(kind=kind_phys), intent(out), dimension(:,:) :: gw_dudt, gw_dvdt, gw_dtdt, gw_kdis real(kind=kind_phys), intent(out), dimension(:,:) :: dudt_mtb, dudt_tms - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) - integer, intent(in) :: dtidx(:,:), index_of_temperature, index_of_x_wind, & + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) + integer, intent(in) :: dtidx(:,:) + integer, intent(in) :: index_of_temperature, index_of_x_wind, & index_of_y_wind, index_of_process_nonorographic_gwd, & index_of_process_orographic_gwd logical, intent(in) :: ldiag3d, lssav ! These arrays only allocated if ldiag_ugwp = .true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_mtb, du3dt_ogw, du3dt_tms real(kind=kind_phys), intent(inout), dimension(:,:) :: dudt, dvdt, dtdt @@ -342,7 +343,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt do_gsl_drag_ls_bl, do_gsl_drag_ss, & do_gsl_drag_tofd - real(kind=kind_phys), intent(in) :: spp_wts_gwd(:,:) + real(kind=kind_phys), intent(in), optional :: spp_wts_gwd(:,:) integer, intent(in) :: spp_gwd character(len=*), intent(out) :: errmsg diff --git a/physics/GWD/unified_ugwp_post.F90 b/physics/GWD/unified_ugwp_post.F90 index 9c3717546..47ad40ba9 100644 --- a/physics/GWD/unified_ugwp_post.F90 +++ b/physics/GWD/unified_ugwp_post.F90 @@ -42,23 +42,24 @@ subroutine unified_ugwp_post_run (ldiag3d, ldiag_ugwp, & real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw real(kind=kind_phys), intent(in), dimension(:,:) :: gw_dtdt, gw_dudt, gw_dvdt, dudt_mtb - real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_ogw, dvdt_ogw, dudt_tms - real(kind=kind_phys), intent(inout), dimension(:,:) :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ogw, ldu3dt_obl, ldu3dt_oss, ldu3dt_ofd - real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_ngw, dvdt_ngw, dtdt_ngw - real(kind=kind_phys), intent(inout), dimension(:,:) :: ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw - real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_obl, dvdt_obl - real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd - real(kind=kind_phys), intent(inout), dimension(:,:) :: dws3dt_obl, dws3dt_ogw - real(kind=kind_phys), intent(inout), dimension(:,:) :: dws3dt_oss, dws3dt_ofd - real(kind=kind_phys), intent(in), dimension(:) :: du_ogwcol, dv_ogwcol - real(kind=kind_phys), intent(in), dimension(:) :: du_oblcol, dv_oblcol - real(kind=kind_phys), intent(in), dimension(:) :: du_osscol, dv_osscol - real(kind=kind_phys), intent(in), dimension(:) :: du_ofdcol, dv_ofdcol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_ogwcol, dv3_ogwcol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_oblcol, dv3_oblcol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_osscol, dv3_osscol - real(kind=kind_phys), intent(inout), dimension(:) :: du3_ofdcol, dv3_ofdcol + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_ogw, dvdt_ogw + real(kind=kind_phys), intent(in), dimension(:,:) :: dudt_tms + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: du3dt_mtb, du3dt_ogw, du3dt_tms, du3dt_ngw, dv3dt_ngw + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_ogw, ldu3dt_obl, ldu3dt_oss, ldu3dt_ofd + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_ngw, dvdt_ngw, dtdt_ngw + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: ldu3dt_ngw, ldv3dt_ngw, ldt3dt_ngw + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_obl, dvdt_obl + real(kind=kind_phys), intent(in), dimension(:,:), optional :: dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_obl, dws3dt_ogw + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: dws3dt_oss, dws3dt_ofd + real(kind=kind_phys), intent(in), dimension(:), optional :: du_ogwcol, dv_ogwcol + real(kind=kind_phys), intent(in), dimension(:), optional :: du_oblcol, dv_oblcol + real(kind=kind_phys), intent(in), dimension(:), optional :: du_osscol, dv_osscol + real(kind=kind_phys), intent(in), dimension(:), optional :: du_ofdcol, dv_ofdcol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_ogwcol, dv3_ogwcol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_oblcol, dv3_oblcol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_osscol, dv3_osscol + real(kind=kind_phys), intent(inout), dimension(:), optional :: du3_ofdcol, dv3_ofdcol real(kind=kind_phys), intent(inout), dimension(:,:) :: dtdt, dudt, dvdt character(len=*), intent(out) :: errmsg From 1abc8109b662b4f05c29603cc22e01a2e63782f6 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 16:46:46 +0000 Subject: [PATCH 02/11] Add optional attribute to smoke/dust files. --- physics/smoke_dust/rrfs_smoke_postpbl.F90 | 2 +- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 40 +++++++++++------------ 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.F90 b/physics/smoke_dust/rrfs_smoke_postpbl.F90 index 220284dbb..01c85a655 100755 --- a/physics/smoke_dust/rrfs_smoke_postpbl.F90 +++ b/physics/smoke_dust/rrfs_smoke_postpbl.F90 @@ -28,7 +28,7 @@ subroutine rrfs_smoke_postpbl_run(ite, kte, ntsmoke, ntdust, ntcoarsepm, ntrac, integer, parameter :: its=1,kts=1 real(kind_phys), dimension(:,:,:), intent(inout) :: qgrs - real(kind_phys), dimension(:,:,:), intent(inout) :: chem3d + real(kind_phys), dimension(:,:,:), intent(inout), optional :: chem3d logical, intent(in) :: rrfs_sd character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index 37ffccb35..b6da50ca0 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -139,11 +139,11 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, integer, parameter :: its=1,jts=1,jte=1, kts=1 integer, dimension(:), intent(in) :: land, vegtype_dom, soiltyp - real(kind_phys), dimension(:,:), intent(in) :: smc, tslb - real(kind_phys), dimension(:,:,:), intent(in) :: dust12m_in - real(kind_phys), dimension(:,:,:), intent(in) :: smoke_RRFS - real(kind_phys), dimension(:,:), intent(in) :: smoke2d_RRFS - real(kind_phys), dimension(:,:), intent(in) :: emi_ant_in + real(kind_phys), dimension(:,:), intent(in), optional :: smc, tslb + real(kind_phys), dimension(:,:,:), intent(in), optional :: dust12m_in + real(kind_phys), dimension(:,:,:), intent(in), optional :: smoke_RRFS + real(kind_phys), dimension(:,:), intent(in), optional :: smoke2d_RRFS + real(kind_phys), dimension(:,:), intent(in), optional :: emi_ant_in real(kind_phys), dimension(:), intent(in) :: u10m, v10m, ustar, dswsfc, & recmol, garea, rlat,rlon, tskin, pb2d, zorl, snow, & rain_cpl, rainc_cpl, hf2d, t2m, dpt2m @@ -151,21 +151,21 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, real(kind_phys), dimension(:,:), intent(in) :: ph3d, pr3d real(kind_phys), dimension(:,:), intent(in) :: phl3d, prl3d, tk3d, us3d, vs3d, spechum, w real(kind_phys), dimension(:,:,:), intent(inout) :: qgrs, gq0 - real(kind_phys), dimension(:,:,:), intent(inout) :: chem3d - real(kind_phys), dimension(:), intent(inout) :: emdust, emseas, emanoc - real(kind_phys), dimension(:), intent(inout) :: ebb_smoke_in,coef_bb, frp_output, fhist - real(kind_phys), dimension(:,:), intent(inout) :: ebu_smoke - real(kind_phys), dimension(:), intent(out ) :: fire_heat_flux_out, frac_grid_burned_out - real(kind_phys), dimension(:), intent(inout) :: max_fplume, min_fplume, uspdavg, hpbl_thetav - real(kind_phys), dimension(:), intent(inout) :: hwp, peak_hr_out - real(kind_phys), dimension(:), intent(inout) :: hwp_ave - real(kind_phys), dimension(:,:), intent(inout) :: nwfa, nifa - real(kind_phys), dimension(:,:), intent(inout) :: ddvel_inout - real(kind_phys), dimension(:,:), intent(inout) :: drydep_flux_out - real(kind_phys), dimension(:,:), intent(inout) :: wetdpr - real(kind_phys), dimension(:), intent(in) :: wetness - real(kind_phys), dimension(:), intent(out) :: lu_nofire_out,lu_qfire_out - integer, dimension(:), intent(out) :: fire_type_out + real(kind_phys), dimension(:,:,:), intent(inout), optional :: chem3d + real(kind_phys), dimension(:), intent(inout), optional :: emdust, emseas, emanoc + real(kind_phys), dimension(:), intent(inout), optional :: ebb_smoke_in,coef_bb, frp_output, fhist + real(kind_phys), dimension(:,:), intent(inout), optional :: ebu_smoke + real(kind_phys), dimension(:), intent(out ), optional :: fire_heat_flux_out, frac_grid_burned_out + real(kind_phys), dimension(:), intent(inout), optional :: max_fplume, min_fplume, uspdavg, hpbl_thetav + real(kind_phys), dimension(:), intent(inout), optional :: hwp, peak_hr_out + real(kind_phys), dimension(:), intent(inout), optional :: hwp_ave + real(kind_phys), dimension(:,:), intent(inout), optional :: nwfa, nifa + real(kind_phys), dimension(:,:), intent(inout), optional :: ddvel_inout + real(kind_phys), dimension(:,:), intent(inout), optional :: drydep_flux_out + real(kind_phys), dimension(:,:), intent(inout), optional :: wetdpr + real(kind_phys), dimension(:), intent(in), optional :: wetness + real(kind_phys), dimension(:), intent(out), optional :: lu_nofire_out,lu_qfire_out + integer, dimension(:), intent(out), optional :: fire_type_out integer, intent(in) :: imp_physics, imp_physics_thompson integer, dimension(:), intent(in) :: kpbl real(kind_phys), dimension(:), intent(in) :: oro From 26937e4c2b53deef277faccddea68d2a4a810dba Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 17:14:31 +0000 Subject: [PATCH 03/11] Add optional attribute to MP files. --- physics/MP/Ferrier_Aligo/mp_fer_hires.F90 | 2 +- physics/MP/GFDL/fv_sat_adj.F90 | 2 +- physics/MP/Morrison_Gettelman/m_micro.F90 | 15 +++---- .../MP/Morrison_Gettelman/m_micro_post.F90 | 12 +++--- physics/MP/Morrison_Gettelman/m_micro_pre.F90 | 11 +++-- physics/MP/NSSL/mp_nssl.F90 | 40 +++++++++---------- physics/MP/Thompson/mp_thompson.F90 | 32 +++++++-------- physics/MP/Zhao_Carr/zhaocarr_gscond.f | 2 +- 8 files changed, 58 insertions(+), 58 deletions(-) diff --git a/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 b/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 index 47e80e9d9..f4fe9b62a 100644 --- a/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 +++ b/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 @@ -149,7 +149,7 @@ SUBROUTINE mp_fer_hires_run(NCOL, NLEV, DT ,SPEC_ADV & real(kind_phys), intent(inout) :: prec(:) real(kind_phys), intent(inout) :: refl_10cm(:,:) - real(kind_phys), intent(in ) :: rhgrd + real(kind_phys), intent(in ), optional :: rhgrd real(kind_phys), intent(in ) :: dx(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/MP/GFDL/fv_sat_adj.F90 b/physics/MP/GFDL/fv_sat_adj.F90 index 2207f5755..ad8e5af0e 100644 --- a/physics/MP/GFDL/fv_sat_adj.F90 +++ b/physics/MP/GFDL/fv_sat_adj.F90 @@ -263,7 +263,7 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc, iec, kmp, km, kmdelz real(kind=kind_dyn), intent( out) :: te0(isd:ied, jsd:jed, 1:km) ! If multi-gases physics are not used, ngas is one and qvi identical to qv integer, intent(in) :: ngas - real(kind=kind_dyn), intent(inout) :: qvi(isd:ied, jsd:jed, 1:km, 1:ngas) + real(kind=kind_dyn), intent(inout), optional :: qvi(isd:ied, jsd:jed, 1:km, 1:ngas) real(kind=kind_dyn), intent(inout) :: qv(isd:ied, jsd:jed, 1:km) real(kind=kind_dyn), intent(inout) :: ql(isd:ied, jsd:jed, 1:km) real(kind=kind_dyn), intent(inout) :: qi(isd:ied, jsd:jed, 1:km) diff --git a/physics/MP/Morrison_Gettelman/m_micro.F90 b/physics/MP/Morrison_Gettelman/m_micro.F90 index 714372d53..c712d5fe8 100644 --- a/physics/MP/Morrison_Gettelman/m_micro.F90 +++ b/physics/MP/Morrison_Gettelman/m_micro.F90 @@ -199,7 +199,7 @@ subroutine m_micro_run( im, lm, flipv, dt_i & & prsl_i,u_i,v_i,phil, omega_i, QLLS_i,QILS_i, & & lwheat_i,swheat_i real (kind=kind_phys), dimension(:,0:),intent(in):: prsi_i, phii - real (kind=kind_phys), dimension(:,:), intent(in) :: & + real (kind=kind_phys), dimension(:,:),intent(in), optional :: & & CNV_DQLDT_i, CLCN_i, QLCN_i, QICN_i, & & CNV_MFD_i, cf_upi, CNV_FICE_i, CNV_NDROP_i, & & CNV_NICE_i, w_upi @@ -214,8 +214,9 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ! & CNVPRCP ! output - real (kind=kind_phys),dimension(:,:), intent(out) :: lwm_o, qi_o, & - cldreffl, cldreffi, cldreffr, cldreffs, cldreffg + real (kind=kind_phys),dimension(:,:), intent(out) :: lwm_o, qi_o + real (kind=kind_phys),dimension(:,:), intent(out), optional :: & + cldreffl, cldreffi, cldreffr, cldreffs, cldreffg real (kind=kind_phys),dimension(:), intent(out) :: rn_o, sr_o character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -224,10 +225,10 @@ subroutine m_micro_run( im, lm, flipv, dt_i & ! Anning Cheng 10/24/2016 twat for total water, diagnostic purpose integer, dimension(:), intent(inout):: KCBL real (kind=kind_phys),dimension(:,:),intent(inout):: q_io, t_io, & - & ncpl_io,ncpi_io,CLLS_io - real (kind=kind_phys),dimension(:,:),intent(inout):: rnw_io,snw_io,& - & ncpr_io, ncps_io, & - & qgl_io, ncgl_io + & ncpi_io + real (kind=kind_phys),dimension(:,:),intent(inout), optional :: & + rnw_io, snw_io, ncpr_io, ncps_io, qgl_io, ncgl_io, ncpl_io, & + CLLS_io ! *GJF !Moo real (kind=kind_phys),dimension(im,lm),intent(inout):: CLLS_io diff --git a/physics/MP/Morrison_Gettelman/m_micro_post.F90 b/physics/MP/Morrison_Gettelman/m_micro_post.F90 index a61ee4874..0a91e25ef 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_post.F90 +++ b/physics/MP/Morrison_Gettelman/m_micro_post.F90 @@ -22,12 +22,12 @@ subroutine m_micro_post_run( & integer, intent(in) :: im, levs, fprcp logical, intent(in) :: mg3_as_mg2 - real(kind=kind_phys), intent(in ) :: ncpr(:,:) - real(kind=kind_phys), intent(in ) :: ncps(:,:) - real(kind=kind_phys), intent(in ) :: ncgl(:,:) - real(kind=kind_phys), intent(inout) :: qrn(:,:) - real(kind=kind_phys), intent(inout) :: qsnw(:,:) - real(kind=kind_phys), intent(inout) :: qgl(:,:) + real(kind=kind_phys), intent(in ),optional :: ncpr(:,:) + real(kind=kind_phys), intent(in ),optional :: ncps(:,:) + real(kind=kind_phys), intent(in ),optional :: ncgl(:,:) + real(kind=kind_phys), intent(inout),optional :: qrn(:,:) + real(kind=kind_phys), intent(inout),optional :: qsnw(:,:) + real(kind=kind_phys), intent(inout),optional :: qgl(:,:) real(kind=kind_phys), intent(in ) :: gq0_ice(:,:) real(kind=kind_phys), intent(out ) :: gq0_rain(:,:) real(kind=kind_phys), intent(out ) :: gq0_snow(:,:) diff --git a/physics/MP/Morrison_Gettelman/m_micro_pre.F90 b/physics/MP/Morrison_Gettelman/m_micro_pre.F90 index 9893e0db1..4709a1611 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_pre.F90 +++ b/physics/MP/Morrison_Gettelman/m_micro_pre.F90 @@ -25,16 +25,15 @@ subroutine m_micro_pre_run (im, levs, do_shoc, skip_macro, fprcp, mg3_as_mg2, gq real(kind=kind_phys), intent(in) :: & gq0_ice(:,:), gq0_water(:,:), gq0_rain(:,:), gq0_snow(:,:), & gq0_graupel(:,:), gq0_rain_nc(:,:), gq0_snow_nc(:,:), & - gq0_graupel_nc(:,:), cld_shoc(:,:), cnvc(:,:), cnvw(:,:), & - gt0(:,:) - - real(kind=kind_phys), intent(inout) :: & + gq0_graupel_nc(:,:), cnvc(:,:), cnvw(:,:), gt0(:,:) + real(kind=kind_phys), intent(in), optional :: cld_shoc(:,:) + real(kind=kind_phys), intent(inout), optional :: & qrn(:,:), qsnw(:,:), qgl(:,:), ncpr(:,:), ncps(:,:), ncgl(:,:), & cld_frc_MG(:,:) real(kind=kind_phys), intent(out) :: clw_ice(:,:), clw_water(:,:) - real(kind=kind_phys), intent(in) :: clcn(:,:) + real(kind=kind_phys), intent(in), optional :: clcn(:,:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -132,4 +131,4 @@ subroutine m_micro_pre_run (im, levs, do_shoc, skip_macro, fprcp, mg3_as_mg2, gq end subroutine m_micro_pre_run - end module m_micro_pre \ No newline at end of file + end module m_micro_pre diff --git a/physics/MP/NSSL/mp_nssl.F90 b/physics/MP/NSSL/mp_nssl.F90 index 5c47bce73..7b21fbbe1 100644 --- a/physics/MP/NSSL/mp_nssl.F90 +++ b/physics/MP/NSSL/mp_nssl.F90 @@ -68,12 +68,12 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & real(kind_phys), intent(inout) :: qi (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qs (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qh (:,:) !(1:ncol,1:nlev) graupel - real(kind_phys), intent(inout) :: ccw(:,:) !(1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: ccw(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: crw(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: cci(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: csw(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: chw(:,:) !(1:ncol,1:nlev) graupel number - real(kind_phys), intent(inout) :: vh (:,:) !(1:ncol,1:nlev) graupel volume + real(kind_phys), intent(inout), optional :: vh (:,:) !(1:ncol,1:nlev) graupel volume ! Local variables: dimensions used in nssl_init integer :: ims,ime, jms,jme, kms,kme, nx, nz, i,k @@ -224,25 +224,25 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & ! Hydrometeors logical, intent(in ) :: convert_dry_rho real(kind_phys), intent(inout) :: spechum(:,:) !(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: cccn(:,:) !(1:ncol,1:nlev) - real(kind_phys), intent(inout) :: cccna(:,:) !(1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: cccn(:,:) !(1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: cccna(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qc (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qr (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qi (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qs (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: qh (:,:) !(1:ncol,1:nlev) graupel - real(kind_phys), intent(inout) :: qhl(:,:) !(1:ncol,1:nlev) hail - real(kind_phys), intent(inout) :: ccw(:,:) !(1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: qhl(:,:) !(1:ncol,1:nlev) hail + real(kind_phys), intent(inout), optional :: ccw(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: crw(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: cci(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: csw(:,:) !(1:ncol,1:nlev) real(kind_phys), intent(inout) :: chw(:,:) !(1:ncol,1:nlev) graupel number - real(kind_phys), intent(inout) :: chl(:,:) !(1:ncol,1:nlev) hail number - real(kind_phys), intent(inout) :: vh (:,:) !(1:ncol,1:nlev) graupel volume - real(kind_phys), intent(inout) :: vhl(:,:) !(1:ncol,1:nlev) hail volume - real(kind_phys), intent(inout) :: zrw(:,:) !(1:ncol,1:nlev) rain reflectivity - real(kind_phys), intent(inout) :: zhw(:,:) !(1:ncol,1:nlev) graupel reflectivity - real(kind_phys), intent(inout) :: zhl(:,:) !(1:ncol,1:nlev) hail reflectivity + real(kind_phys), intent(inout), optional :: chl(:,:) !(1:ncol,1:nlev) hail number + real(kind_phys), intent(inout), optional :: vh (:,:) !(1:ncol,1:nlev) graupel volume + real(kind_phys), intent(inout), optional :: vhl(:,:) !(1:ncol,1:nlev) hail volume + real(kind_phys), intent(inout), optional :: zrw(:,:) !(1:ncol,1:nlev) rain reflectivity + real(kind_phys), intent(inout), optional :: zhw(:,:) !(1:ncol,1:nlev) graupel reflectivity + real(kind_phys), intent(inout), optional :: zhl(:,:) !(1:ncol,1:nlev) hail reflectivity ! State variables and timestep information real(kind_phys), intent(inout) :: tgrs (:,:) !(1:ncol,1:nlev) real(kind_phys), intent(in ) :: prsl (:,:) !(1:ncol,1:nlev) @@ -252,20 +252,20 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & real(kind_phys), intent(in ) :: dtp ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip real(kind_phys), intent( out) :: prcp (:) !(1:ncol) - real(kind_phys), intent( out) :: rain (:) !(1:ncol) - real(kind_phys), intent( out) :: graupel(:) !(1:ncol) - real(kind_phys), intent( out) :: ice (:) !(1:ncol) - real(kind_phys), intent( out) :: snow (:) !(1:ncol) + real(kind_phys), intent( out), optional :: rain (:) !(1:ncol) + real(kind_phys), intent( out), optional :: graupel(:) !(1:ncol) + real(kind_phys), intent( out), optional :: ice (:) !(1:ncol) + real(kind_phys), intent( out), optional :: snow (:) !(1:ncol) real(kind_phys), intent( out) :: sr (:) !(1:ncol) ! Radar reflectivity real(kind_phys), intent(inout) :: refl_10cm(:,:) !(1:ncol,1:nlev) logical, intent(in ) :: do_radar_ref, first_time_step logical, intent(in) :: restart ! Cloud effective radii - real(kind_phys), intent(inout) :: re_cloud(:,:) ! (1:ncol,1:nlev) - real(kind_phys), intent(inout) :: re_ice(:,:) ! (1:ncol,1:nlev) - real(kind_phys), intent(inout) :: re_snow(:,:) ! (1:ncol,1:nlev) - real(kind_phys), intent(inout) :: re_rain(:,:) ! (1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: re_cloud(:,:) ! (1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: re_ice(:,:) ! (1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: re_snow(:,:) ! (1:ncol,1:nlev) + real(kind_phys), intent(inout), optional :: re_rain(:,:) ! (1:ncol,1:nlev) integer, intent(in) :: nleffr, nieffr, nseffr, nreffr integer, intent(in) :: imp_physics integer, intent(in) :: imp_physics_nssl diff --git a/physics/MP/Thompson/mp_thompson.F90 b/physics/MP/Thompson/mp_thompson.F90 index 120ca30a7..4bb9964ba 100644 --- a/physics/MP/Thompson/mp_thompson.F90 +++ b/physics/MP/Thompson/mp_thompson.F90 @@ -64,11 +64,11 @@ subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, & ! Aerosols logical, intent(in ) :: is_aerosol_aware logical, intent(in ) :: merra2_aerosol_aware - real(kind_phys), intent(inout) :: nc(:,:) - real(kind_phys), intent(inout) :: nwfa(:,:) - real(kind_phys), intent(inout) :: nifa(:,:) - real(kind_phys), intent(inout) :: nwfa2d(:) - real(kind_phys), intent(inout) :: nifa2d(:) + real(kind_phys), intent(inout), optional :: nc(:,:) + real(kind_phys), intent(inout), optional :: nwfa(:,:) + real(kind_phys), intent(inout), optional :: nifa(:,:) + real(kind_phys), intent(inout), optional :: nwfa2d(:) + real(kind_phys), intent(inout), optional :: nifa2d(:) real(kind_phys), intent(in) :: aerfld(:,:,:) ! State variables real(kind_phys), intent(in ) :: tgrs(:,:) @@ -83,7 +83,7 @@ subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, & integer, intent(in ) :: threads ! Extended diagnostics logical, intent(in ) :: ext_diag - real(kind_phys), intent(in ) :: diag3d(:,:,:) + real(kind_phys), intent(in ), optional :: diag3d(:,:,:) ! CCPP error handling character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg @@ -382,10 +382,10 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real, intent(in ) :: dt_inner ! Precip/rain/snow/graupel fall amounts and fraction of frozen precip real(kind_phys), intent(inout) :: prcp(:) - real(kind_phys), intent(inout) :: rain(:) - real(kind_phys), intent(inout) :: graupel(:) - real(kind_phys), intent(inout) :: ice(:) - real(kind_phys), intent(inout) :: snow(:) + real(kind_phys), intent(inout), optional :: rain(:) + real(kind_phys), intent(inout), optional :: graupel(:) + real(kind_phys), intent(inout), optional :: ice(:) + real(kind_phys), intent(inout), optional :: snow(:) real(kind_phys), intent( out) :: sr(:) ! Radar reflectivity real(kind_phys), intent(inout) :: refl_10cm(:,:) @@ -400,7 +400,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & integer, intent(in) :: mpiroot ! Extended diagnostic output logical, intent(in) :: ext_diag - real(kind_phys), target, intent(inout) :: diag3d(:,:,:) + real(kind_phys), target, intent(inout), optional :: diag3d(:,:,:) logical, intent(in) :: reset_diag3d ! CCPP error handling @@ -410,15 +410,15 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & ! SPP integer, intent(in) :: spp_mp integer, intent(in) :: n_var_spp - real(kind_phys), intent(in) :: spp_wts_mp(:,:) - real(kind_phys), intent(in) :: spp_prt_list(:) - character(len=10), intent(in) :: spp_var_list(:) + real(kind_phys), intent(in), optional :: spp_wts_mp(:,:) + real(kind_phys), intent(in), optional :: spp_prt_list(:) + character(len=10), intent(in), optional :: spp_var_list(:) real(kind_phys), intent(in) :: spp_stddev_cutoff(:) logical, intent (in) :: cplchm ! ice and liquid water 3d precipitation fluxes - only allocated if cplchm is .true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: pfi_lsan - real(kind=kind_phys), intent(inout), dimension(:,:) :: pfl_lsan + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: pfi_lsan + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: pfl_lsan ! Local variables diff --git a/physics/MP/Zhao_Carr/zhaocarr_gscond.f b/physics/MP/Zhao_Carr/zhaocarr_gscond.f index 50f9358f4..65091f59f 100644 --- a/physics/MP/Zhao_Carr/zhaocarr_gscond.f +++ b/physics/MP/Zhao_Carr/zhaocarr_gscond.f @@ -103,7 +103,7 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & real(kind=kind_phys), intent(inout) :: q(:,:) real(kind=kind_phys), intent(in) :: clw1(:,:), clw2(:,:) real(kind=kind_phys), intent(out) :: cwm(:,:) - real(kind=kind_phys), intent(inout) :: t(:,:) & + real(kind=kind_phys), intent(inout), optional :: t(:,:) & &, tp(:,:), qp(:,:), psp(:) & &, tp1(:,:), qp1(:,:), psp1(:) real(kind=kind_phys), intent(in) :: u(:,:) From f8f8c2c86263f3d8c311e22215f8282e830f5969 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 17:48:20 +0000 Subject: [PATCH 04/11] Add optional attribute to Convection files, and MP file omitted from previous committ. --- physics/CONV/C3/cu_c3_driver.F90 | 29 +++++++++++-------- physics/CONV/C3/cu_c3_driver_post.F90 | 15 +++++----- physics/CONV/C3/cu_c3_driver_pre.F90 | 16 +++++----- physics/CONV/Chikira_Sugiyama/cs_conv.F90 | 7 +++-- .../CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 | 4 +-- physics/CONV/Grell_Freitas/cu_gf_driver.F90 | 28 ++++++++++-------- .../CONV/Grell_Freitas/cu_gf_driver_post.F90 | 15 +++++----- .../CONV/Grell_Freitas/cu_gf_driver_pre.F90 | 19 ++++++------ physics/CONV/RAS/rascnv.F90 | 8 +++-- physics/CONV/SAMF/samfdeepcnv.f | 17 ++++++----- physics/CONV/SAMF/samfshalcnv.f | 11 ++++--- physics/CONV/SAS/sascnvn.F | 6 ++-- physics/CONV/SAS/shalcnv.F | 3 +- physics/CONV/nTiedtke/cu_ntiedtke.F90 | 6 ++-- physics/CONV/nTiedtke/cu_ntiedtke_post.F90 | 4 +-- physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 | 8 ++--- physics/MP/GFDL/gfdl_cloud_microphys.F90 | 12 ++++---- 17 files changed, 115 insertions(+), 93 deletions(-) diff --git a/physics/CONV/C3/cu_c3_driver.F90 b/physics/CONV/C3/cu_c3_driver.F90 index c911ff5e4..8057ed030 100644 --- a/physics/CONV/C3/cu_c3_driver.F90 +++ b/physics/CONV/C3/cu_c3_driver.F90 @@ -111,18 +111,19 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& real (kind=kind_phys), intent(in) :: g,cp,fv,r_d,xlv,r_v,betascu,betamcu,betadcu logical, intent(in ) :: ldiag3d logical, intent(in ) :: progsigma - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) !$acc declare copy(dtend) integer, intent(in) :: dtidx(:,:), & index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_scnv, index_of_process_dcnv, ntqv, ntcw, ntiw !$acc declare copyin(dtidx) - real(kind=kind_phys), dimension( : , : ), intent(in ) :: forcet,forceqv_spechum,w,phil,delp - real(kind=kind_phys), dimension ( : , : ), intent(in ) :: sigmain,qmicro + real(kind=kind_phys), dimension( : , : ), intent(in ), optional :: forcet,forceqv_spechum + real(kind=kind_phys), dimension( : , : ), intent(in ) :: w,phil,delp + real(kind=kind_phys), dimension ( : , : ), intent(in ), optional :: sigmain,qmicro real(kind=kind_phys), dimension( : , : ), intent(inout ) :: t,us,vs - real(kind=kind_phys), dimension( : , : ), intent(inout ) :: qci_conv + real(kind=kind_phys), dimension( : , : ), intent(inout ), optional :: qci_conv real(kind=kind_phys), dimension( : , : ), intent(out ) :: cnvw_moist,cnvc - real(kind=kind_phys), dimension ( : , : ), intent(out ) :: sigmaout + real(kind=kind_phys), dimension ( : , : ), intent(out ), optional :: sigmaout real(kind=kind_phys), dimension( : , : ), intent(inout ) :: cliw, clcw real(kind=kind_phys), dimension ( : , : , :), intent(in ) :: tmf !$acc declare copyin(forcet,forceqv_spechum,w,phil) @@ -134,27 +135,31 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer, intent(in) :: dfi_radar_max_intervals real(kind=kind_phys), intent(in) :: fhour, fh_dfi_radar(:) integer, intent(in) :: num_dfi_radar, ix_dfi_radar(:) - real(kind=kind_phys), intent(in) :: cap_suppress(:,:) + real(kind=kind_phys), intent(in), optional :: cap_suppress(:,:) !$acc declare copyin(fh_dfi_radar,ix_dfi_radar,cap_suppress) integer, dimension (:), intent(out) :: hbot,htop,kcnv integer, dimension (:), intent(in) :: xland - real(kind=kind_phys), dimension (:), intent(in) :: pbl,maxMF + real(kind=kind_phys), dimension (:), intent(in) :: pbl + real(kind=kind_phys), dimension (:), intent(in), optional :: maxMF !$acc declare copyout(hbot,htop,kcnv) !$acc declare copyin(xland,pbl) integer, dimension (im) :: tropics !$acc declare create(tropics) ! ruc variable - real(kind=kind_phys), dimension (:), intent(in) :: hfx2,qfx2,psuri,ca_deep - real(kind=kind_phys), dimension (:,:), intent(out) :: ud_mf,dd_mf,dt_mf - real(kind=kind_phys), dimension (:), intent(out) :: raincv,cld1d,maxupmf,rainevap + real(kind=kind_phys), dimension (:), intent(in) :: hfx2,qfx2,psuri + real(kind=kind_phys), dimension (:), intent(in), optional :: ca_deep + real(kind=kind_phys), dimension (:,:), intent(out), optional :: ud_mf + real(kind=kind_phys), dimension (:,:), intent(out) :: dd_mf,dt_mf + real(kind=kind_phys), dimension (:), intent(out) :: raincv,cld1d,rainevap + real(kind=kind_phys), dimension (:), intent(out), optional :: maxupmf real(kind=kind_phys), dimension (:,:), intent(in) :: t2di,p2di !$acc declare copyin(hfx2,qfx2,psuri,t2di,p2di) !$acc declare copyout(ud_mf,dd_mf,dt_mf,raincv,cld1d) ! Specific humidity from FV3 real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum - real(kind=kind_phys), dimension (:), intent(inout) :: aod_gf + real(kind=kind_phys), dimension (:), intent(inout), optional :: aod_gf !$acc declare copyin(qv2di_spechum) copy(qv_spechum,aod_gf) ! Local water vapor mixing ratios and cloud water mixing ratios real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw @@ -165,7 +170,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& real(kind=kind_phys), intent(in ) :: dt integer, intent(in ) :: imfshalcnv - integer, dimension(:), intent(inout) :: cactiv,cactiv_m + integer, dimension(:), intent(inout), optional :: cactiv,cactiv_m !$acc declare copy(cactiv,cactiv_m) character(len=*), intent(out) :: errmsg diff --git a/physics/CONV/C3/cu_c3_driver_post.F90 b/physics/CONV/C3/cu_c3_driver_post.F90 index d5d2dee3b..28ddbf62b 100644 --- a/physics/CONV/C3/cu_c3_driver_post.F90 +++ b/physics/CONV/C3/cu_c3_driver_post.F90 @@ -26,15 +26,16 @@ subroutine cu_c3_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m real(kind_phys), intent(in) :: t(:,:) real(kind_phys), intent(in) :: q(:,:) real(kind_phys), dimension(:),intent(in) :: garea - real(kind_phys), intent(out) :: prevst(:,:) - real(kind_phys), intent(out) :: prevsq(:,:) - integer, intent(in) :: cactiv(:) - integer, intent(in) :: cactiv_m(:) - real(kind_phys), intent(out) :: conv_act(:) - real(kind_phys), intent(out) :: conv_act_m(:) + real(kind_phys), intent(out), optional :: prevst(:,:) + real(kind_phys), intent(out), optional :: prevsq(:,:) + integer, intent(in), optional :: cactiv(:) + integer, intent(in), optional :: cactiv_m(:) + real(kind_phys), intent(out), optional :: conv_act(:) + real(kind_phys), intent(out), optional :: conv_act_m(:) ! for Radar reflectivity real(kind_phys), intent(in) :: dt - real(kind_phys), intent(in) :: raincv(:), maxupmf(:) + real(kind_phys), intent(in) :: raincv(:) + real(kind_phys), intent(in), optional :: maxupmf(:) real(kind_phys), intent(inout) :: refl_10cm(:,:) character(len=*), intent(out) :: errmsg !$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m) diff --git a/physics/CONV/C3/cu_c3_driver_pre.F90 b/physics/CONV/C3/cu_c3_driver_pre.F90 index c6e79059b..368687116 100644 --- a/physics/CONV/C3/cu_c3_driver_pre.F90 +++ b/physics/CONV/C3/cu_c3_driver_pre.F90 @@ -30,16 +30,16 @@ subroutine cu_c3_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, real(kind_phys), intent(in) :: dtp real(kind_phys), intent(in) :: t(:,:) real(kind_phys), intent(in) :: q(:,:) - real(kind_phys), intent(in) :: prevst(:,:) - real(kind_phys), intent(in) :: prevsq(:,:) + real(kind_phys), intent(in), optional :: prevst(:,:) + real(kind_phys), intent(in), optional :: prevsq(:,:) !$acc declare copyin(t,q,prevst,prevsq) - real(kind_phys), intent(out) :: forcet(:,:) - real(kind_phys), intent(out) :: forceq(:,:) - integer, intent(out) :: cactiv(:) - integer, intent(out) :: cactiv_m(:) + real(kind_phys), intent(out), optional :: forcet(:,:) + real(kind_phys), intent(out), optional :: forceq(:,:) + integer, intent(out), optional :: cactiv(:) + integer, intent(out), optional :: cactiv_m(:) !$acc declare copyout(forcet,forceq,cactiv,cactiv_m) - real(kind_phys), intent(in) :: conv_act(:) - real(kind_phys), intent(in) :: conv_act_m(:) + real(kind_phys), intent(in), optional :: conv_act(:) + real(kind_phys), intent(in), optional :: conv_act_m(:) !$acc declare copyin(conv_act,conv_act_m) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 index 4e7030dd5..02c834ffa 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 @@ -195,18 +195,19 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! ! modified arguments ! - real(kind_phys), intent(inout) :: CBMFX(:,:) ! cloud base mass flux (kg/m2/s) + real(kind_phys), intent(inout), optional :: CBMFX(:,:) ! cloud base mass flux (kg/m2/s) ! ! output arguments ! ! updraft, downdraft, and detrainment mass flux (kg/m2/s) - real(kind_phys), intent(inout), dimension(:,:) :: ud_mf, dd_mf, dt_mf + real(kind_phys), intent(inout), dimension(:,:), optional :: ud_mf + real(kind_phys), intent(inout), dimension(:,:) :: dd_mf, dt_mf real(kind_phys), intent(out) :: rain1(:) ! lwe thickness of deep convective precipitation amount (m) ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared ! using assumed shape. - real(kind_phys), intent(out), dimension(:,:) :: qlcn, qicn, w_upi,cnv_mfd, & + real(kind_phys), intent(out), dimension(:,:), optional :: qlcn, qicn, w_upi,cnv_mfd, & cnv_dqldt, clcn, cnv_fice, & cnv_ndrop, cnv_nice, cf_upi ! *GJF diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 index bd0444bab..2d74779d1 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 +++ b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 @@ -40,8 +40,8 @@ subroutine cs_conv_aw_adj_run(im, levs, do_cscnv, do_aw, do_shoc, & real(kind_phys), dimension(:,:), intent(in) :: save_t real(kind_phys), dimension(:,:,:), intent(in) :: save_q real(kind_phys), dimension(:,:), intent(in) :: prsi - real(kind_phys), dimension(:,:), intent(inout) :: cldfrac - real(kind_phys), dimension(:,:), intent(inout) :: subcldfrac + real(kind_phys), dimension(:,:), intent(inout), optional :: cldfrac + real(kind_phys), dimension(:,:), intent(inout), optional :: subcldfrac real(kind_phys), dimension(:), intent(inout) :: prcp integer, intent(in ) :: imp_physics, imp_physics_mg character(len=*), intent( out) :: errmsg diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver.F90 index 54a23ca74..9db7dcfd9 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.F90 @@ -82,7 +82,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer :: ichoicem=13 ! 0 2 5 13 integer :: ichoice_s=3 ! 0 1 2 3 integer, intent(in) :: spp_cu_deep ! flag for using SPP perturbations - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in),optional :: & & spp_wts_cu_deep real(kind=kind_phys) :: spp_wts_cu_deep_tmp @@ -102,15 +102,16 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& real (kind=kind_phys), intent(in) :: g,cp,xlv,r_v logical, intent(in ) :: ldiag3d - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) !$acc declare copy(dtend) integer, intent(in) :: dtidx(:,:), & index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_scnv, index_of_process_dcnv, ntqv, ntcw, ntiw !$acc declare copyin(dtidx) - real(kind=kind_phys), dimension( : , : ), intent(in ) :: forcet,forceqv_spechum,w,phil + real(kind=kind_phys), dimension( : , : ), intent(in ), optional :: forcet,forceqv_spechum + real(kind=kind_phys), dimension( : , : ), intent(in ) :: w,phil real(kind=kind_phys), dimension( : , : ), intent(inout ) :: t,us,vs - real(kind=kind_phys), dimension( : , : ), intent(inout ) :: qci_conv + real(kind=kind_phys), dimension( : , : ), intent(inout ), optional :: qci_conv real(kind=kind_phys), dimension( : , : ), intent(out ) :: cnvw_moist,cnvc real(kind=kind_phys), dimension( : , : ), intent(inout ) :: cliw, clcw !$acc declare copyin(forcet,forceqv_spechum,w,phil) @@ -122,27 +123,30 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer, intent(in) :: dfi_radar_max_intervals real(kind=kind_phys), intent(in) :: fhour, fh_dfi_radar(:) integer, intent(in) :: num_dfi_radar, ix_dfi_radar(:) - real(kind=kind_phys), intent(in) :: cap_suppress(:,:) + real(kind=kind_phys), intent(in), optional :: cap_suppress(:,:) !$acc declare copyin(fh_dfi_radar,ix_dfi_radar,cap_suppress) integer, dimension (:), intent(out) :: hbot,htop,kcnv integer, dimension (:), intent(in) :: xland - real(kind=kind_phys), dimension (:), intent(in) :: pbl,maxMF + real(kind=kind_phys), dimension (:), intent(in) :: pbl + real(kind=kind_phys), dimension (:), intent(in), optional :: maxMF !$acc declare copyout(hbot,htop,kcnv) !$acc declare copyin(xland,pbl) integer, dimension (im) :: tropics !$acc declare create(tropics) ! ruc variable real(kind=kind_phys), dimension (:), intent(in) :: hfx2,qfx2,psuri - real(kind=kind_phys), dimension (:,:), intent(out) :: ud_mf,dd_mf,dt_mf - real(kind=kind_phys), dimension (:), intent(out) :: raincv,cld1d,maxupmf + real(kind=kind_phys), dimension (:,:), intent(out) :: dd_mf,dt_mf + real(kind=kind_phys), dimension (:,:), intent(out), optional :: ud_mf + real(kind=kind_phys), dimension (:), intent(out) :: raincv,cld1d + real(kind=kind_phys), dimension (:), intent(out), optional :: maxupmf real(kind=kind_phys), dimension (:,:), intent(in) :: t2di,p2di !$acc declare copyin(hfx2,qfx2,psuri,t2di,p2di) !$acc declare copyout(ud_mf,dd_mf,dt_mf,raincv,cld1d) ! Specific humidity from FV3 real(kind=kind_phys), dimension (:,:), intent(in) :: qv2di_spechum real(kind=kind_phys), dimension (:,:), intent(inout) :: qv_spechum - real(kind=kind_phys), dimension (:), intent(inout) :: aod_gf + real(kind=kind_phys), dimension (:), intent(inout), optional :: aod_gf !$acc declare copyin(qv2di_spechum) copy(qv_spechum,aod_gf) ! Local water vapor mixing ratios and cloud water mixing ratios real(kind=kind_phys), dimension (im,km) :: qv2di, qv, forceqv, cnvw @@ -153,11 +157,11 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& real(kind=kind_phys), intent(in ) :: dt integer, intent(in ) :: imfshalcnv - integer, dimension(:), intent(inout) :: cactiv,cactiv_m + integer, dimension(:), intent(inout), optional :: cactiv,cactiv_m real(kind_phys), dimension(:), intent(in) :: fscav !$acc declare copyin(fscav) - real(kind_phys), dimension(:,:,:), intent(inout) :: chem3d - real(kind_phys), dimension(:,:), intent(inout) :: wetdpc_deep + real(kind_phys), dimension(:,:,:), intent(inout), optional :: chem3d + real(kind_phys), dimension(:,:), intent(inout), optional :: wetdpc_deep !$acc declare copy(cactiv,cactiv_m,chem3d,wetdpc_deep) character(len=*), intent(out) :: errmsg diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver_post.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver_post.F90 index 6ed1321bc..02bb3cb84 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver_post.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_post.F90 @@ -25,15 +25,16 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m integer, intent(in) :: im, km real(kind_phys), intent(in) :: t(:,:) real(kind_phys), intent(in) :: q(:,:) - real(kind_phys), intent(out) :: prevst(:,:) - real(kind_phys), intent(out) :: prevsq(:,:) - integer, intent(in) :: cactiv(:) - integer, intent(in) :: cactiv_m(:) - real(kind_phys), intent(out) :: conv_act(:) - real(kind_phys), intent(out) :: conv_act_m(:) + real(kind_phys), intent(out), optional :: prevst(:,:) + real(kind_phys), intent(out), optional :: prevsq(:,:) + integer, intent(in), optional :: cactiv(:) + integer, intent(in), optional :: cactiv_m(:) + real(kind_phys), intent(out), optional :: conv_act(:) + real(kind_phys), intent(out), optional :: conv_act_m(:) logical, intent(in) :: rrfs_sd integer, intent(in) :: ntsmoke, ntdust, ntcoarsepm - real(kind_phys), intent(inout) :: chem3d(:,:,:), gq0(:,:,:) + real(kind_phys), intent(inout), optional :: chem3d(:,:,:) + real(kind_phys), intent(inout) :: gq0(:,:,:) character(len=*), intent(out) :: errmsg !$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m,chem3d,gq0) integer, intent(out) :: errflg diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90 index 7ff66be21..1bc9aed34 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90 @@ -32,18 +32,19 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, real(kind_phys), intent(in) :: dtp real(kind_phys), intent(in) :: t(:,:) real(kind_phys), intent(in) :: q(:,:) - real(kind_phys), intent(in) :: prevst(:,:) - real(kind_phys), intent(in) :: prevsq(:,:) + real(kind_phys), intent(in), optional :: prevst(:,:) + real(kind_phys), intent(in), optional :: prevsq(:,:) !$acc declare copyin(t,q,prevst,prevsq) - real(kind_phys), intent(out) :: forcet(:,:) - real(kind_phys), intent(out) :: forceq(:,:) - integer, intent(out) :: cactiv(:) - integer, intent(out) :: cactiv_m(:) + real(kind_phys), intent(out), optional :: forcet(:,:) + real(kind_phys), intent(out), optional :: forceq(:,:) + integer, intent(out), optional :: cactiv(:) + integer, intent(out), optional :: cactiv_m(:) integer, intent(in) :: ntsmoke, ntdust, ntcoarsepm !$acc declare copyout(forcet,forceq,cactiv,cactiv_m) - real(kind_phys), intent(in) :: conv_act(:) - real(kind_phys), intent(in) :: conv_act_m(:) - real(kind_phys), intent(inout) :: chem3d(:,:,:), gq0(:,:,:) + real(kind_phys), intent(in), optional :: conv_act(:) + real(kind_phys), intent(in), optional :: conv_act_m(:) + real(kind_phys), intent(inout), optional :: chem3d(:,:,:) + real(kind_phys), intent(inout) :: gq0(:,:,:) !$acc declare copyin(conv_act,conv_act_m) copy(chem3d,gq0) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/CONV/RAS/rascnv.F90 b/physics/CONV/RAS/rascnv.F90 index 0b57de1fe..a6f21ea30 100644 --- a/physics/CONV/RAS/rascnv.F90 +++ b/physics/CONV/RAS/rascnv.F90 @@ -331,14 +331,16 @@ subroutine rascnv_run(IM, k, itc, ntc, ntr, dt, dtf & real(kind=kind_phys), dimension(:,:), intent(inout) :: tin, qin, uin, vin real(kind=kind_phys), dimension(:,:), intent(in) :: prsl, prslk, phil & &, rhc - real(kind=kind_phys), dimension(:,:), intent(out) :: ud_mf, dd_mf, dt_mf - real(kind=kind_phys), dimension(:,:), intent(inout) :: qlcn, qicn, w_upi & + real(kind=kind_phys), dimension(:,:), intent(out), optional :: ud_mf + real(kind=kind_phys), dimension(:,:), intent(out) :: dd_mf, dt_mf + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: qlcn, qicn, w_upi & &, cnv_mfd & &, cnv_dqldt, clcn & &, cnv_fice, cnv_ndrop & &, cnv_nice, cf_upi real(kind=kind_phys), dimension(:) , intent(in) :: area, cdrag - real(kind=kind_phys), dimension(:) , intent(out) :: rainc, ddvel + real(kind=kind_phys), dimension(:) , intent(out) :: rainc + real(kind=kind_phys), dimension(:) , intent(out), optional :: ddvel real(kind=kind_phys), dimension(:,:), intent(in) :: rannum real(kind=kind_phys), intent(inout) :: ccin(:,:,:) real(kind=kind_phys), intent(in) :: dt, dtf diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index 5853254c0..7c2d9acf8 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -103,12 +103,13 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & & progsigma,do_mynnedmf real(kind=kind_phys), intent(in) :: nthresh,betadcu,betamcu, & & betascu - real(kind=kind_phys), intent(in) :: ca_deep(:) - real(kind=kind_phys), intent(in) :: sigmain(:,:),qmicro(:,:), & - & tmf(:,:,:),q(:,:), prevsq(:,:) - real(kind=kind_phys), dimension (:), intent(in) :: maxMF + real(kind=kind_phys), intent(in), optional :: ca_deep(:) + real(kind=kind_phys), intent(in), optional :: sigmain(:,:), & + & qmicro(:,:), prevsq(:,:) + real(kind=kind_phys), intent(in) :: tmf(:,:,:),q(:,:) + real(kind=kind_phys), dimension (:), intent(in), optional :: maxMF real(kind=kind_phys), intent(out) :: rainevap(:) - real(kind=kind_phys), intent(out) :: sigmaout(:,:) + real(kind=kind_phys), intent(out), optional :: sigmaout(:,:) logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger integer, intent(inout) :: kcnv(:) ! DH* TODO - check dimensions of qtr, ntr+2 correct? *DH @@ -119,12 +120,12 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & integer, intent(out) :: kbot(:), ktop(:) real(kind=kind_phys), intent(out) :: cldwrk(:), & & rn(:), & - & ud_mf(:,:),dd_mf(:,:), dt_mf(:,:) - + & dd_mf(:,:), dt_mf(:,:) + real(kind=kind_phys), intent(out), optional :: ud_mf(:,:) ! GJF* These variables are conditionally allocated depending on whether the ! Morrison-Gettelman microphysics is used, so they must be declared ! using assumed shape. - real(kind=kind_phys), dimension(:,:), intent(inout) :: & + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: & & qlcn, qicn, w_upi, cnv_mfd, cnv_dqldt, clcn & &, cnv_fice, cnv_ndrop, cnv_nice, cf_upi ! *GJF diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index d0bab05dd..f720c4701 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -72,9 +72,10 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & real(kind=kind_phys), intent(in) :: delt real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & & prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:), & - & qmicro(:,:),tmf(:,:,:),prevsq(:,:),q(:,:) - - real(kind=kind_phys), intent(in) :: sigmain(:,:) + & tmf(:,:,:), q(:,:) + real(kind=kind_phys), intent(in), optional :: qmicro(:,:), & + & prevsq(:,:) + real(kind=kind_phys), intent(in), optional :: sigmain(:,:) ! real(kind=kind_phys), dimension(:), intent(in) :: fscav integer, intent(inout) :: kcnv(:) @@ -84,8 +85,10 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & ! integer, intent(out) :: kbot(:), ktop(:) real(kind=kind_phys), intent(out) :: rn(:), & - & cnvw(:,:), cnvc(:,:), ud_mf(:,:), dt_mf(:,:), sigmaout(:,:) + & cnvw(:,:), cnvc(:,:), dt_mf(:,:) ! + real(kind=kind_phys), intent(out), optional :: ud_mf(:,:), & + & sigmaout(:,:) real(kind=kind_phys), intent(in) :: clam, c0s, c1, & & asolfac, evef, pgcon logical, intent(in) :: hwrf_samfshal,first_time_step, & diff --git a/physics/CONV/SAS/sascnvn.F b/physics/CONV/SAS/sascnvn.F index 673231e05..709e4dd5b 100644 --- a/physics/CONV/SAS/sascnvn.F +++ b/physics/CONV/SAS/sascnvn.F @@ -126,9 +126,9 @@ subroutine sascnvn_run( & u1(:,:), v1(:,:), & & cnvw(:,:), cnvc(:,:) real(kind=kind_phys), intent(out) :: cldwrk(:), rn(:), & - & ud_mf(:,:), dd_mf(:,:), & - & dt_mf(:,:) - real(kind=kind_phys), intent(inout) :: & + & dt_mf(:,:), dd_mf(:,:) + real(kind=kind_phys), intent(out), optional :: ud_mf(:,:) + real(kind=kind_phys), intent(inout), optional :: & & qlcn(:,:), qicn(:,:), & & w_upi(:,:), cnv_mfd(:,:), & & cnv_dqldt(:,:), clcn(:,:), & diff --git a/physics/CONV/SAS/shalcnv.F b/physics/CONV/SAS/shalcnv.F index 3b8d706cd..3224ed125 100644 --- a/physics/CONV/SAS/shalcnv.F +++ b/physics/CONV/SAS/shalcnv.F @@ -123,7 +123,8 @@ subroutine shalcnv_run( & & q1(:,:), t1(:,:), & & u1(:,:), v1(:,:), & & cnvw(:,:), cnvc(:,:) - real(kind=kind_phys), intent(out) :: rn(:), ud_mf(:,:), dt_mf(:,:) + real(kind=kind_phys), intent(out) :: rn(:), dt_mf(:,:) + real(kind=kind_phys), intent(out), optional :: ud_mf(:,:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg ! diff --git a/physics/CONV/nTiedtke/cu_ntiedtke.F90 b/physics/CONV/nTiedtke/cu_ntiedtke.F90 index 0be7df95a..ada38c6f5 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke.F90 +++ b/physics/CONV/nTiedtke/cu_ntiedtke.F90 @@ -171,13 +171,15 @@ subroutine cu_ntiedtke_run(pu,pv,pt,pqv,tdi,qvdi,pqvf,ptf,clw,poz,pzz,prsl,prsi, integer, dimension( : ), intent(in) :: lmask real(kind=kind_phys), dimension( : ), intent(in ) :: evap, hfx, dx real(kind=kind_phys), dimension( :, : ), intent(inout) :: pu, pv, pt, pqv - real(kind=kind_phys), dimension( :, :), intent(in ) :: tdi, qvdi, poz, prsl, pomg, pqvf, ptf + real(kind=kind_phys), dimension( :, :), intent(in ) :: tdi, qvdi, poz, prsl, pomg + real(kind=kind_phys), dimension( :, :), intent(in ), optional :: pqvf, ptf real(kind=kind_phys), dimension( :, : ), intent(in ) :: pzz, prsi real(kind=kind_phys), dimension( :, :, : ), intent(inout ) :: clw integer, dimension( : ), intent(out) :: kbot, ktop, kcnv real(kind=kind_phys), dimension( : ), intent(out) :: zprecc - real(kind=kind_phys), dimension (:, :), intent(out) :: ud_mf, dd_mf, dt_mf, cnvw, cnvc + real(kind=kind_phys), dimension (:, :), intent(out), optional :: ud_mf + real(kind=kind_phys), dimension (:, :), intent(out) :: dd_mf, dt_mf, cnvw, cnvc ! error messages character(len=*), intent(out) :: errmsg diff --git a/physics/CONV/nTiedtke/cu_ntiedtke_post.F90 b/physics/CONV/nTiedtke/cu_ntiedtke_post.F90 index 8b3c99681..583dfd57d 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke_post.F90 +++ b/physics/CONV/nTiedtke/cu_ntiedtke_post.F90 @@ -23,8 +23,8 @@ subroutine cu_ntiedtke_post_run (t, q, prevst, prevsq, errmsg, errflg) ! Interface variables real(kind_phys), intent(in) :: t(:,:) real(kind_phys), intent(in) :: q(:,:) - real(kind_phys), intent(out) :: prevst(:,:) - real(kind_phys), intent(out) :: prevsq(:,:) + real(kind_phys), intent(out), optional :: prevst(:,:) + real(kind_phys), intent(out), optional :: prevsq(:,:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 b/physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 index abdffcb49..81a55176d 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 +++ b/physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 @@ -28,10 +28,10 @@ subroutine cu_ntiedtke_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, real(kind_phys), intent(in) :: dtp real(kind_phys), intent(in) :: t(:,:) real(kind_phys), intent(in) :: q(:,:) - real(kind_phys), intent(in) :: prevst(:,:) - real(kind_phys), intent(in) :: prevsq(:,:) - real(kind_phys), intent(out) :: forcet(:,:) - real(kind_phys), intent(out) :: forceq(:,:) + real(kind_phys), intent(in), optional :: prevst(:,:) + real(kind_phys), intent(in), optional :: prevsq(:,:) + real(kind_phys), intent(out), optional :: forcet(:,:) + real(kind_phys), intent(out), optional :: forceq(:,:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/MP/GFDL/gfdl_cloud_microphys.F90 b/physics/MP/GFDL/gfdl_cloud_microphys.F90 index 0fd84c7ea..8b149616e 100644 --- a/physics/MP/GFDL/gfdl_cloud_microphys.F90 +++ b/physics/MP/GFDL/gfdl_cloud_microphys.F90 @@ -144,10 +144,10 @@ subroutine gfdl_cloud_microphys_run( real(kind=kind_phys), intent(in ), dimension(:,:) :: phii ! rain/snow/ice/graupel/precip amounts, fraction of frozen precip - real(kind_phys), intent(out ), dimension(:) :: rain0 - real(kind_phys), intent(out ), dimension(:) :: snow0 - real(kind_phys), intent(out ), dimension(:) :: ice0 - real(kind_phys), intent(out ), dimension(:) :: graupel0 + real(kind_phys), intent(out ), dimension(:), optional :: rain0 + real(kind_phys), intent(out ), dimension(:), optional :: snow0 + real(kind_phys), intent(out ), dimension(:), optional :: ice0 + real(kind_phys), intent(out ), dimension(:), optional :: graupel0 real(kind_phys), intent(out ), dimension(:) :: prcp0 real(kind_phys), intent(out ), dimension(:) :: sr @@ -157,10 +157,10 @@ subroutine gfdl_cloud_microphys_run( logical, intent (in) :: lradar real(kind=kind_phys), intent(inout), dimension(:,:) :: refl_10cm logical, intent (in) :: reset, effr_in - real(kind=kind_phys), intent(inout), dimension(:,:) :: rew, rei, rer, res, reg + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: rew, rei, rer, res, reg logical, intent (in) :: cplchm ! ice and liquid water 3d precipitation fluxes - only allocated if cplchm is .true. - real(kind=kind_phys), intent(inout), dimension(:,:) :: pfi_lsan, pfl_lsan + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: pfi_lsan, pfl_lsan character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg From 5f0ca0bf548bef7965e73e6208ce4fa87c5eb538 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 18:19:59 +0000 Subject: [PATCH 05/11] Add optional attribute to Radiation files. --- physics/Radiation/RRTMG/radlw_main.F90 | 2 +- physics/Radiation/RRTMG/radsw_main.F90 | 3 ++- .../Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 | 7 ++++--- physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 | 16 +++++++++------- physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 | 17 ++++++++++------- 5 files changed, 26 insertions(+), 19 deletions(-) diff --git a/physics/Radiation/RRTMG/radlw_main.F90 b/physics/Radiation/RRTMG/radlw_main.F90 index 7bc1ea80c..cdf5c69ef 100644 --- a/physics/Radiation/RRTMG/radlw_main.F90 +++ b/physics/Radiation/RRTMG/radlw_main.F90 @@ -609,7 +609,7 @@ subroutine rrtmg_lw_run & integer, intent(in) :: npts, nlay, nlp1, ilwcliq, ilwcice, & isubclw, iovr, iovr_dcorr, iovr_exp, iovr_exprand, iovr_rand,& iovr_maxrand, iovr_max - integer, intent(in) :: icseed(npts) + integer, intent(in), optional :: icseed(npts) logical, intent(in) :: lprnt, inc_minor_gas diff --git a/physics/Radiation/RRTMG/radsw_main.F90 b/physics/Radiation/RRTMG/radsw_main.F90 index fe63963f5..42ee92213 100644 --- a/physics/Radiation/RRTMG/radsw_main.F90 +++ b/physics/Radiation/RRTMG/radsw_main.F90 @@ -689,7 +689,8 @@ subroutine rrtmg_sw_run & isubcsw, iovr, iswmode, iovr_dcorr, iovr_exp, iovr_exprand, & iovr_rand, iovr_maxrand, iovr_max - integer, dimension(:), intent(in) :: idxday, icseed + integer, dimension(:), intent(in) :: idxday + integer, dimension(:), intent(in), optional :: icseed logical, intent(in) :: lprnt, lsswr, inc_minor_gas, top_at_1 diff --git a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 index 9a92ea98a..7e78c19a3 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 +++ b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 @@ -50,16 +50,17 @@ subroutine rrtmgp_aerosol_optics_run(doSWrad, doLWrad, nCol, nLev, nDay, idxday, lon, & ! Longitude lat, & ! Latitude lsmask ! Land/sea/sea-ice mask - real(kind_phys), dimension(:,:),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in), optional :: & p_lay, & ! Pressure @ layer-centers (Pa) tv_lay, & ! Virtual-temperature @ layer-centers (K) - relhum, & ! Relative-humidity @ layer-centers + relhum ! Relative-humidity @ layer-centers + real(kind_phys), dimension(:,:),intent(in) :: & p_lk ! Exner function @ layer-centers (1) real(kind_phys), dimension(:, :,:),intent(in) :: & tracer ! trace gas concentrations real(kind_phys), dimension(:, :,:),intent(in) :: & aerfld ! aerosol input concentrations - real(kind_phys), dimension(:,:),intent(in) :: & + real(kind_phys), dimension(:,:),intent(in), optional :: & p_lev ! Pressure @ layer-interfaces (Pa) real (kind=kind_phys), dimension(:,:), intent(out) :: & ext550 ! 3d optical extinction for total aerosol species diff --git a/physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 b/physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 index c471f89c5..82a5e274a 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 +++ b/physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 @@ -52,7 +52,7 @@ subroutine rrtmgp_lw_main_init(rrtmgp_root_dir, rrtmgp_lw_file_gas, rrtmgp_lw_fi ! clouds optical properties rrtmgp_lw_file_gas ! RRTMGP file containing coefficients used to compute ! gaseous optical properties - character(len=*), dimension(:), intent(in) :: & + character(len=*), dimension(:), intent(in), optional :: & active_gases_array ! List of active gases from namelist as array) logical, intent(in) :: & doGP_cldoptics_PADE, & ! Use RRTMGP cloud-optics: PADE approximation? @@ -137,12 +137,12 @@ subroutine rrtmgp_lw_main_run(doLWrad, doLWclrsky, top_at_1, doGP_lwscat, iovr_exp, & ! Flag for exponential cloud overlap method iovr_exprand, & ! Flag for exponential-random cloud overlap method isubc_lw ! Flag for cloud-seeding (rng) for cloud-sampling - integer,intent(in),dimension(:) :: & + integer,intent(in),dimension(:), optional :: & icseed_lw ! Seed for random number generation for longwave radiation real(kind_phys), dimension(:), intent(in) :: & semis, & ! Surface-emissivity (1) tsfg ! Skin temperature (K) - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & p_lay, & ! Pressure @ model layer-centers (Pa) t_lay, & ! Temperature (K) p_lev, & ! Pressure @ model layer-interfaces (Pa) @@ -152,7 +152,8 @@ subroutine rrtmgp_lw_main_run(doLWrad, doLWclrsky, top_at_1, doGP_lwscat, vmr_o3, & ! Molar-mixing ratio ozone vmr_ch4, & ! Molar-mixing ratio methane vmr_n2o, & ! Molar-mixing ratio nitrous oxide - vmr_co2, & ! Molar-mixing ratio carbon dioxide + vmr_co2 ! Molar-mixing ratio carbon dioxide + real(kind_phys), dimension(:,:), intent(in) :: & cld_frac, & ! Cloud-fraction for stratiform clouds cld_lwp, & ! Water path for stratiform liquid cloud-particles cld_reliq, & ! Effective radius for stratiform liquid cloud-particles @@ -161,7 +162,8 @@ subroutine rrtmgp_lw_main_run(doLWrad, doLWclrsky, top_at_1, doGP_lwscat, cld_swp, & ! Water path for snow hydrometeors cld_resnow, & ! Effective radius for snow hydrometeors cld_rwp, & ! Water path for rain hydrometeors - cld_rerain, & ! Effective radius for rain hydrometeors + cld_rerain ! Effective radius for rain hydrometeors + real(kind_phys), dimension(:,:), intent(in), optional :: & precip_frac, & ! Precipitation fraction (not active, currently precipitation optics uses cloud-fraction) cld_cnv_lwp, & ! Water path for convective liquid cloud-particles cld_cnv_reliq, & ! Effective radius for convective liquid cloud-particles @@ -176,11 +178,11 @@ subroutine rrtmgp_lw_main_run(doLWrad, doLWclrsky, top_at_1, doGP_lwscat, aerlw_tau, & ! Aerosol optical depth aerlw_ssa, & ! Aerosol single scattering albedo aerlw_g ! Aerosol asymmetry paramter - character(len=*), dimension(:), intent(in) :: & + character(len=*), dimension(:), intent(in), optional :: & active_gases_array ! List of active gases from namelist as array ! Outputs - real(kind_phys), dimension(:,:), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout), optional :: & fluxlwUP_jac, & ! Jacobian of upwelling LW surface radiation (W/m2/K) fluxlwUP_allsky, & ! All-sky flux (W/m2) fluxlwDOWN_allsky, & ! All-sky flux (W/m2) diff --git a/physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 b/physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 index b350334a3..fb0fe2052 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 +++ b/physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 @@ -41,7 +41,7 @@ subroutine rrtmgp_sw_main_init(rrtmgp_root_dir, rrtmgp_sw_file_gas, rrtmgp_sw_fi rrtmgp_root_dir, & ! RTE-RRTMGP root directory rrtmgp_sw_file_clouds, & ! RRTMGP file containing K-distribution data rrtmgp_sw_file_gas ! RRTMGP file containing cloud-optics data - character(len=*), dimension(:), intent(in) :: & + character(len=*), dimension(:), intent(in), optional :: & active_gases_array ! List of active gases from namelist as array) logical, intent(in) :: & doGP_cldoptics_PADE, & ! Use RRTMGP cloud-optics: PADE approximation? @@ -120,7 +120,8 @@ subroutine rrtmgp_sw_main_run(doSWrad, doSWclrsky, top_at_1, doGP_sgs_cnv, doGP_ isubc_sw, & ! iSFC integer,intent(in),dimension(:) :: & - idx, & ! Index array for daytime points + idx ! Index array for daytime points + integer,intent(in),dimension(:), optional :: & icseed_sw ! Seed for random number generation for shortwave radiation real(kind_phys), dimension(:), intent(in) :: & sfc_alb_nir_dir, & ! Surface albedo (direct) @@ -128,7 +129,7 @@ subroutine rrtmgp_sw_main_run(doSWrad, doSWclrsky, top_at_1, doGP_sgs_cnv, doGP_ sfc_alb_uvvis_dir, & ! Surface albedo (direct) sfc_alb_uvvis_dif, & ! Surface albedo (diffuse) coszen ! Cosize of SZA - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & p_lay, & ! Pressure @ model layer-centers (Pa) t_lay, & ! Temperature (K) p_lev, & ! Pressure @ model layer-interfaces (Pa) @@ -138,7 +139,8 @@ subroutine rrtmgp_sw_main_run(doSWrad, doSWclrsky, top_at_1, doGP_sgs_cnv, doGP_ vmr_o3, & ! Molar-mixing ratio ozone vmr_ch4, & ! Molar-mixing ratio methane vmr_n2o, & ! Molar-mixing ratio nitrous oxide - vmr_co2, & ! Molar-mixing ratio carbon dioxide + vmr_co2 ! Molar-mixing ratio carbon dioxide + real(kind_phys), dimension(:,:), intent(in) :: & cld_frac, & ! Cloud-fraction for stratiform clouds cld_lwp, & ! Water path for stratiform liquid cloud-particles cld_reliq, & ! Effective radius for stratiform liquid cloud-particles @@ -147,7 +149,8 @@ subroutine rrtmgp_sw_main_run(doSWrad, doSWclrsky, top_at_1, doGP_sgs_cnv, doGP_ cld_swp, & ! Water path for snow hydrometeors cld_resnow, & ! Effective radius for snow hydrometeors cld_rwp, & ! Water path for rain hydrometeors - cld_rerain, & ! Effective radius for rain hydrometeors + cld_rerain ! Effective radius for rain hydrometeors + real(kind_phys), dimension(:,:), intent(in), optional :: & precip_frac, & ! Precipitation fraction cld_cnv_lwp, & ! Water path for convective liquid cloud-particles cld_cnv_reliq, & ! Effective radius for convective liquid cloud-particles @@ -162,7 +165,7 @@ subroutine rrtmgp_sw_main_run(doSWrad, doSWclrsky, top_at_1, doGP_sgs_cnv, doGP_ aersw_tau, & ! Aerosol optical depth aersw_ssa, & ! Aerosol single scattering albedo aersw_g ! Aerosol asymmetry paramter - character(len=*), dimension(:), intent(in) :: & + character(len=*), dimension(:), intent(in), optional :: & active_gases_array ! List of active gases from namelist as array real(kind_phys), intent(in) :: & solcon ! Solar constant @@ -174,7 +177,7 @@ subroutine rrtmgp_sw_main_run(doSWrad, doSWclrsky, top_at_1, doGP_sgs_cnv, doGP_ errflg ! CCPP error flag real(kind_phys), dimension(:,:), intent(inout) :: & cldtausw ! Approx 10.mu band layer cloud optical depth - real(kind_phys), dimension(:,:), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout), optional :: & fluxswUP_allsky, & ! RRTMGP upward all-sky flux profiles (W/m2) fluxswDOWN_allsky, & ! RRTMGP downward all-sky flux profiles (W/m2) fluxswUP_clrsky, & ! RRTMGP upward clear-sky flux profiles (W/m2) From acbda856e83d66c95d95153753e30aaa91879130 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 20:00:14 +0000 Subject: [PATCH 06/11] Add optional attribute to PBL files. --- physics/PBL/HEDMF/hedmf.f | 2 +- physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 | 52 ++++++++++++---------- physics/PBL/SATMEDMF/satmedmfvdif.F | 3 +- physics/PBL/SATMEDMF/satmedmfvdifq.F | 3 +- physics/PBL/SHOC/moninshoc.f | 3 +- physics/PBL/SHOC/shoc.F90 | 3 +- physics/PBL/YSU/ysuvdif.F90 | 2 +- 7 files changed, 39 insertions(+), 29 deletions(-) diff --git a/physics/PBL/HEDMF/hedmf.f b/physics/PBL/HEDMF/hedmf.f index 4b010a121..b75526ba6 100644 --- a/physics/PBL/HEDMF/hedmf.f +++ b/physics/PBL/HEDMF/hedmf.f @@ -104,7 +104,7 @@ subroutine hedmf_run (im,km,ntrac,ntcw,dv,du,tau,rtg, & real(kind=kind_phys), intent(inout) :: dv(:,:), du(:,:), & & tau(:,:), rtg(:,:,:) ! dtend is only allocated if ldiag3d or qdiag3d are true - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) integer, intent(in) :: index_of_x_wind, index_of_y_wind, & & index_of_process_pbl, index_of_temperature, ntqv, rtg_ozone_index diff --git a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 index 487753027..81d77588b 100644 --- a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 +++ b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 @@ -244,38 +244,40 @@ SUBROUTINE mynnedmf_wrapper_run( & real(kind_phys), dimension(:,:), intent(inout) :: & & dtdt, dudt, dvdt, & & dqdt_water_vapor, dqdt_liquid_cloud, dqdt_ice, & - & dqdt_snow, & - & dqdt_cloud_droplet_num_conc, dqdt_ice_num_conc, & - & dqdt_ozone, dqdt_water_aer_num_conc, dqdt_ice_aer_num_conc + & dqdt_snow, dqdt_ice_num_conc, dqdt_ozone + real(kind_phys), dimension(:,:), intent(inout), optional :: & + & dqdt_cloud_droplet_num_conc, dqdt_water_aer_num_conc, & + & dqdt_ice_aer_num_conc real(kind_phys), dimension(:,:), intent(inout) ::dqdt_cccn - real(kind_phys), dimension(:,:), intent(inout) :: & - & qke, qke_adv, EL_PBL, Sh3D, Sm3D, & - & qc_bl, qi_bl, cldfra_bl + real(kind_phys), dimension(:,:), intent(inout), optional :: qke, & + & EL_PBL, Sh3D, Sm3D + real(kind_phys), dimension(:,:), intent(inout), optional :: & + & qke_adv, qc_bl, qi_bl, cldfra_bl !These 10 arrays are only allocated when bl_mynn_output > 0 - real(kind_phys), dimension(:,:), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout), optional :: & & edmf_a,edmf_w,edmf_qt, & & edmf_thl,edmf_ent,edmf_qc, & & sub_thl,sub_sqv,det_thl,det_sqv real(kind_phys), dimension(:,:), intent(inout) :: & - & dqke,qWT,qSHEAR,qBUOY,qDISS - real(kind_phys), dimension(:,:), intent(inout) :: & & t3d,qgrs_water_vapor,qgrs_liquid_cloud,qgrs_ice, & & qgrs_snow real(kind_phys), dimension(:,:), intent(in) :: & & u,v,omega, & & exner,prsl,prsi, & - & qgrs_cloud_droplet_num_conc, & + & qgrs_ozone + real(kind_phys), dimension(:,:), intent(in), optional :: & & qgrs_cloud_ice_num_conc, & - & qgrs_ozone, & & qgrs_water_aer_num_conc, & + & qgrs_cloud_droplet_num_conc, & & qgrs_ice_aer_num_conc - real(kind_phys), dimension(:,:), intent(in) ::qgrs_cccn - real(kind_phys), dimension(:,:), intent(out) :: & - & Tsq, Qsq, Cov, exch_h, exch_m + real(kind_phys), dimension(:,:), intent(in), optional :: qgrs_cccn + real(kind_phys), dimension(:,:), intent(out), optional :: & + & Tsq, Qsq, Cov, exch_h, exch_m, dqke, qWT, qSHEAR, qBUOY, & + & qDISS real(kind_phys), dimension(:), intent(in) :: xmu real(kind_phys), dimension(:,:), intent(in) :: htrsw, htrlw ! spp_wts_pbl only allocated if spp_pbl == 1 - real(kind_phys), dimension(:,:), intent(in) :: spp_wts_pbl + real(kind_phys), dimension(:,:), intent(in), optional :: spp_wts_pbl !LOCAL real(kind_phys), dimension(im,levs) :: & @@ -287,10 +289,10 @@ SUBROUTINE mynnedmf_wrapper_run( & real(kind_phys), allocatable :: old_ozone(:,:) !smoke/chem arrays - real(kind_phys), dimension(:), intent(inout) :: frp + real(kind_phys), dimension(:), intent(inout), optional :: frp logical, intent(in) :: mix_chem, enh_mix, rrfs_sd - real(kind_phys), dimension(:,:,:), intent(inout) :: chem3d - real(kind_phys), dimension(:,: ), intent(inout) :: vdep + real(kind_phys), dimension(:,:,:), intent(inout), optional :: chem3d + real(kind_phys), dimension(:,: ), intent(inout), optional :: vdep real(kind_phys), dimension(im) :: emis_ant_no !MYNN-2D @@ -298,8 +300,9 @@ SUBROUTINE mynnedmf_wrapper_run( & & dx,zorl,slmsk,tsurf,qsfc,ps, & & hflx,qflx,ust,wspd,rb,recmol + real(kind_phys), dimension(:), intent(in), optional :: & + & dusfc_cice,dvsfc_cice,dtsfc_cice,dqsfc_cice real(kind_phys), dimension(:), intent(in) :: & - & dusfc_cice,dvsfc_cice,dtsfc_cice,dqsfc_cice, & & stress_wat,hflx_wat,qflx_wat, & & oceanfrac,fice @@ -310,14 +313,17 @@ SUBROUTINE mynnedmf_wrapper_run( & & pblh,dusfc_diag,dvsfc_diag,dtsfc_diag,dqsfc_diag real(kind_phys), dimension(:), intent(out) :: & & ch,dtsfc1,dqsfc1,dusfc1,dvsfc1, & - & dtsfci_diag,dqsfci_diag,dusfci_diag,dvsfci_diag, & + & dtsfci_diag,dqsfci_diag,dusfci_diag,dvsfci_diag + real(kind_phys), dimension(:), intent(out), optional :: & & maxMF,maxwidth,ztop_plume integer, dimension(:), intent(inout) :: & - & kpbl,ktop_plume + & kpbl + integer, dimension(:), intent(inout), optional :: & + & ktop_plume - real(kind_phys), dimension(:), intent(inout) :: & + real(kind_phys), dimension(:), intent(inout), optional :: & & dusfc_cpl,dvsfc_cpl,dtsfc_cpl,dqsfc_cpl - real(kind_phys), dimension(:), intent(inout) :: & + real(kind_phys), dimension(:), intent(inout), optional :: & & dusfci_cpl,dvsfci_cpl,dtsfci_cpl,dqsfci_cpl !LOCAL diff --git a/physics/PBL/SATMEDMF/satmedmfvdif.F b/physics/PBL/SATMEDMF/satmedmfvdif.F index 79f7bbea1..7e2d511f1 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdif.F +++ b/physics/PBL/SATMEDMF/satmedmfvdif.F @@ -84,7 +84,8 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & integer, intent(out) :: kpbl(:) ! logical, intent(in) :: gen_tend, ldiag3d - real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend + real(kind=kind_phys), intent(inout), dimension(:,:,:), optional ::& + & dtend integer, intent(in) :: index_of_temperature,index_of_x_wind, & & index_of_y_wind, ntqv, ntoz, dtidx(:,:), index_of_process_pbl ! diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.F b/physics/PBL/SATMEDMF/satmedmfvdifq.F index 40527ce35..95a1e35e5 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.F +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.F @@ -124,7 +124,8 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & & prsi(:,:), del(:,:), & & prsl(:,:), prslk(:,:), & & phii(:,:), phil(:,:) - real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend + real(kind=kind_phys), intent(inout), dimension(:,:,:), optional ::& + & dtend integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_x_wind, index_of_y_wind, index_of_process_pbl integer, intent(in) :: icplocn2atm diff --git a/physics/PBL/SHOC/moninshoc.f b/physics/PBL/SHOC/moninshoc.f index eb6cbd002..994b78bf6 100644 --- a/physics/PBL/SHOC/moninshoc.f +++ b/physics/PBL/SHOC/moninshoc.f @@ -78,7 +78,8 @@ subroutine moninshoc_run (im,km,ntrac,ntcw,ncnd,dv,du,tau,rtg, & tau real(kind=kind_phys), dimension(:,:,:), intent(inout) :: rtg - real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend + real(kind=kind_phys), dimension(:,:,:), intent(inout), optional ::& + & dtend integer, dimension(:,:), intent(in) :: dtidx integer, intent(in) :: index_of_temperature, index_of_x_wind, & index_of_y_wind, index_of_process_pbl, ntqv diff --git a/physics/PBL/SHOC/shoc.F90 b/physics/PBL/SHOC/shoc.F90 index 797be6aec..9afe3b725 100644 --- a/physics/PBL/SHOC/shoc.F90 +++ b/physics/PBL/SHOC/shoc.F90 @@ -52,7 +52,8 @@ subroutine shoc_run (nx, nzm, tcr, tcrf, con_cp, con_g, con_hvap, con_hfus, con_ real(kind=kind_phys), intent(in), dimension(:,:) :: prsl, delp, phil, u, v, omega, rhc, prnum real(kind=kind_phys), intent(in), dimension(:,:) :: phii ! - real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, cld_sgs, tke, tkh, wthv_sec + real(kind=kind_phys), intent(inout), dimension(:,:) :: gt0, tke, tkh, wthv_sec + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: cld_sgs real(kind=kind_phys), intent(inout), dimension(:,:,:) :: gq0 character(len=*), intent(out) :: errmsg diff --git a/physics/PBL/YSU/ysuvdif.F90 b/physics/PBL/YSU/ysuvdif.F90 index bfae11d39..ad28256c0 100644 --- a/physics/PBL/YSU/ysuvdif.F90 +++ b/physics/PBL/YSU/ysuvdif.F90 @@ -101,7 +101,7 @@ subroutine ysuvdif_run(im,km,ux,vx,tx,qx,p2d,p2di,pi2d,karman, & intent(inout) :: utnp,vtnp,ttnp real(kind=kind_phys), dimension( :,:,: ) , & intent(inout) :: qtnp - real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), optional, intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), ntqv, index_of_temperature, & index_of_x_wind, index_of_y_wind, index_of_process_pbl ! From 6846533fe2ebb9fe83f809fdd3251e502f70dc8f Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 22:15:51 +0000 Subject: [PATCH 07/11] Add optional attribute to Surface Model files. --- physics/SFC_Models/Lake/CLM/clm_lake.f90 | 27 +++--- .../SFC_Models/Lake/Flake/flake_driver.F90 | 15 ++-- physics/SFC_Models/Land/Noah/lsm_noah.f | 6 +- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 84 +++++++++---------- physics/SFC_Models/Land/RUC/lsm_ruc.F90 | 58 +++++++------ physics/SFC_Models/Land/sfc_land.F90 | 30 +++---- physics/SFC_Models/Ocean/UFS/sfc_ocean.F | 2 +- physics/SFC_Models/SeaIce/CICE/sfc_cice.f | 5 +- 8 files changed, 122 insertions(+), 105 deletions(-) diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.f90 b/physics/SFC_Models/Lake/CLM/clm_lake.f90 index 91e8c71b7..8686221fa 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.f90 +++ b/physics/SFC_Models/Lake/CLM/clm_lake.f90 @@ -316,7 +316,7 @@ SUBROUTINE clm_lake_run( & REAL(KIND_PHYS), INTENT(IN) :: min_lakeice, lakedepth_default, dtp LOGICAL, INTENT(IN) :: use_lakedepth INTEGER, DIMENSION(:), INTENT(IN) :: use_lake_model - REAL(KIND_PHYS), INTENT(INOUT) :: clm_lake_initialized(:) + REAL(KIND_PHYS), INTENT(INOUT), OPTIONAL :: clm_lake_initialized(:) LOGICAL, INTENT(IN) :: frac_grid, frac_ice ! @@ -325,7 +325,9 @@ SUBROUTINE clm_lake_run( & REAL(KIND_PHYS), DIMENSION(:), INTENT(IN):: & tg3, pgr, zlvl, qvcurr, xlat_d, xlon_d, ch, cm, & dlwsfci, dswsfci, oro_lakedepth, wind, & - rainncprv, raincprv, t1, qv1, prsl1 + t1, qv1, prsl1 + REAL(KIND_PHYS), DIMENSION(:), INTENT(IN), OPTIONAL :: & + rainncprv, raincprv REAL(KIND_PHYS), DIMENSION(:,:), INTENT(in) :: gu0, gv0, prsi, gt0, phii LOGICAL, DIMENSION(:), INTENT(IN) :: flag_iter LOGICAL, DIMENSION(:), INTENT(INOUT) :: flag_lakefreeze @@ -340,34 +342,35 @@ SUBROUTINE clm_lake_run( & ep1d_water, ep1d_ice, tsurf_water, tsurf_ice, tsfc_wat, tisfc, tsfc, & weasdi, snodi, hice, qss_water, qss_ice, & cmm_water, cmm_ice, chh_water, chh_ice, & - uustar_water, uustar_ice, lake_t_snow, albedo, zorlw, & - zorli, lake_t2m, lake_q2m, weasd, snowd, fice + uustar_water, uustar_ice, zorlw, zorli, weasd, snowd, fice + REAL(KIND_PHYS), DIMENSION(:), INTENT(INOUT) , OPTIONAL :: & + lake_t_snow, albedo, lake_t2m, lake_q2m LOGICAL, INTENT(INOUT) :: icy(:) ! ! Lake model internal state stored by caller: ! - INTEGER, DIMENSION( : ), INTENT(INOUT) :: salty - INTEGER, DIMENSION( : ), INTENT(INOUT) :: cannot_freeze + INTEGER, DIMENSION( : ), INTENT(INOUT), OPTIONAL :: salty + INTEGER, DIMENSION( : ), INTENT(INOUT), OPTIONAL :: cannot_freeze - real(kind_phys), dimension(: ) ,intent(inout) :: savedtke12d, & + real(kind_phys), dimension(: ), OPTIONAL ,intent(inout) :: savedtke12d, & snowdp2d, & h2osno2d, & snl2d, & t_grnd2d - real(kind_phys), dimension( :,: ) ,INTENT(inout) :: t_lake3d, & + real(kind_phys), dimension( :,: ), OPTIONAL, INTENT(inout) :: t_lake3d, & lake_icefrac3d - real(kind_phys), dimension( :,-nlevsnow+1: ) ,INTENT(inout) :: t_soisno3d, & + real(kind_phys), dimension( :,-nlevsnow+1: ) ,INTENT(inout), OPTIONAL :: t_soisno3d, & h2osoi_ice3d, & h2osoi_liq3d, & h2osoi_vol3d, & z3d, & dz3d - real(kind_phys), dimension( :,-nlevsnow+0: ) ,INTENT(inout) :: zi3d + real(kind_phys), dimension( :,-nlevsnow+0: ) ,INTENT(inout), OPTIONAL :: zi3d - REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT) :: clm_lakedepth - REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT) :: input_lakedepth + REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT), OPTIONAL :: clm_lakedepth + REAL(KIND_PHYS), DIMENSION( : ) ,INTENT(INOUT), OPTIONAL :: input_lakedepth ! ! Error reporting: diff --git a/physics/SFC_Models/Lake/Flake/flake_driver.F90 b/physics/SFC_Models/Lake/Flake/flake_driver.F90 index 3b5988254..f849c6f62 100644 --- a/physics/SFC_Models/Lake/Flake/flake_driver.F90 +++ b/physics/SFC_Models/Lake/Flake/flake_driver.F90 @@ -65,9 +65,9 @@ SUBROUTINE flake_driver_run ( & real (kind=kind_phys),dimension(:),intent(inout) :: & & snwdph, hice, tsurf, t_sfc, hflx, evap, fice, ustar, qsfc, & - & ch, cm, chh, cmm, h_ML, t_wML, t_mnw, H_B, T_B, & - & t_bot1, t_bot2, c_t, T_snow, T_ice, tsurf_ice, lflx, gflx - + & ch, cm, chh, cmm, tsurf_ice, lflx, gflx + real (kind=kind_phys),dimension(:),intent(inout), optional :: & + & h_ML, t_wML, t_mnw, H_B, T_B, t_bot1, t_bot2, c_t, T_snow real (kind=kind_phys), intent(in) :: julian logical, dimension(:), intent(in) :: flag_iter, wet @@ -442,10 +442,13 @@ subroutine flake_driver_post_run (im, use_lake_model, h_ML, T_wML, & ! integer, dimension(im), intent(in) :: islmsk real (kind=kind_phys), dimension(:), intent(in) :: & - & lakedepth, tsurf, h_ML, t_wML + & lakedepth, tsurf + real (kind=kind_phys), dimension(:), intent(in), optional :: & + & h_ML, t_wML - real (kind=kind_phys),dimension(:),intent(inout) :: & - & xz, zm, tref, tsfco + real (kind=kind_phys),dimension(:),intent(inout), optional :: & + & xz, zm, tref + real (kind=kind_phys),dimension(:),intent(inout) :: tsfco integer, dimension(:), intent(in) :: use_lake_model diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.f b/physics/SFC_Models/Land/Noah/lsm_noah.f index 836fc3b72..6ac87fb76 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.f +++ b/physics/SFC_Models/Land/Noah/lsm_noah.f @@ -285,8 +285,10 @@ subroutine lsm_noah_run & real (kind=kind_phys), dimension(:), intent(inout) :: sncovr1, & & qsurf, gflux, drain, evap, hflx, ep, runoff, cmm, chh, & & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2, & - & wet1, lai, rca - + & rca + real (kind=kind_phys), dimension(:), intent(inout), optional :: & + & wet1, lai + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 6aff50666..5b2fde639 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -292,11 +292,11 @@ subroutine noahmpdrv_run & integer , intent(in) :: iyrlen ! year length [days] real(kind=kind_phys) , intent(in) :: julian ! julian day of year real(kind=kind_phys), dimension(:) , intent(in) :: garea ! area of the grid cell - real(kind=kind_phys), dimension(:) , intent(in) :: rainn_mp ! microphysics non-convective precipitation [mm] - real(kind=kind_phys), dimension(:) , intent(in) :: rainc_mp ! microphysics convective precipitation [mm] - real(kind=kind_phys), dimension(:) , intent(in) :: snow_mp ! microphysics snow [mm] - real(kind=kind_phys), dimension(:) , intent(in) :: graupel_mp ! microphysics graupel [mm] - real(kind=kind_phys), dimension(:) , intent(in) :: ice_mp ! microphysics ice/hail [mm] + real(kind=kind_phys), dimension(:) , intent(in), optional :: rainn_mp ! microphysics non-convective precipitation [mm] + real(kind=kind_phys), dimension(:) , intent(in), optional :: rainc_mp ! microphysics convective precipitation [mm] + real(kind=kind_phys), dimension(:) , intent(in), optional :: snow_mp ! microphysics snow [mm] + real(kind=kind_phys), dimension(:) , intent(in), optional :: graupel_mp ! microphysics graupel [mm] + real(kind=kind_phys), dimension(:) , intent(in), optional :: ice_mp ! microphysics ice/hail [mm] real(kind=kind_phys), dimension(:) , intent(in) :: rhonewsn1 ! precipitation ice density (kg/m^3) real(kind=kind_phys) , intent(in) :: con_hvap ! latent heat condensation [J/kg] real(kind=kind_phys) , intent(in) :: con_cp ! specific heat air [J/kg/K] @@ -334,40 +334,40 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(inout) :: fm101 ! MOS function for momentum evaulated @ 10 m real(kind=kind_phys), dimension(:) , intent(inout) :: fh21 ! MOS function for heat evaulated @ 2m - real(kind=kind_phys), dimension(:) , intent(inout) :: snowxy ! actual no. of snow layers - real(kind=kind_phys), dimension(:) , intent(inout) :: tvxy ! vegetation leaf temperature [K] - real(kind=kind_phys), dimension(:) , intent(inout) :: tgxy ! bulk ground surface temperature [K] - real(kind=kind_phys), dimension(:) , intent(inout) :: canicexy ! canopy-intercepted ice [mm] - real(kind=kind_phys), dimension(:) , intent(inout) :: canliqxy ! canopy-intercepted liquid water [mm] - real(kind=kind_phys), dimension(:) , intent(inout) :: eahxy ! canopy air vapor pressure [Pa] - real(kind=kind_phys), dimension(:) , intent(inout) :: tahxy ! canopy air temperature [K] - real(kind=kind_phys), dimension(:) , intent(inout) :: cmxy ! bulk momentum drag coefficient [m/s] - real(kind=kind_phys), dimension(:) , intent(inout) :: chxy ! bulk sensible heat exchange coefficient [m/s] - real(kind=kind_phys), dimension(:) , intent(inout) :: fwetxy ! wetted or snowed fraction of the canopy [-] - real(kind=kind_phys), dimension(:) , intent(inout) :: sneqvoxy ! snow mass at last time step[mm h2o] - real(kind=kind_phys), dimension(:) , intent(inout) :: alboldxy ! snow albedo at last time step [-] - real(kind=kind_phys), dimension(:) , intent(inout) :: qsnowxy ! snowfall on the ground [mm/s] - real(kind=kind_phys), dimension(:) , intent(inout) :: wslakexy ! lake water storage [mm] - real(kind=kind_phys), dimension(:) , intent(inout) :: zwtxy ! water table depth [m] - real(kind=kind_phys), dimension(:) , intent(inout) :: waxy ! water in the "aquifer" [mm] - real(kind=kind_phys), dimension(:) , intent(inout) :: wtxy ! groundwater storage [mm] - real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: tsnoxy ! snow temperature [K] - real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: zsnsoxy ! snow/soil layer depth [m] - real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: snicexy ! snow layer ice [mm] - real(kind=kind_phys), dimension(:,lsnowl:), intent(inout) :: snliqxy ! snow layer liquid water [mm] - real(kind=kind_phys), dimension(:) , intent(inout) :: lfmassxy ! leaf mass [g/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: rtmassxy ! mass of fine roots [g/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: stmassxy ! stem mass [g/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: woodxy ! mass of wood (incl. woody roots) [g/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: stblcpxy ! stable carbon in deep soil [g/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: fastcpxy ! short-lived carbon, shallow soil [g/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: xlaixy ! leaf area index [m2/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: xsaixy ! stem area index [m2/m2] - real(kind=kind_phys), dimension(:) , intent(inout) :: taussxy ! snow age factor [-] - real(kind=kind_phys), dimension(:,:) , intent(inout) :: smoiseq ! eq volumetric soil moisture [m3/m3] - real(kind=kind_phys), dimension(:) , intent(inout) :: smcwtdxy ! soil moisture content in the layer to the water table when deep - real(kind=kind_phys), dimension(:) , intent(inout) :: deeprechxy ! recharge to the water table when deep - real(kind=kind_phys), dimension(:) , intent(inout) :: rechxy ! recharge to the water table + real(kind=kind_phys), dimension(:) , intent(inout), optional :: snowxy ! actual no. of snow layers + real(kind=kind_phys), dimension(:) , intent(inout), optional :: tvxy ! vegetation leaf temperature [K] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: tgxy ! bulk ground surface temperature [K] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: canicexy ! canopy-intercepted ice [mm] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: canliqxy ! canopy-intercepted liquid water [mm] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: eahxy ! canopy air vapor pressure [Pa] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: tahxy ! canopy air temperature [K] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: cmxy ! bulk momentum drag coefficient [m/s] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: chxy ! bulk sensible heat exchange coefficient [m/s] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: fwetxy ! wetted or snowed fraction of the canopy [-] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: sneqvoxy ! snow mass at last time step[mm h2o] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: alboldxy ! snow albedo at last time step [-] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: qsnowxy ! snowfall on the ground [mm/s] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: wslakexy ! lake water storage [mm] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: zwtxy ! water table depth [m] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: waxy ! water in the "aquifer" [mm] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: wtxy ! groundwater storage [mm] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: tsnoxy ! snow temperature [K] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: zsnsoxy ! snow/soil layer depth [m] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: snicexy ! snow layer ice [mm] + real(kind=kind_phys), dimension(:,lsnowl:), intent(inout), optional :: snliqxy ! snow layer liquid water [mm] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: lfmassxy ! leaf mass [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: rtmassxy ! mass of fine roots [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: stmassxy ! stem mass [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: woodxy ! mass of wood (incl. woody roots) [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: stblcpxy ! stable carbon in deep soil [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: fastcpxy ! short-lived carbon, shallow soil [g/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: xlaixy ! leaf area index [m2/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: xsaixy ! stem area index [m2/m2] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: taussxy ! snow age factor [-] + real(kind=kind_phys), dimension(:,:) , intent(inout), optional :: smoiseq ! eq volumetric soil moisture [m3/m3] + real(kind=kind_phys), dimension(:) , intent(inout), optional :: smcwtdxy ! soil moisture content in the layer to the water table when deep + real(kind=kind_phys), dimension(:) , intent(inout), optional :: deeprechxy ! recharge to the water table when deep + real(kind=kind_phys), dimension(:) , intent(inout), optional :: rechxy ! recharge to the water table real(kind=kind_phys), dimension(:) , intent(out) :: albdvis ! albedo - direct visible [fraction] real(kind=kind_phys), dimension(:) , intent(out) :: albdnir ! albedo - direct NIR [fraction] real(kind=kind_phys), dimension(:) , intent(out) :: albivis ! albedo - diffuse visible [fraction] @@ -395,9 +395,9 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: snohf ! snow/freezing-rain latent heat flux [W/m2] real(kind=kind_phys), dimension(:) , intent(out) :: smcwlt2 ! dry soil moisture threshold [m3/m3] real(kind=kind_phys), dimension(:) , intent(out) :: smcref2 ! soil moisture threshold [m3/m3] - real(kind=kind_phys), dimension(:) , intent(out) :: wet1 ! normalized surface soil saturated fraction - real(kind=kind_phys), dimension(:) , intent(out) :: t2mmp ! combined T2m from tiles - real(kind=kind_phys), dimension(:) , intent(out) :: q2mp ! combined q2m from tiles + real(kind=kind_phys), dimension(:) , intent(out), optional :: wet1 ! normalized surface soil saturated fraction + real(kind=kind_phys), dimension(:) , intent(out), optional :: t2mmp ! combined T2m from tiles + real(kind=kind_phys), dimension(:) , intent(out), optional :: q2mp ! combined q2m from tiles real(kind=kind_phys), dimension(:) , intent(out) :: zvfun ! real(kind=kind_phys), dimension(:) , intent(out) :: ztmax ! thermal roughness length character(len=*) , intent(out) :: errmsg diff --git a/physics/SFC_Models/Land/RUC/lsm_ruc.F90 b/physics/SFC_Models/Land/RUC/lsm_ruc.F90 index ba1b1b4e9..7c50a5bf7 100644 --- a/physics/SFC_Models/Land/RUC/lsm_ruc.F90 +++ b/physics/SFC_Models/Land/RUC/lsm_ruc.F90 @@ -87,21 +87,22 @@ subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & real (kind_phys), dimension(:,:), intent(in) :: smc,slc,stc real (kind_phys), intent(in) :: min_seaice ! --- in/out: - real (kind_phys), dimension(:), intent(inout) :: wetness + real (kind_phys), dimension(:), intent(inout), optional :: wetness ! --- inout - real (kind_phys), dimension(:,:), intent(inout) :: sh2o, smfrkeep - real (kind_phys), dimension(:,:), intent(inout) :: tslb, smois + real (kind_phys), dimension(:,:), intent(inout), optional :: sh2o, smfrkeep + real (kind_phys), dimension(:,:), intent(inout), optional :: tslb, smois real (kind_phys), dimension(:), intent(inout) :: semis_lnd real (kind_phys), dimension(:), intent(inout) :: semis_ice - real (kind_phys), dimension(:), intent(inout) :: & - albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & + real (kind_phys), dimension(:), intent(inout) :: & + albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & + real (kind_phys), dimension(:), intent(inout), optional :: & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & sfcqv_lnd, sfcqv_ice ! --- out real (kind_phys), dimension(:), intent(out) :: zs - real (kind_phys), dimension(:), intent(inout) :: sfalb_lnd_bck + real (kind_phys), dimension(:), intent(inout), optional :: sfalb_lnd_bck real (kind_phys), dimension(:,:), intent(inout) :: tsice real (kind_phys), dimension(:), intent(out) :: semisbase real (kind_phys), dimension(:), intent(out) :: pores, resid @@ -381,11 +382,11 @@ subroutine lsm_ruc_run & ! inputs imp_physics_nssl real (kind_phys), dimension(:), intent(in) :: xlat_d, xlon_d real (kind_phys), dimension(:), intent(in) :: oro, sigma - + real (kind_phys), dimension(:), intent(in), optional :: sfalb_lnd_bck real (kind_phys), dimension(:), intent(in) :: & & t1, sigmaf, dlwflx, dswsfc, tg3, & & coszen, prsl1, wind, shdmin, shdmax, & - & sfalb_lnd_bck, snoalb, zf, qc, q1, & + & snoalb, zf, qc, q1, & ! for land & cm_lnd, ch_lnd, & ! for water @@ -418,44 +419,51 @@ subroutine lsm_ruc_run & ! inputs real (kind_phys), dimension(:), intent(in) :: zs real (kind_phys), dimension(:), intent(in) :: srflag - real (kind_phys), dimension(:), intent(inout) :: & - & canopy, trans, smcwlt2, smcref2, laixy, & + real (kind_phys), dimension(:), intent(inout), optional :: & + & laixy, tsnow_lnd, sfcqv_lnd, sfcqc_lnd, sfcqc_ice, sfcqv_ice,& + & tsnow_ice + real (kind_phys), dimension(:), intent(inout) :: & + & canopy, trans, smcwlt2, smcref2, & ! for land & weasd_lnd, snwdph_lnd, tskin_lnd, & - & tsurf_lnd, z0rl_lnd, tsnow_lnd, & - & sfcqc_lnd, sfcqv_lnd, & + & tsurf_lnd, z0rl_lnd, & ! for ice & weasd_ice, snwdph_ice, tskin_ice, & - & tsurf_ice, z0rl_ice, tsnow_ice, & - & sfcqc_ice, sfcqv_ice, fice + & tsurf_ice, z0rl_ice, fice ! --- in - real (kind_phys), dimension(:), intent(in) :: & - & rainnc, rainc, ice, snow, graupel, rhonewsn1 - real (kind_phys), dimension(:), intent(in) :: fire_heat_flux_out, & - frac_grid_burned_out + real (kind_phys), dimension(:), intent(in), optional :: & + & rainnc, rainc, ice, snow, graupel + real (kind_phys), dimension(:), intent(in) :: rhonewsn1 + real (kind_phys), dimension(:), intent(in), optional :: & + fire_heat_flux_out, frac_grid_burned_out logical, intent(in) :: add_fire_heat_flux ! --- in/out: ! --- on RUC levels + real (kind_phys), dimension(:,:), intent(inout), optional :: & + & smois, tslb, sh2o, keepfr, smfrkeep real (kind_phys), dimension(:,:), intent(inout) :: & - & smois, tsice, tslb, sh2o, keepfr, smfrkeep + & tsice ! --- output: + real (kind_phys), dimension(:), intent(inout), optional :: + & sfalb_lnd, sfalb_ice, wetness, snowfallac_lnd, & + & snowfallac_ice, rhosnf real (kind_phys), dimension(:), intent(inout) :: & - & rhosnf, runof, drain, runoff, srunoff, evbs, evcw, & - & stm, wetness, semisbase, semis_lnd, semis_ice, & - & sfalb_lnd, sfalb_ice, & + & runof, drain, runoff, srunoff, evbs, evcw, & + & stm, semisbase, semis_lnd, semis_ice, & ! for land & sncovr1_lnd, qsurf_lnd, gflux_lnd, evap_lnd, & & cmm_lnd, chh_lnd, hflx_lnd, sbsno, & - & snowfallac_lnd, acsnow_lnd, snowmt_lnd, snohf, & + & acsnow_lnd, snowmt_lnd, snohf, & ! for ice & sncovr1_ice, qsurf_ice, gflux_ice, evap_ice, ep1d_ice, & & cmm_ice, chh_ice, hflx_ice, & - & snowfallac_ice, acsnow_ice, snowmt_ice + & acsnow_ice, snowmt_ice real (kind_phys), dimension(:), intent( out) :: & - & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & + & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd + real (kind_phys), dimension(:), intent( out), optional :: & & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice logical, intent(in) :: flag_init, lsm_cold_start diff --git a/physics/SFC_Models/Land/sfc_land.F90 b/physics/SFC_Models/Land/sfc_land.F90 index 2b0696ed8..a85e8b787 100644 --- a/physics/SFC_Models/Land/sfc_land.F90 +++ b/physics/SFC_Models/Land/sfc_land.F90 @@ -44,27 +44,27 @@ subroutine sfc_land_run(im, cpllnd, cpllnd2atm, flag_iter, dry, & logical , intent(in) :: cpllnd2atm logical , intent(in) :: flag_iter(:) logical , intent(in) :: dry(:) - real(kind=kind_phys), intent(in) :: sncovr1_lnd(:) - real(kind=kind_phys), intent(in) :: qsurf_lnd(:) - real(kind=kind_phys), intent(in) :: evap_lnd(:) - real(kind=kind_phys), intent(in) :: hflx_lnd(:) - real(kind=kind_phys), intent(in) :: ep_lnd(:) - real(kind=kind_phys), intent(in) :: t2mmp_lnd(:) - real(kind=kind_phys), intent(in) :: q2mp_lnd(:) - real(kind=kind_phys), intent(in) :: gflux_lnd(:) - real(kind=kind_phys), intent(in) :: runoff_lnd(:) - real(kind=kind_phys), intent(in) :: drain_lnd(:) - real(kind=kind_phys), intent(in) :: cmm_lnd(:) - real(kind=kind_phys), intent(in) :: chh_lnd(:) - real(kind=kind_phys), intent(in) :: zvfun_lnd(:) + real(kind=kind_phys), intent(in), optional :: sncovr1_lnd(:) + real(kind=kind_phys), intent(in), optional :: qsurf_lnd(:) + real(kind=kind_phys), intent(in), optional :: evap_lnd(:) + real(kind=kind_phys), intent(in), optional :: hflx_lnd(:) + real(kind=kind_phys), intent(in), optional :: ep_lnd(:) + real(kind=kind_phys), intent(in), optional :: t2mmp_lnd(:) + real(kind=kind_phys), intent(in), optional :: q2mp_lnd(:) + real(kind=kind_phys), intent(in), optional :: gflux_lnd(:) + real(kind=kind_phys), intent(in), optional :: runoff_lnd(:) + real(kind=kind_phys), intent(in), optional :: drain_lnd(:) + real(kind=kind_phys), intent(in), optional :: cmm_lnd(:) + real(kind=kind_phys), intent(in), optional :: chh_lnd(:) + real(kind=kind_phys), intent(in), optional :: zvfun_lnd(:) ! Inputs/Outputs real(kind=kind_phys), intent(inout) :: sncovr1(:) real(kind=kind_phys), intent(inout) :: qsurf(:) real(kind=kind_phys), intent(inout) :: evap(:) real(kind=kind_phys), intent(inout) :: hflx(:) real(kind=kind_phys), intent(inout) :: ep(:) - real(kind=kind_phys), intent(inout) :: t2mmp(:) - real(kind=kind_phys), intent(inout) :: q2mp(:) + real(kind=kind_phys), intent(inout), optional :: t2mmp(:) + real(kind=kind_phys), intent(inout), optional :: q2mp(:) real(kind=kind_phys), intent(inout) :: gflux(:) real(kind=kind_phys), intent(inout) :: runoff(:) real(kind=kind_phys), intent(inout) :: drain(:) diff --git a/physics/SFC_Models/Ocean/UFS/sfc_ocean.F b/physics/SFC_Models/Ocean/UFS/sfc_ocean.F index 88d23a7aa..a0410a51c 100644 --- a/physics/SFC_Models/Ocean/UFS/sfc_ocean.F +++ b/physics/SFC_Models/Ocean/UFS/sfc_ocean.F @@ -128,7 +128,7 @@ subroutine sfc_ocean_run & logical, intent(in) :: use_med_flux ! To receive fluxes from mediator - real (kind=kind_phys), dimension(:), intent(in) :: & + real (kind=kind_phys), dimension(:), intent(in), optional :: & & dqsfc_med, dtsfc_med ! --- outputs: diff --git a/physics/SFC_Models/SeaIce/CICE/sfc_cice.f b/physics/SFC_Models/SeaIce/CICE/sfc_cice.f index 36f2bccbf..0df1f67a5 100644 --- a/physics/SFC_Models/SeaIce/CICE/sfc_cice.f +++ b/physics/SFC_Models/SeaIce/CICE/sfc_cice.f @@ -101,9 +101,10 @@ subroutine sfc_cice_run & ! real (kind=kind_phys), dimension(im), intent(in) :: u1, v1, & real (kind=kind_phys), dimension(:), intent(in) :: & - & t1, q1, cm, ch, prsl1, wind, dqsfc, dtsfc, dusfc, dvsfc - &, snowd + & t1, q1, cm, ch, prsl1, wind, snowd + real (kind=kind_phys), dimension(:), intent(in), optional :: & + & dqsfc, dtsfc, dusfc, dvsfc logical, dimension(:), intent(in) :: flag_cice, flag_iter ! --- outputs: From ce18ef54fcfc0c88e0b53e72b74071123d8395df Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 22:30:17 +0000 Subject: [PATCH 08/11] Add optional attribute to Surface Layer files. --- physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 | 14 ++++++++------ physics/SFC_Layer/UFS/sfc_diag.f | 6 +++--- physics/SFC_Layer/UFS/sfc_diag_post.F90 | 2 +- physics/SFC_Layer/UFS/sfc_nst.f90 | 8 ++++++-- physics/SFC_Layer/UFS/sfc_nst_post.f90 | 3 ++- physics/SFC_Layer/UFS/sfc_nst_pre.f90 | 6 ++++-- 6 files changed, 24 insertions(+), 15 deletions(-) diff --git a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 index 3c033e65e..8df0116a8 100644 --- a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 +++ b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 @@ -135,7 +135,7 @@ SUBROUTINE mynnsfc_wrapper_run( & integer, dimension(:), intent(in) :: vegtype real(kind_phys), dimension(:), intent(in) :: & & sigmaf,shdmax,z0pert,ztpert - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & & spp_wts_sfc real(kind_phys), dimension(:,:), & @@ -168,15 +168,17 @@ SUBROUTINE mynnsfc_wrapper_run( & !MYNN-2D real(kind_phys), dimension(:), intent(in) :: & - & dx, pblh, slmsk, ps, & + & dx, pblh, slmsk, ps + real(kind_phys), dimension(:), intent(in),optional :: & & qsfc_lnd_ruc, qsfc_ice_ruc real(kind_phys), dimension(:), intent(inout) :: & - & ustm, hflx, qflx, wspd, qsfc, & + & hflx, qflx, wspd, qsfc, & & FLHC, FLQC, U10, V10, TH2, T2, Q2, & - & CHS2, CQS2, rmol, zol, mol, ch, & - & lh, wstar - !LOCAL + & rmol, ch + real(kind_phys), dimension(:), intent(inout), optional :: & + & ustm, zol, mol, lh, wstar, CHS2, CQS2 + !LOCAL real(kind_phys), dimension(im) :: & & hfx, znt, psim, psih, & & chs, ck, cd, mavail, xland, GZ1OZ0, & diff --git a/physics/SFC_Layer/UFS/sfc_diag.f b/physics/SFC_Layer/UFS/sfc_diag.f index b0432df6f..c8ef19e8f 100644 --- a/physics/SFC_Layer/UFS/sfc_diag.f +++ b/physics/SFC_Layer/UFS/sfc_diag.f @@ -44,9 +44,9 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & & qsurf, prslki, evap, fm, fh, fm10, fh2, & & shflx, cdq, wind, xlat_d, xlon_d real(kind=kind_phys), dimension(:), intent(out) :: & - & f10m, u10m, v10m, t2m, q2m, dpt2m - real(kind=kind_phys), dimension(:), intent(in) :: lake_t2m, & - & lake_q2m + & f10m, u10m, v10m, t2m, q2m, dpt2m + real(kind=kind_phys), dimension(:), intent(in), optional :: & + & lake_t2m, lake_q2m integer, dimension(:), intent(in) :: use_lake_model character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/SFC_Layer/UFS/sfc_diag_post.F90 b/physics/SFC_Layer/UFS/sfc_diag_post.F90 index 6945e48e9..3f930f641 100644 --- a/physics/SFC_Layer/UFS/sfc_diag_post.F90 +++ b/physics/SFC_Layer/UFS/sfc_diag_post.F90 @@ -28,7 +28,7 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, co logical , dimension(:), intent(in) :: dry real(kind=kind_phys), dimension(:), intent(in) :: pgr, u10m, v10m real(kind=kind_phys), dimension(:), intent(inout) :: t2m, q2m, tmpmin, tmpmax, spfhmin, spfhmax - real(kind=kind_phys), dimension(:), intent(inout) :: t2mmp, q2mp + real(kind=kind_phys), dimension(:), intent(inout), optional :: t2mmp, q2mp real(kind=kind_phys), dimension(:), intent(inout) :: wind10mmax, u10mmax, v10mmax, dpt2m character(len=*), intent(out) :: errmsg diff --git a/physics/SFC_Layer/UFS/sfc_nst.f90 b/physics/SFC_Layer/UFS/sfc_nst.f90 index 9c3804211..c8c40a20d 100644 --- a/physics/SFC_Layer/UFS/sfc_nst.f90 +++ b/physics/SFC_Layer/UFS/sfc_nst.f90 @@ -175,9 +175,11 @@ subroutine sfc_nst_run & real (kind=kind_phys), intent(in) :: hvap, cp, hfus, jcal, eps, & epsm1, rvrdm1, rd, rhw0, sbc, pi, tgice real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & - usfco, vsfco, t1, q1, tref, cm, ch, fm, fm10, & + usfco, vsfco, t1, q1, cm, ch, fm, fm10, & prsl1, prslki, prsik1, prslk1, xlon, xcosz, & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind + real (kind=kind_phys), dimension(:), intent(in), optional :: & + tref real (kind=kind_phys), intent(in) :: timestep real (kind=kind_phys), intent(in) :: solhr @@ -192,7 +194,9 @@ subroutine sfc_nst_run & ! --- input/outputs: ! control variables of dtl system (5+2) and sl (2) and coefficients for d(tz)/d(ts) calculation real (kind=kind_phys), dimension(:), intent(inout) :: tskin, & - tsurf, xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & + tsurf + real (kind=kind_phys), dimension(:), intent(inout), optional :: & + xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain ! --- outputs: diff --git a/physics/SFC_Layer/UFS/sfc_nst_post.f90 b/physics/SFC_Layer/UFS/sfc_nst_post.f90 index 174d5df76..0357a86f0 100644 --- a/physics/SFC_Layer/UFS/sfc_nst_post.f90 +++ b/physics/SFC_Layer/UFS/sfc_nst_post.f90 @@ -32,7 +32,8 @@ subroutine sfc_nst_post_run & real (kind=kind_phys), intent(in) :: rlapse, tgice real (kind=kind_phys), dimension(:), intent(in) :: oro, oro_uf integer, intent(in) :: nstf_name1, nstf_name4, nstf_name5 - real (kind=kind_phys), dimension(:), intent(in) :: xt, xz, dt_cool, z_c, tref, xlon + real (kind=kind_phys), dimension(:), intent(in) :: xlon + real (kind=kind_phys), dimension(:), intent(in), optional :: xt, xz, dt_cool, z_c, tref ! --- input/outputs: real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, tsfc_wat diff --git a/physics/SFC_Layer/UFS/sfc_nst_pre.f90 b/physics/SFC_Layer/UFS/sfc_nst_pre.f90 index 3e77f2d6b..c61f9b903 100644 --- a/physics/SFC_Layer/UFS/sfc_nst_pre.f90 +++ b/physics/SFC_Layer/UFS/sfc_nst_pre.f90 @@ -30,11 +30,13 @@ subroutine sfc_nst_pre_run & integer, intent(in) :: im, nthreads logical, dimension(:), intent(in) :: wet real (kind=kind_phys), intent(in) :: tgice - real (kind=kind_phys), dimension(:), intent(in) :: tsfco, xt, xz, dt_cool, z_c, oceanfrac + real (kind=kind_phys), dimension(:), intent(in) :: tsfco, oceanfrac + real (kind=kind_phys), dimension(:), intent(in), optional :: xt, xz, dt_cool, z_c logical, intent(in) :: cplflx ! --- input/outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, tseal, tref + real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, tseal + real (kind=kind_phys), dimension(:), intent(inout), optional :: tref ! --- outputs: character(len=*), intent(out) :: errmsg From 671aedd1e27daa74dcf47f0b8c294ad7892d7b3a Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 23:12:31 +0000 Subject: [PATCH 09/11] Add optional attribute to Interstitial schemes. --- .../UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 | 9 +- .../UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 | 2 +- .../UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 | 6 +- .../UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 | 34 +++--- .../UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 | 13 +- .../UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 | 4 +- .../UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 | 7 +- .../GFS_phys_time_vary.fv3.F90 | 112 +++++++++--------- .../UFS_SCM_NEPTUNE/GFS_physics_post.F90 | 2 +- .../UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90 | 16 +-- .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 | 11 +- .../UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 | 5 +- .../UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 | 6 +- .../UFS_SCM_NEPTUNE/GFS_stochastics.F90 | 20 ++-- .../GFS_suite_interstitial_4.F90 | 7 +- .../GFS_suite_stateout_update.F90 | 2 +- .../GFS_surface_generic_post.F90 | 10 +- .../GFS_surface_generic_pre.F90 | 10 +- .../Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f | 13 +- .../maximum_hourly_diagnostics.F90 | 5 +- 20 files changed, 154 insertions(+), 140 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 index 3b69849a7..da255adc8 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 @@ -32,16 +32,17 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & real(kind=kind_phys), dimension(:,:), intent(in) :: save_u, save_v, save_t real(kind=kind_phys), dimension(:,:), intent(in) :: gu0, gv0, gt0 real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q - real(kind=kind_phys), dimension(:,:), intent(in) :: ud_mf, dd_mf, dt_mf + real(kind=kind_phys), dimension(:,:), intent(in) :: dd_mf, dt_mf + real(kind=kind_phys), dimension(:,:), intent(in), optional :: ud_mf real(kind=kind_phys), intent(in) :: con_g integer, intent(in) :: npdf3d, num_p3d, ncnvcld3d logical, intent(in) :: satmedmf, trans_trac real(kind=kind_phys), dimension(:), intent(inout) :: rainc, cldwrk - real(kind=kind_phys), dimension(:,:), intent(inout) :: upd_mf, dwn_mf, det_mf + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: upd_mf, dwn_mf, det_mf real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw, cnvc - real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend + real(kind=kind_phys), dimension(:,:,:), intent(inout), optional :: dtend integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_temperature, & index_of_x_wind, index_of_y_wind, ntqv integer, intent(in) :: ntcw,ntiw,ntclamt,ntrw,ntsw,ntrnc,ntsnc,ntgl, & @@ -50,7 +51,7 @@ subroutine GFS_DCNV_generic_post_run (im, levs, lssav, ldiag3d, qdiag3d, ras, & real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw - real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw_phy_f3d, cnvc_phy_f3d + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: cnvw_phy_f3d, cnvc_phy_f3d character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 index 58f18567d..579d32fac 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 @@ -27,7 +27,7 @@ subroutine GFS_GWD_generic_post_run(lssav, ldiag3d, dtf, dusfcg, dvsfcg, dudt, d real(kind=kind_phys), intent(inout) :: dugwd(:), dvgwd(:) ! dtend only allocated only if ldiag3d is .true. - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_x_wind, index_of_y_wind, index_of_process_orographic_gwd diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 index 51a76c989..53dce2b4c 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 @@ -28,13 +28,13 @@ subroutine GFS_GWD_generic_pre_run( & real(kind=kind_phys), intent(out) :: & & oc(:), oa4(:,:), clx(:,:), & - & varss(:), ocss(:), oa4ss(:,:), clxss(:,:), & & theta(:), sigma(:), gamma(:), elvmax(:) - + real(kind=kind_phys), intent(out), optional :: & + & varss(:), ocss(:), oa4ss(:,:), clxss(:,:) logical, intent(in) :: lssav, ldiag3d, flag_for_gwd_generic_tend real(kind=kind_phys), intent(in) :: dtdt(:,:), dudt(:,:), dvdt(:,:) ! dtend only allocated only if ldiag3d is .true. - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_x_wind, index_of_y_wind, index_of_process_orographic_gwd real(kind=kind_phys), intent(in) :: dtf diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 index d9d30fb90..0c991924b 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 @@ -52,38 +52,38 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin, rhowater real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc real(kind=kind_phys), dimension(:), intent(inout) :: ice, snow, graupel, rainc - real(kind=kind_phys), dimension(:), intent(in) :: rain0, ice0, snow0, graupel0 + real(kind=kind_phys), dimension(:), intent(in), optional :: rain0, ice0, snow0, graupel0 real(kind=kind_phys), dimension(:,:), intent(in) :: rann real(kind=kind_phys), dimension(:,:), intent(in) :: prsl, save_t, del real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, phii,phil real(kind=kind_phys), dimension(:,:,:), intent(in) :: gq0, save_q - real(kind=kind_phys), dimension(:,:,:), intent(in) :: dfi_radar_tten + real(kind=kind_phys), dimension(:,:,:), intent(in), optional :: dfi_radar_tten real(kind=kind_phys), dimension(:), intent(in ) :: sr real(kind=kind_phys), dimension(:), intent(inout) :: rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, & srflag, cnvprcp, totprcp, totice, totsnw, totgrp, cnvprcpb, & totprcpb, toticeb, totsnwb, totgrpb, pwat - real(kind=kind_phys), dimension(:), intent(inout) :: rain_cpl, rainc_cpl, snow_cpl + real(kind=kind_phys), dimension(:), intent(inout), optional :: rain_cpl, rainc_cpl, snow_cpl - real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend + real(kind=kind_phys), dimension(:,:,:), intent(inout), optional :: dtend integer, dimension(:,:), intent(in) :: dtidx ! Stochastic physics / surface perturbations - real(kind=kind_phys), dimension(:), intent(inout) :: drain_cpl, dsnow_cpl + real(kind=kind_phys), dimension(:), intent(inout), optional :: drain_cpl, dsnow_cpl ! Rainfall variables previous time step integer, intent(in) :: lsm, lsm_ruc, lsm_noahmp - real(kind=kind_phys), dimension(:), intent(inout) :: raincprv - real(kind=kind_phys), dimension(:), intent(inout) :: rainncprv - real(kind=kind_phys), dimension(:), intent(inout) :: iceprv - real(kind=kind_phys), dimension(:), intent(inout) :: snowprv - real(kind=kind_phys), dimension(:), intent(inout) :: graupelprv - real(kind=kind_phys), dimension(:), intent(inout) :: draincprv - real(kind=kind_phys), dimension(:), intent(inout) :: drainncprv - real(kind=kind_phys), dimension(:), intent(inout) :: diceprv - real(kind=kind_phys), dimension(:), intent(inout) :: dsnowprv - real(kind=kind_phys), dimension(:), intent(inout) :: dgraupelprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: raincprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: rainncprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: iceprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: snowprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: graupelprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: draincprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: drainncprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: diceprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: dsnowprv + real(kind=kind_phys), dimension(:), intent(inout), optional :: dgraupelprv real(kind=kind_phys), dimension(:), intent(inout) :: frzr real(kind=kind_phys), dimension(:), intent(inout) :: frzrb real(kind=kind_phys), dimension(:), intent(inout) :: frozr @@ -91,8 +91,8 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys), dimension(:), intent(inout) :: tsnowp real(kind=kind_phys), dimension(:), intent(inout) :: tsnowpb real(kind=kind_phys), dimension(:), intent(inout) :: rhonewsn1 - real(kind=kind_phys), dimension(:,:), intent(inout) :: dqdt_qmicro - real(kind=kind_phys), dimension(:,:), intent(inout) :: prevsq + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: dqdt_qmicro + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: prevsq real(kind=kind_phys), intent(in) :: dtp ! CCPP error handling diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 index a4e5f172a..ccf83f7bb 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 @@ -47,8 +47,9 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, real(kind=kind_phys), intent(in) :: rd, cp, fvirt, hvap, huge real(kind=kind_phys), dimension(:), intent(in) :: t1, q1, hflx, oceanfrac real(kind=kind_phys), dimension(:,:), intent(in) :: prsl - real(kind=kind_phys), dimension(:), intent(in) :: dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice, & - dtsfc_med, dqsfc_med, dusfc_med, dvsfc_med, wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1 + real(kind=kind_phys), dimension(:), intent(in), optional :: dusfc_cice, dvsfc_cice, dtsfc_cice, dqsfc_cice, & + dtsfc_med, dqsfc_med, dusfc_med, dvsfc_med + real(kind=kind_phys), dimension(:), intent(in) :: wind, stress_wat, hflx_wat, evap_wat, ugrs1, vgrs1 real(kind=kind_phys), dimension(:,:, :), intent(in) :: qgrs real(kind=kind_phys), dimension(:,:), intent(in) :: ugrs, vgrs, tgrs @@ -63,14 +64,16 @@ subroutine GFS_PBL_generic_post_run (im, levs, nvdiff, ntrac, ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays ! as long as these do not get used when not allocated. - real(kind=kind_phys), dimension(:), intent(inout) :: dusfc_cpl, dvsfc_cpl, dtsfc_cpl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, & - dtsfci_cpl, dqsfci_cpl, dusfc_diag, dvsfc_diag, dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag + real(kind=kind_phys), dimension(:), intent(inout), optional :: dusfc_cpl, dvsfc_cpl, & + dtsfc_cpl, dqsfc_cpl, dusfci_cpl, dvsfci_cpl, dtsfci_cpl, dqsfci_cpl + real(kind=kind_phys), dimension(:), intent(inout) :: dusfc_diag, dvsfc_diag, & + dtsfc_diag, dqsfc_diag, dusfci_diag, dvsfci_diag, dtsfci_diag, dqsfci_diag real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) integer, intent(in) :: index_of_temperature, index_of_x_wind, index_of_y_wind, index_of_process_pbl logical, dimension(:),intent(in) :: wet, dry, icy - real(kind=kind_phys), dimension(:), intent(out) :: ushfsfci + real(kind=kind_phys), dimension(:), intent(out), optional :: ushfsfci ! From canopy heat storage - reduction factors in latent/sensible heat flux due to surface roughness real(kind=kind_phys), dimension(:), intent(in) :: hffac diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 index 0b38ff081..8102d70eb 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 @@ -31,7 +31,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & real(kind=kind_phys), dimension(:,:,:), intent(in) :: save_q, gq0 ! dtend only allocated if ldiag3d == .true. - real(kind=kind_phys), intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:) integer, intent(in) :: index_of_temperature, index_of_x_wind, index_of_y_wind, index_of_process_scnv real(kind=kind_phys), dimension(:,:,:), intent(in) :: clw @@ -46,7 +46,7 @@ subroutine GFS_SCNV_generic_post_run (im, levs, nn, lssav, ldiag3d, qdiag3d, & ! Since Intel 15 crashes when passing unallocated arrays to arrays defined with explicit shape, ! use assumed-shape arrays. Note that Intel 18 and GNU 6.2.0-8.1.0 tolerate explicit-shape arrays ! as long as these do not get used when not allocated. - real(kind=kind_phys), dimension(:,:), intent(inout) :: cnvw_phy_f3d, cnvc_phy_f3d + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: cnvw_phy_f3d, cnvc_phy_f3d integer, intent(in) :: imfshalcnv, imfshalcnv_sas, imfshalcnv_samf logical, intent(in) :: cscnv, satmedmf, trans_trac, ras diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 index 86dc2b518..2fd553c8e 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 @@ -59,12 +59,13 @@ subroutine GFS_cloud_diagnostics_run(nCol, nLev, iovr, iovr_rand, iovr_maxrand, lat, & ! Latitude de_lgth, & ! Decorrelation length si ! Vertical sigma coordinate + real(kind_phys), dimension(:,:), intent(in), optional :: & + p_lay ! Pressure at model-layer real(kind_phys), dimension(:,:), intent(in) :: & - p_lay, & ! Pressure at model-layer cld_frac ! Total cloud fraction - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & p_lev ! Pressure at model interfaces - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & deltaZ, & ! Layer thickness (m) cloud_overlap_param, & ! Cloud-overlap parameter precip_overlap_param ! Precipitation overlap parameter diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 index 406887f00..ea9beaf90 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 @@ -112,19 +112,19 @@ subroutine GFS_phys_time_vary_init ( integer, intent(inout) :: use_lake_model(:) real(kind=kind_phys), intent(in ) :: lakefrac(:), lakedepth(:) - integer, intent(inout) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(inout) :: ddy_o3(:), ddy_h(:) + integer, intent(inout), optional :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(inout), optional :: ddy_o3(:), ddy_h(:) real(kind_phys), intent(in) :: h2opl(:,:,:) - integer, intent(inout) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) - real(kind_phys), intent(inout) :: ddy_aer(:), ddx_aer(:) + integer, intent(inout), optional :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) + real(kind_phys), intent(inout), optional :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(out) :: aer_nm(:,:,:) - integer, intent(inout) :: jindx1_ci(:), jindx2_ci(:), iindx1_ci(:), iindx2_ci(:) - real(kind_phys), intent(inout) :: ddy_ci(:), ddx_ci(:) + integer, intent(inout), optional :: jindx1_ci(:), jindx2_ci(:), iindx1_ci(:), iindx2_ci(:) + real(kind_phys), intent(inout), optional :: ddy_ci(:), ddx_ci(:) integer, intent(inout) :: imap(:), jmap(:) logical, intent(in) :: do_ugwp_v1 - real(kind_phys), intent(inout) :: ddy_j1tau(:), ddy_j2tau(:) - integer, intent(inout) :: jindx1_tau(:), jindx2_tau(:) + real(kind_phys), intent(inout), optional :: ddy_j1tau(:), ddy_j2tau(:) + integer, intent(inout), optional :: jindx1_tau(:), jindx2_tau(:) integer, intent(in) :: isot, ivegsrc, nlunit real(kind_phys), intent(inout) :: sncovr(:), sncovr_ice(:) @@ -138,50 +138,50 @@ subroutine GFS_phys_time_vary_init ( integer, intent(in) :: lsoil, lsnow_lsm_lbound, lsnow_lsm_ubound real(kind_phys), intent(in) :: zs(:) real(kind_phys), intent(in) :: dzs(:) - real(kind_phys), intent(inout) :: tvxy(:) - real(kind_phys), intent(inout) :: tgxy(:) - real(kind_phys), intent(inout) :: tahxy(:) - real(kind_phys), intent(inout) :: canicexy(:) - real(kind_phys), intent(inout) :: canliqxy(:) - real(kind_phys), intent(inout) :: eahxy(:) - real(kind_phys), intent(inout) :: cmxy(:) - real(kind_phys), intent(inout) :: chxy(:) - real(kind_phys), intent(inout) :: fwetxy(:) - real(kind_phys), intent(inout) :: sneqvoxy(:) - real(kind_phys), intent(inout) :: alboldxy(:) - real(kind_phys), intent(inout) :: qsnowxy(:) - real(kind_phys), intent(inout) :: wslakexy(:) + real(kind_phys), intent(inout), optional :: tvxy(:) + real(kind_phys), intent(inout), optional :: tgxy(:) + real(kind_phys), intent(inout), optional :: tahxy(:) + real(kind_phys), intent(inout), optional :: canicexy(:) + real(kind_phys), intent(inout), optional :: canliqxy(:) + real(kind_phys), intent(inout), optional :: eahxy(:) + real(kind_phys), intent(inout), optional :: cmxy(:) + real(kind_phys), intent(inout), optional :: chxy(:) + real(kind_phys), intent(inout), optional :: fwetxy(:) + real(kind_phys), intent(inout), optional :: sneqvoxy(:) + real(kind_phys), intent(inout), optional :: alboldxy(:) + real(kind_phys), intent(inout), optional :: qsnowxy(:) + real(kind_phys), intent(inout), optional :: wslakexy(:) real(kind_phys), intent(inout) :: albdvis_lnd(:) real(kind_phys), intent(inout) :: albdnir_lnd(:) real(kind_phys), intent(inout) :: albivis_lnd(:) real(kind_phys), intent(inout) :: albinir_lnd(:) - real(kind_phys), intent(inout) :: albdvis_ice(:) - real(kind_phys), intent(inout) :: albdnir_ice(:) - real(kind_phys), intent(inout) :: albivis_ice(:) - real(kind_phys), intent(inout) :: albinir_ice(:) + real(kind_phys), intent(inout), optional :: albdvis_ice(:) + real(kind_phys), intent(inout), optional :: albdnir_ice(:) + real(kind_phys), intent(inout), optional :: albivis_ice(:) + real(kind_phys), intent(inout), optional :: albinir_ice(:) real(kind_phys), intent(inout) :: emiss_lnd(:) real(kind_phys), intent(inout) :: emiss_ice(:) - real(kind_phys), intent(inout) :: taussxy(:) - real(kind_phys), intent(inout) :: waxy(:) - real(kind_phys), intent(inout) :: wtxy(:) - real(kind_phys), intent(inout) :: zwtxy(:) - real(kind_phys), intent(inout) :: xlaixy(:) - real(kind_phys), intent(inout) :: xsaixy(:) - real(kind_phys), intent(inout) :: lfmassxy(:) - real(kind_phys), intent(inout) :: stmassxy(:) - real(kind_phys), intent(inout) :: rtmassxy(:) - real(kind_phys), intent(inout) :: woodxy(:) - real(kind_phys), intent(inout) :: stblcpxy(:) - real(kind_phys), intent(inout) :: fastcpxy(:) - real(kind_phys), intent(inout) :: smcwtdxy(:) - real(kind_phys), intent(inout) :: deeprechxy(:) - real(kind_phys), intent(inout) :: rechxy(:) - real(kind_phys), intent(inout) :: snowxy(:) - real(kind_phys), intent(inout) :: snicexy(:,lsnow_lsm_lbound:) - real(kind_phys), intent(inout) :: snliqxy(:,lsnow_lsm_lbound:) - real(kind_phys), intent(inout) :: tsnoxy (:,lsnow_lsm_lbound:) - real(kind_phys), intent(inout) :: smoiseq(:,:) - real(kind_phys), intent(inout) :: zsnsoxy(:,lsnow_lsm_lbound:) + real(kind_phys), intent(inout), optional :: taussxy(:) + real(kind_phys), intent(inout), optional :: waxy(:) + real(kind_phys), intent(inout), optional :: wtxy(:) + real(kind_phys), intent(inout), optional :: zwtxy(:) + real(kind_phys), intent(inout), optional :: xlaixy(:) + real(kind_phys), intent(inout), optional :: xsaixy(:) + real(kind_phys), intent(inout), optional :: lfmassxy(:) + real(kind_phys), intent(inout), optional :: stmassxy(:) + real(kind_phys), intent(inout), optional :: rtmassxy(:) + real(kind_phys), intent(inout), optional :: woodxy(:) + real(kind_phys), intent(inout), optional :: stblcpxy(:) + real(kind_phys), intent(inout), optional :: fastcpxy(:) + real(kind_phys), intent(inout), optional :: smcwtdxy(:) + real(kind_phys), intent(inout), optional :: deeprechxy(:) + real(kind_phys), intent(inout), optional :: rechxy(:) + real(kind_phys), intent(inout), optional :: snowxy(:) + real(kind_phys), intent(inout), optional :: snicexy(:,lsnow_lsm_lbound:) + real(kind_phys), intent(inout), optional :: snliqxy(:,lsnow_lsm_lbound:) + real(kind_phys), intent(inout), optional :: tsnoxy (:,lsnow_lsm_lbound:) + real(kind_phys), intent(inout), optional :: smoiseq(:,:) + real(kind_phys), intent(inout), optional :: zsnsoxy(:,lsnow_lsm_lbound:) real(kind_phys), intent(inout) :: slc(:,:) real(kind_phys), intent(inout) :: smc(:,:) real(kind_phys), intent(inout) :: stc(:,:) @@ -746,14 +746,14 @@ subroutine GFS_phys_time_vary_timestep_init ( real(kind_phys), intent(in) :: fhswr, fhour logical, intent(in) :: lsswr, cal_pre, random_clds, h2o_phys, iaerclm real(kind_phys), intent(out) :: clstp - integer, intent(in) :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) - real(kind_phys), intent(in) :: ddy_o3(:), ddy_h(:) + integer, intent(in), optional :: jindx1_o3(:), jindx2_o3(:), jindx1_h(:), jindx2_h(:) + real(kind_phys), intent(in), optional :: ddy_o3(:), ddy_h(:) real(kind_phys), intent(inout) :: ozpl(:,:,:), h2opl(:,:,:) - integer, intent(in) :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) - real(kind_phys), intent(in) :: ddy_aer(:), ddx_aer(:) + integer, intent(in), optional :: jindx1_aer(:), jindx2_aer(:), iindx1_aer(:), iindx2_aer(:) + real(kind_phys), intent(in), optional :: ddy_aer(:), ddx_aer(:) real(kind_phys), intent(inout) :: aer_nm(:,:,:) - integer, intent(in) :: jindx1_ci(:), jindx2_ci(:), iindx1_ci(:), iindx2_ci(:) - real(kind_phys), intent(in) :: ddy_ci(:), ddx_ci(:) + integer, intent(in), optional :: jindx1_ci(:), jindx2_ci(:), iindx1_ci(:), iindx2_ci(:) + real(kind_phys), intent(in), optional :: ddy_ci(:), ddx_ci(:) real(kind_phys), intent(inout) :: in_nm(:,:), ccn_nm(:,:) integer, intent(in) :: imap(:), jmap(:) real(kind_phys), intent(in) :: prsl(:,:) @@ -761,8 +761,8 @@ subroutine GFS_phys_time_vary_timestep_init ( real(kind_phys), intent(inout) :: rann(:,:) logical, intent(in) :: do_ugwp_v1 - integer, intent(in) :: jindx1_tau(:), jindx2_tau(:) - real(kind_phys), intent(in) :: ddy_j1tau(:), ddy_j2tau(:) + integer, intent(in), optional :: jindx1_tau(:), jindx2_tau(:) + real(kind_phys), intent(in), optional :: ddy_j1tau(:), ddy_j2tau(:) real(kind_phys), intent(inout) :: tau_amf(:) type(ty_ozphys), intent(in) :: ozphys @@ -774,13 +774,13 @@ subroutine GFS_phys_time_vary_timestep_init ( logical, intent(in) :: use_ufo, nst_anl, frac_grid real(kind_phys), intent(in) :: fhcyc, phour, lakefrac(:), min_seaice, min_lakeice, & xlat_d(:), xlon_d(:), landfrac(:) - real(kind_phys), intent(inout) :: smc(:,:), slc(:,:), stc(:,:), smois(:,:), sh2o(:,:), & - tslb(:,:), tiice(:,:), tg3(:), tref(:), & + real(kind_phys), intent(inout) :: smc(:,:), slc(:,:), stc(:,:), tiice(:,:), tg3(:), & tsfc(:), tsfco(:), tisfc(:), hice(:), fice(:), & facsf(:), facwf(:), alvsf(:), alvwf(:), alnsf(:), alnwf(:), & zorli(:), zorll(:), zorlo(:), weasd(:), snoalb(:), & canopy(:), vfrac(:), shdmin(:), shdmax(:), & snowd(:), cv(:), cvb(:), cvt(:), oro(:), oro_uf(:), slmsk(:) + real(kind_phys), intent(inout), optional :: smois(:,:), sh2o(:,:), tslb(:,:), tref(:) integer, intent(inout) :: vtype(:), stype(:),scolor(:), slope(:) character(len=*), intent(out) :: errmsg diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.F90 index fe5409353..ec041623c 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.F90 @@ -53,7 +53,7 @@ subroutine GFS_physics_post_run(nCol, nLev, ntoz, ntracp100, nprocess, nprocess_ do3_dt_ohoz ! Physics tendency: overhead ozone effect ! Outputs - real(kind=kind_phys), intent(inout), dimension(:,:,:) :: & + real(kind=kind_phys), intent(inout), dimension(:,:,:), optional :: & dtend ! Diagnostic tendencies for state variables character(len=*), intent(out) :: & errmsg ! CCPP error message diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90 index 978dc177f..d55fac983 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90 @@ -30,19 +30,19 @@ subroutine GFS_rad_time_vary_timestep_init (lrseeds, rseeds, ! Interface variables logical, intent(in) :: lrseeds - integer, intent(in) :: rseeds(:,:) + integer, intent(in), optional :: rseeds(:,:) integer, intent(in) :: isubc_lw, isubc_sw, cnx, cny, isc, jsc, kdt integer, intent(in) :: imp_physics, imp_physics_zhao_carr, ipsd0, ipsdlim logical, intent(in) :: lslwr, lsswr - integer, intent(inout) :: icsdsw(:), icsdlw(:) + integer, intent(inout), optional :: icsdsw(:), icsdlw(:) integer, intent(in) :: imap(:), jmap(:) real(kind_phys), intent(in) :: sec - real(kind_phys), intent(inout) :: ps_2delt(:) - real(kind_phys), intent(inout) :: ps_1delt(:) - real(kind_phys), intent(inout) :: t_2delt(:,:) - real(kind_phys), intent(inout) :: t_1delt(:,:) - real(kind_phys), intent(inout) :: qv_2delt(:,:) - real(kind_phys), intent(inout) :: qv_1delt(:,:) + real(kind_phys), intent(inout), optional :: ps_2delt(:) + real(kind_phys), intent(inout), optional :: ps_1delt(:) + real(kind_phys), intent(inout), optional :: t_2delt(:,:) + real(kind_phys), intent(inout), optional :: t_1delt(:,:) + real(kind_phys), intent(inout), optional :: qv_2delt(:,:) + real(kind_phys), intent(inout), optional:: qv_1delt(:,:) real(kind_phys), intent(in) :: t(:,:), qv(:,:), ps(:) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 index 767d3e534..69d723b8a 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 @@ -123,7 +123,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& integer, intent(in) :: ntdu1, ntdu2, ntdu3, ntdu4, ntdu5, ntss1, ntss2, ntss3, & ntss4, ntss5, ntsu, ntbcb, ntbcl, ntocb, ntocl, ntchm - character(len=3), dimension(:), intent(in) :: lndp_var_list + character(len=3), dimension(:), intent(in), optional :: lndp_var_list logical, intent(in) :: lsswr, lslwr, ltaerosol, lgfdlmprad, & uni_cld, effr_in, do_mynnedmf, & @@ -133,7 +133,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& logical, intent(in) :: nssl_ccn_on, nssl_invertccn integer, intent(in) :: spp_rad - real(kind_phys), intent(in) :: spp_wts_rad(:,:) + real(kind_phys), intent(in), optional :: spp_wts_rad(:,:) real(kind=kind_phys), intent(in) :: fhswr, fhlwr, solhr, sup, julian, sppt_amp, dcorr_con real(kind=kind_phys), intent(in) :: con_eps, epsm1, fvirt, rog, rocp, con_rd, con_pi, con_g, con_ttp, con_thgni @@ -143,7 +143,8 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& slmsk, dx, si real(kind=kind_phys), dimension(:,:), intent(in) :: prsi, prsl, prslk, & - tgrs, sfc_wts, & + tgrs, sfc_wts + real(kind=kind_phys), dimension(:,:), intent(in), optional :: & mg_cld, effrr_in, & cnvw_in, cnvc_in, & sppt_wts @@ -153,13 +154,13 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& real(kind=kind_phys), dimension(:), intent(inout) :: coszen, coszdg - real(kind=kind_phys), dimension(:,:), intent(inout) :: effrl_inout, & + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: effrl_inout, & effri_inout, & effrs_inout real(kind=kind_phys), dimension(:,:), intent(inout) :: clouds1, & clouds2, clouds3, & clouds4, clouds5 - real(kind=kind_phys), dimension(:,:), intent(in) :: qci_conv + real(kind=kind_phys), dimension(:,:), intent(in), optional :: qci_conv real(kind=kind_phys), dimension(:), intent(in) :: fdb_coef real(kind=kind_phys), dimension(:), intent(out) :: lwp_ex,iwp_ex, & lwp_fc,iwp_fc diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 index 22fe2fc21..34dc7de86 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 @@ -71,7 +71,7 @@ subroutine GFS_rrtmgp_post_run (nCol, nLev, nDay, iSFC, iTOA, idxday, doLWrad, d sfc_alb_nir_dif, & ! Surface albedo (diffuse) sfc_alb_uvvis_dir, & ! Surface albedo (direct) sfc_alb_uvvis_dif ! Surface albedo (diffuse) - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & p_lev, & ! Pressure @ model layer-interfaces (Pa) fluxlwUP_allsky, & ! RRTMGP longwave all-sky flux (W/m2) fluxlwDOWN_allsky, & ! RRTMGP longwave all-sky flux (W/m2) @@ -118,7 +118,8 @@ subroutine GFS_rrtmgp_post_run (nCol, nLev, nDay, iSFC, iTOA, idxday, doLWrad, d sfcdsw ! SW sfc all-sky downward flux (W/m2) real(kind_phys), dimension(:,:), intent(inout) :: & htrlw, & ! LW all-sky heating rate (K/s) - htrsw, & ! SW all-sky heating rate (K/s) + htrsw ! SW all-sky heating rate (K/s) + real(kind_phys), dimension(:,:), intent(inout), optional :: & htrlwu ! LW all-sky heating-rate updated in-between radiation calls. type(sfcflw_type), dimension(:), intent(inout) :: & sfcflw ! LW radiation fluxes at sfc diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 index cbf8d161b..ba5e2ad58 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 @@ -48,7 +48,7 @@ subroutine GFS_rrtmgp_pre_init(nGases, active_gases, active_gases_array, errmsg, nGases ! Number of active gases in RRTMGP character(len=*), intent(in) :: & active_gases ! List of active gases from namelist - character(len=*), dimension(:), intent(out) :: & + character(len=*), dimension(:), intent(out), optional :: & active_gases_array ! List of active gases from namelist as array ! Outputs @@ -158,7 +158,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl prsi ! Pressure at model-interfaces (Pa) real(kind_phys), dimension(:,:,:), intent(in) :: & qgrs ! Tracer concentrations (kg/kg) - character(len=*), dimension(:), intent(in) :: & + character(len=*), dimension(:), intent(in), optional :: & active_gases_array ! List of active gases from namelist as array ! Outputs @@ -182,7 +182,7 @@ subroutine GFS_rrtmgp_pre_run(me, nCol, nLev, i_o3, doSWrad, doLWrad, fhswr, fhl coszdg ! Cosine of SZA, daytime integer, dimension(:), intent(inout) :: & idxday ! Indices for daylit points - real(kind_phys), dimension(:,:), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout), optional :: & p_lay, & ! Pressure at model-layer t_lay, & ! Temperature at model layer q_lay, & ! Water-vapor mixing ratio (kg/kg) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.F90 index 36ed2815a..2fb1b185d 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.F90 @@ -89,12 +89,12 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc logical, intent(in) :: do_skeb real(kind_phys), dimension(:), intent(in) :: zmtnblck ! sppt_wts only allocated if do_sppt == .true. - real(kind_phys), dimension(:,:), intent(inout) :: sppt_wts + real(kind_phys), dimension(:,:), intent(inout), optional :: sppt_wts ! skebu_wts, skebv_wts only allocated if do_skeb == .true. - real(kind_phys), dimension(:,:), intent(in) :: skebu_wts - real(kind_phys), dimension(:,:), intent(in) :: skebv_wts + real(kind_phys), dimension(:,:), intent(in), optional :: skebu_wts + real(kind_phys), dimension(:,:), intent(in), optional :: skebv_wts ! shum_wts only allocated if do_shum == .true. - real(kind_phys), dimension(:,:), intent(in) :: shum_wts + real(kind_phys), dimension(:,:), intent(in), optional :: shum_wts real(kind_phys), dimension(:,:), intent(in) :: diss_est real(kind_phys), dimension(:,:), intent(in) :: ugrs real(kind_phys), dimension(:,:), intent(in) :: vgrs @@ -119,7 +119,7 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc integer, intent(in) :: ntsw integer, intent(in) :: ntiw integer, intent(in) :: ntgl - real(kind_phys), dimension(:,:), intent(inout) :: dtdtnp + real(kind_phys), dimension(:,:), intent(inout), optional :: dtdtnp real(kind_phys), dimension(:), intent(in) :: rain real(kind_phys), dimension(:), intent(in) :: rainc real(kind_phys), dimension(:), intent(inout) :: tprcp @@ -130,14 +130,14 @@ subroutine GFS_stochastics_run (im, km, kdt, delt, do_sppt, pert_mp, use_zmtnblc logical, intent(in) :: cplflx logical, intent(in) :: cpllnd ! rain_cpl only allocated if cplflx == .true. or cplchm == .true. or cpllnd == .true. - real(kind_phys), dimension(:), intent(inout) :: rain_cpl + real(kind_phys), dimension(:), intent(inout), optional :: rain_cpl ! snow_cpl only allocated if cplflx == .true. or cplchm == .true. - real(kind_phys), dimension(:), intent(inout) :: snow_cpl + real(kind_phys), dimension(:), intent(inout), optional :: snow_cpl ! drain_cpl, dsnow_cpl only allocated if cplflx == .true. or cplchm == .true. - real(kind_phys), dimension(:), intent(in) :: drain_cpl - real(kind_phys), dimension(:), intent(in) :: dsnow_cpl + real(kind_phys), dimension(:), intent(in), optional :: drain_cpl + real(kind_phys), dimension(:), intent(in), optional :: dsnow_cpl real(kind_phys), dimension(:), intent(in) :: vfact_ca - real(kind_phys), dimension(:), intent(in) :: ca1 + real(kind_phys), dimension(:), intent(in), optional :: ca1 character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90 index cbabb991b..d1aadb731 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90 @@ -37,7 +37,7 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr ! dtend and dtidx are only allocated if ldiag3d logical, intent(in) :: ldiag3d, qdiag3d - real(kind=kind_phys), dimension(:,:,:), intent(inout) :: dtend + real(kind=kind_phys), dimension(:,:,:), intent(inout), optional :: dtend integer, dimension(:,:), intent(in) :: dtidx integer, intent(in) :: index_of_process_conv_trans,ntk,ntke @@ -45,7 +45,8 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr real(kind=kind_phys), dimension(:,:,:), intent(inout) :: clw real(kind=kind_phys), dimension(:,:), intent(in) :: prsl real(kind=kind_phys), intent(in) :: con_rd, con_eps, nssl_cccn - real(kind=kind_phys), dimension(:,:), intent(in) :: nwfa, save_tcp + real(kind=kind_phys), dimension(:,:), intent(in), optional :: nwfa + real(kind=kind_phys), dimension(:,:), intent(in) :: save_tcp real(kind=kind_phys), dimension(:,:), intent(in) :: spechum character(len=*), intent( out) :: errmsg @@ -290,4 +291,4 @@ subroutine GFS_suite_interstitial_4_run (im, levs, ltaerosol, tracers_total, ntr end subroutine GFS_suite_interstitial_4_run - end module GFS_suite_interstitial_4 \ No newline at end of file + end module GFS_suite_interstitial_4 diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90 index 53867f6cc..c2f5266fd 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90 @@ -37,7 +37,7 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, tgrs, ugrs, vgrs type(ty_ozphys), intent(in) :: ozphys ! Outputs (optional) - real(kind=kind_phys), intent(inout), dimension(:,:) :: & + real(kind=kind_phys), intent(inout), dimension(:,:), optional :: & do3_dt_prd, & ! Physics tendency: production and loss effect do3_dt_ozmx, & ! Physics tendency: ozone mixing ratio effect do3_dt_temp, & ! Physics tendency: temperature effect diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.F90 index 7e8cfa753..8e3e0fdbf 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.F90 @@ -66,14 +66,16 @@ subroutine GFS_surface_generic_post_run (im, cplflx, cplaqm, cplchm, cplwav, cpl real(kind=kind_phys), dimension(:), intent(in) :: ep1d, gflx, tgrs_1, qgrs_1, ugrs_1, vgrs_1, adjsfcdlw, adjsfcdsw, & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd, adjsfculw, adjsfculw_wat, adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & - t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, pah, ecan, etran, edir, & + t2m, q2m, u10m, v10m, tsfc, tsfc_wat, pgr, xcosz, evbs, evcw, trans, sbsno, snowc, snohf, pah, ecan, etran, edir + real(kind=kind_phys), dimension(:), intent(in), optional :: & waxy - real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & + real(kind=kind_phys), dimension(:), intent(inout) :: epi, gfluxi, t1, q1, u1, v1,gflux, evbsa, & + evcwa, transa, sbsnoa, snowca, snohfa, ep, tecan, tetran, tedir + real(kind=kind_phys), dimension(:), intent(inout), optional :: pahi, dlwsfci_cpl, dswsfci_cpl, dlwsfc_cpl, & dswsfc_cpl, dnirbmi_cpl, dnirdfi_cpl, dvisbmi_cpl, dvisdfi_cpl, dnirbm_cpl, dnirdf_cpl, dvisbm_cpl, dvisdf_cpl, & nlwsfci_cpl, nlwsfc_cpl, t2mi_cpl, q2mi_cpl, u10mi_cpl, v10mi_cpl, tsfci_cpl, psurfi_cpl, nnirbmi_cpl, nnirdfi_cpl, & - nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, gflux, evbsa, & - evcwa, transa, sbsnoa, snowca, snohfa, ep, paha, tecan, tetran, tedir, twa, pahi + nvisbmi_cpl, nvisdfi_cpl, nswsfci_cpl, nswsfc_cpl, nnirbm_cpl, nnirdf_cpl, nvisbm_cpl, nvisdf_cpl, paha, twa real(kind=kind_phys), dimension(:), intent(inout) :: runoff, srunoff real(kind=kind_phys), dimension(:), intent(in) :: drain, runof diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 index b85168a2d..8d9fe7de9 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 @@ -87,9 +87,9 @@ subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot, ! Stochastic physics / surface perturbations integer, intent(in) :: lndp_type, n_var_lndp - character(len=3), dimension(:), intent(in) :: lndp_var_list - real(kind=kind_phys), dimension(:), intent(in) :: lndp_prt_list - real(kind=kind_phys), dimension(:,:), intent(in) :: sfc_wts + character(len=3), dimension(:), intent(in), optional :: lndp_var_list + real(kind=kind_phys), dimension(:), intent(in), optional :: lndp_prt_list + real(kind=kind_phys), dimension(:,:), intent(in), optional :: sfc_wts real(kind=kind_phys), dimension(:), intent(out) :: z01d real(kind=kind_phys), dimension(:), intent(out) :: zt1d real(kind=kind_phys), dimension(:), intent(out) :: bexp1d @@ -98,14 +98,14 @@ subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot, real(kind=kind_phys), intent(out) :: lndp_vgf logical, intent(in) :: cplflx - real(kind=kind_phys), dimension(:), intent(in) :: slimskin_cpl + real(kind=kind_phys), dimension(:), intent(in), optional :: slimskin_cpl logical, dimension(:), intent(inout) :: flag_cice integer, dimension(:), intent(out) :: islmsk_cice real(kind=kind_phys), dimension(:), intent(out) :: wind real(kind=kind_phys), dimension(:), intent(in ) :: u1, v1 ! surface wind enhancement due to convection - real(kind=kind_phys), dimension(:), intent(inout ) :: cnvwind + real(kind=kind_phys), dimension(:), intent(inout ), optional :: cnvwind ! real(kind=kind_phys), dimension(:), intent(out) :: smcwlt2, smcref2 diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f index 1e373ae12..b42352f32 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f @@ -214,8 +214,9 @@ subroutine dcyc2t3_run & real(kind=kind_phys), dimension(:), intent(in) :: & & sinlat, coslat, xlon, coszen, tf, tsflw, sfcdlw, & - & sfcdsw, sfcnsw, sfculw, sfculw_med, tsfc, tsfc_radtime - + & sfcdsw, sfcnsw, sfculw, tsfc + real(kind=kind_phys), dimension(:), intent(in), optional :: & + & sfculw_med, tsfc_radtime real(kind=kind_phys), dimension(:), intent(in) :: & & tsfc_lnd, tsfc_ice, tsfc_wat, & & sfcemis_lnd, sfcemis_ice, sfcemis_wat @@ -227,7 +228,8 @@ subroutine dcyc2t3_run & real(kind=kind_phys), dimension(:,:), intent(in) :: swh, hlw, & & swhc, hlwc, p_lay, t_lay - real(kind=kind_phys), dimension(:,:), intent(in) :: p_lev, & + real(kind=kind_phys), dimension(:,:), intent(in) :: p_lev + real(kind=kind_phys), dimension(:,:), intent(in), optional :: & & flux2D_lwUP, flux2D_lwDOWN, fluxlwUP_jac real(kind_phys), intent(in ) :: con_g, con_cp, & @@ -237,8 +239,9 @@ subroutine dcyc2t3_run & ! --- input/output: - real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdt, htrlw - real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdtnp + real(kind=kind_phys), dimension(:,:), intent(inout) :: dtdt + real(kind=kind_phys), dimension(:,:), intent(inout), optional :: & + & dtdtnp, htrlw ! --- outputs: real(kind=kind_phys), dimension(:), intent(out) :: & diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 index 5ac28afe8..74ebcb709 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 @@ -66,8 +66,9 @@ subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, real(kind_phys), intent(in ) :: prsl(:,:) real(kind_phys), intent(inout) :: pratemax(:) - real(kind_phys), intent(in), dimension(:,:) :: prsi, qgraupel, qsnowwat, qicewat, wgrs - real(kind_phys), intent(inout), dimension(:) :: ltg1_max, ltg2_max, ltg3_max + real(kind_phys), intent(in), dimension(:,:) :: prsi, qgraupel, qsnowwat, qicewat + real(kind_phys), intent(in), dimension(:,:), optional :: wgrs + real(kind_phys), intent(inout), dimension(:), optional :: ltg1_max, ltg2_max, ltg3_max character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg From 5eb6f69da5a72af5b938234e65639eaa5ec6b3bd Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 24 Apr 2024 17:16:52 +0000 Subject: [PATCH 10/11] Some cleanup, after using Courtney's new scipt --- physics/GWD/drag_suite.F90 | 2 +- physics/GWD/ugwpv1_gsldrag.F90 | 10 ++++------ physics/GWD/ugwpv1_gsldrag_post.F90 | 3 ++- physics/GWD/unified_ugwp.F90 | 6 +++--- physics/MP/Zhao_Carr/zhaocarr_gscond.f | 4 ++-- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/physics/GWD/drag_suite.F90 b/physics/GWD/drag_suite.F90 index 8f292cde7..fcad796a8 100644 --- a/physics/GWD/drag_suite.F90 +++ b/physics/GWD/drag_suite.F90 @@ -362,8 +362,8 @@ subroutine drag_suite_run( & ! added for small-scale orographic wave drag real(kind=kind_phys), dimension(im,km) :: utendwave,vtendwave,thx,thvx real(kind=kind_phys), intent(in) :: br1(:), & + & hpbl(:), & & slmsk(:) - real(kind=kind_phys), intent(in), optional :: hpbl(:) real(kind=kind_phys), dimension(im) :: govrth,xland !real(kind=kind_phys), dimension(im,km) :: dz2 real(kind=kind_phys) :: tauwavex0,tauwavey0, & diff --git a/physics/GWD/ugwpv1_gsldrag.F90 b/physics/GWD/ugwpv1_gsldrag.F90 index 09eda6b1d..290cedd1b 100644 --- a/physics/GWD/ugwpv1_gsldrag.F90 +++ b/physics/GWD/ugwpv1_gsldrag.F90 @@ -82,7 +82,7 @@ subroutine ugwpv1_gsldrag_init ( & integer, intent (in) :: me integer, intent (in) :: master integer, intent (in) :: nlunit - character(len=*), intent (in), optional :: input_nml_file(:) + character(len=*), intent (in) :: input_nml_file(:) integer, intent (in) :: logunit integer, intent (in) :: jdat(:) integer, intent (in) :: lonr @@ -400,7 +400,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, real(kind=kind_phys), intent(in), dimension(:) :: rain real(kind=kind_phys), intent(in), dimension(:) :: br1, slmsk - real(kind=kind_phys), intent(in), dimension(:), optional :: hpbl + real(kind=kind_phys), intent(in), dimension(:) :: hpbl ! ! moved to GFS_phys_time_vary ! real(kind=kind_phys), intent(in), dimension(:) :: ddy_j1tau, ddy_j2tau @@ -423,10 +423,8 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, & dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd - real(kind=kind_phys), intent(out) , dimension(:,:), optional :: dudt_ngw, dvdt_ngw, kdis_ngw - real(kind=kind_phys), intent(out) , dimension(:,:) :: dudt_gw, dvdt_gw, kdis_gw - - real(kind=kind_phys), intent(out) , dimension(:,:) :: dtdt_ngw, dtdt_gw + real(kind=kind_phys), intent(out) , dimension(:,:), optional :: dudt_ngw, dvdt_ngw, kdis_ngw, dtdt_ngw + real(kind=kind_phys), intent(out) , dimension(:,:) :: dudt_gw, dvdt_gw, dtdt_gw, kdis_gw real(kind=kind_phys), intent(out) , dimension(:) :: zogw, zlwb, zobl, zngw ! diff --git a/physics/GWD/ugwpv1_gsldrag_post.F90 b/physics/GWD/ugwpv1_gsldrag_post.F90 index 1d3703001..2b1d3e018 100644 --- a/physics/GWD/ugwpv1_gsldrag_post.F90 +++ b/physics/GWD/ugwpv1_gsldrag_post.F90 @@ -35,7 +35,8 @@ subroutine ugwpv1_gsldrag_post_run ( im, levs, ldiag_ugwp, & logical, intent(in) :: ldiag_ugwp !< flag for CIRES UGWP Diagnostics real(kind=kind_phys), intent(in), dimension(:) :: zobl, zlwb, zogw - real(kind=kind_phys), intent(in), dimension(:) :: du_ofdcol, tau_ogw, du_oblcol, tau_ngw + real(kind=kind_phys), intent(in), dimension(:) :: tau_ogw, tau_ngw + real(kind=kind_phys), intent(in), dimension(:),optional :: du_ofdcol, du_oblcol real(kind=kind_phys), intent(inout), dimension(:) :: tot_mtb, tot_ogw, tot_tofd, tot_ngw real(kind=kind_phys), intent(inout), dimension(:) :: tot_zmtb, tot_zlwb, tot_zogw diff --git a/physics/GWD/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 index 4f880573c..a169fd101 100644 --- a/physics/GWD/unified_ugwp.F90 +++ b/physics/GWD/unified_ugwp.F90 @@ -75,7 +75,7 @@ subroutine unified_ugwp_init (me, master, nlunit, input_nml_file, logunit, & integer, intent (in) :: me integer, intent (in) :: master integer, intent (in) :: nlunit - character(len=*), intent (in), optional :: input_nml_file(:) + character(len=*), intent (in) :: input_nml_file(:) integer, intent (in) :: logunit integer, intent (in) :: jdat(:) integer, intent (in) :: lonr @@ -304,8 +304,8 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt & dtaux2d_ss(:,:),dtauy2d_ss(:,:), & & dtaux2d_fd(:,:),dtauy2d_fd(:,:), & & dudt_ngw(:,:),dvdt_ngw(:,:),dtdt_ngw(:,:) - real(kind=kind_phys), intent(in), optional :: hpbl(:) - real(kind=kind_phys), intent(in) :: br1(:), & + real(kind=kind_phys), intent(in) :: hpbl(:), & + & br1(:), & & slmsk(:) real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg diff --git a/physics/MP/Zhao_Carr/zhaocarr_gscond.f b/physics/MP/Zhao_Carr/zhaocarr_gscond.f index 65091f59f..2f70aa2f0 100644 --- a/physics/MP/Zhao_Carr/zhaocarr_gscond.f +++ b/physics/MP/Zhao_Carr/zhaocarr_gscond.f @@ -100,10 +100,10 @@ subroutine zhaocarr_gscond_run (im,km,dt,dtf,prsl,ps,q,clw1 & integer, intent(in) :: im, km, ipr real(kind=kind_phys), intent(in) :: dt, dtf real(kind=kind_phys), intent(in) :: prsl(:,:), ps(:) - real(kind=kind_phys), intent(inout) :: q(:,:) + real(kind=kind_phys), intent(inout) :: q(:,:), t(:,:) real(kind=kind_phys), intent(in) :: clw1(:,:), clw2(:,:) real(kind=kind_phys), intent(out) :: cwm(:,:) - real(kind=kind_phys), intent(inout), optional :: t(:,:) & + real(kind=kind_phys), intent(inout), optional :: & &, tp(:,:), qp(:,:), psp(:) & &, tp1(:,:), qp1(:,:), psp1(:) real(kind=kind_phys), intent(in) :: u(:,:) From 0df24f89b11720fabd6238279fd55de843e9afb1 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 24 Apr 2024 17:28:32 +0000 Subject: [PATCH 11/11] Omission from previous commit --- physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 index 81d77588b..19d49427a 100644 --- a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 +++ b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 @@ -248,11 +248,10 @@ SUBROUTINE mynnedmf_wrapper_run( & real(kind_phys), dimension(:,:), intent(inout), optional :: & & dqdt_cloud_droplet_num_conc, dqdt_water_aer_num_conc, & & dqdt_ice_aer_num_conc - real(kind_phys), dimension(:,:), intent(inout) ::dqdt_cccn real(kind_phys), dimension(:,:), intent(inout), optional :: qke, & - & EL_PBL, Sh3D, Sm3D - real(kind_phys), dimension(:,:), intent(inout), optional :: & - & qke_adv, qc_bl, qi_bl, cldfra_bl + & EL_PBL, Sh3D, Sm3D, qc_bl, qi_bl, cldfra_bl, dqdt_cccn + real(kind_phys), dimension(:,:), intent(inout) :: & + & qke_adv !These 10 arrays are only allocated when bl_mynn_output > 0 real(kind_phys), dimension(:,:), intent(inout), optional :: & & edmf_a,edmf_w,edmf_qt, & @@ -262,11 +261,11 @@ SUBROUTINE mynnedmf_wrapper_run( & & t3d,qgrs_water_vapor,qgrs_liquid_cloud,qgrs_ice, & & qgrs_snow real(kind_phys), dimension(:,:), intent(in) :: & + & qgrs_cloud_ice_num_conc, & & u,v,omega, & & exner,prsl,prsi, & & qgrs_ozone real(kind_phys), dimension(:,:), intent(in), optional :: & - & qgrs_cloud_ice_num_conc, & & qgrs_water_aer_num_conc, & & qgrs_cloud_droplet_num_conc, & & qgrs_ice_aer_num_conc