From 1c6c1d831a1a1e65a70ec0bf6bb5a411f543afa8 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Thu, 24 Mar 2022 14:45:19 +0000 Subject: [PATCH 001/249] Resolve argument mismatch errors when using gfortran Switch from 'use mpi' to 'use mpi_f08' --- physics/GFS_debug.F90 | 4 +- physics/aerinterp.F90 | 33 ++++--------- physics/cires_tauamf_data.F90 | 9 +--- physics/h2ointerp.f90 | 10 +--- physics/iccninterp.F90 | 47 ++++++++---------- physics/module_mp_thompson.F90 | 9 ++-- physics/mp_fer_hires.meta | 2 +- physics/mp_thompson.F90 | 5 +- physics/mp_thompson.meta | 4 +- physics/mp_thompson_post.F90 | 3 +- physics/mp_thompson_post.meta | 2 +- physics/ozinterp.f90 | 10 +--- physics/rrtmgp_lw_cloud_optics.F90 | 5 +- physics/rrtmgp_lw_cloud_optics.meta | 2 +- physics/rrtmgp_lw_gas_optics.F90 | 5 +- physics/rrtmgp_lw_gas_optics.meta | 2 +- physics/rrtmgp_sw_cloud_optics.F90 | 5 +- physics/rrtmgp_sw_cloud_optics.meta | 2 +- physics/rrtmgp_sw_gas_optics.F90 | 5 +- physics/rrtmgp_sw_gas_optics.meta | 2 +- physics/sfcsub.F | 74 ++++------------------------- 21 files changed, 74 insertions(+), 166 deletions(-) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index f01f25cbc..0b74bf851 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -388,7 +388,7 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, nthreads, blkno, errmsg, errflg) #ifdef MPI - use mpi + use mpi_f08 #endif #ifdef _OPENMP use omp_lib @@ -1041,7 +1041,7 @@ subroutine GFS_interstitialtoscreen_run (Model, Statein, Stateout, Sfcprop, Coup nthreads, blkno, errmsg, errflg) #ifdef MPI - use mpi + use mpi_f08 #endif #ifdef _OPENMP use omp_lib diff --git a/physics/aerinterp.F90 b/physics/aerinterp.F90 index 30ff97dff..b4673a7bd 100644 --- a/physics/aerinterp.F90 +++ b/physics/aerinterp.F90 @@ -112,8 +112,6 @@ SUBROUTINE read_aerdataf ( me, master, iflip, idate, FHOUR, errmsg, errflg) integer IDAT(8),JDAT(8) real(kind=kind_phys) RINC(5), rjday integer jdow, jdoy, jday - real(4) rinc4(5) - integer w3kindreal,w3kindint integer, allocatable :: invardims(:) ! @@ -131,13 +129,7 @@ SUBROUTINE read_aerdataf ( me, master, iflip, idate, FHOUR, errmsg, errflg) IDAT(5) = IDATE(1) RINC = 0. RINC(2) = FHOUR - call w3kind(w3kindreal,w3kindint) - if(w3kindreal == 4) then - rinc4 = rinc - CALL W3MOVDAT(RINC4,IDAT,JDAT) - else - CALL W3MOVDAT(RINC,IDAT,JDAT) - endif + CALL W3MOVDAT(RINC,IDAT,JDAT) ! jdow = 0 jdoy = 0 @@ -246,8 +238,6 @@ SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, real(kind=kind_phys) prsl(npts,lev), aerpres(npts,levsaer) real(kind=kind_phys) RINC(5), rjday integer jdow, jdoy, jday - real(4) rinc4(5) - integer w3kindreal,w3kindint ! IDAT = 0 @@ -257,13 +247,7 @@ SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, IDAT(5) = IDATE(1) RINC = 0. RINC(2) = FHOUR - call w3kind(w3kindreal,w3kindint) - if(w3kindreal == 4) then - rinc4 = rinc - CALL W3MOVDAT(RINC4,IDAT,JDAT) - else - CALL W3MOVDAT(RINC,IDAT,JDAT) - endif + CALL W3MOVDAT(RINC,IDAT,JDAT) ! jdow = 0 jdoy = 0 @@ -393,6 +377,7 @@ subroutine read_netfaer(nf, iflip,nt) use aerclm_def use netcdf integer, intent(in) :: iflip, nf, nt + integer :: ncerr integer :: ncid, varid, i,j,k,ii,klev character :: fname*50, mn*2, vname*10 real(kind=kind_io4),allocatable,dimension(:,:,:) :: buff @@ -406,11 +391,11 @@ subroutine read_netfaer(nf, iflip,nt) write(mn,'(i2.2)') nf fname=trim("aeroclim.m"//mn//".nc") - call nf_open(fname , nf90_NOWRITE, ncid) + ncerr = nf90_open(fname , NF90_NOWRITE, ncid) ! ====> construct 3-d pressure array (Pa) - call nf_inq_varid(ncid, "DELP", varid) - call nf_get_var(ncid, varid, buff) + ncerr = nf90_inq_varid(ncid, "DELP", varid) + ncerr = nf90_get_var(ncid, varid, buff) do j = jamin, jamax do i = iamin, iamax @@ -439,8 +424,8 @@ subroutine read_netfaer(nf, iflip,nt) ! for GFS, iflip 0: toa to sfc; 1: sfc to toa DO ii = 1, ntrcaerm vname=trim(specname(ii)) - call nf_inq_varid(ncid, vname, varid) - call nf_get_var(ncid, varid, buffx) + ncerr = nf90_inq_varid(ncid, vname, varid) + ncerr = nf90_get_var(ncid, varid, buffx) do j = jamin, jamax do k = 1, levsaer @@ -462,7 +447,7 @@ subroutine read_netfaer(nf, iflip,nt) ENDDO ! ii-loop (ntracaerm) ! close the file - call nf_close(ncid) + ncerr = nf90_close(ncid) deallocate (buff, pres_tmp) deallocate (buffx) return diff --git a/physics/cires_tauamf_data.F90 b/physics/cires_tauamf_data.F90 index e0d43e74e..52bfb67bd 100644 --- a/physics/cires_tauamf_data.F90 +++ b/physics/cires_tauamf_data.F90 @@ -179,7 +179,6 @@ subroutine gfs_idate_calendar(idate, fhour, ddd, fddd) real(kind=kind_phys) :: rinc(5), rjday integer :: jdow, jdoy, jday real(4) :: rinc4(5) - integer :: w3kindreal, w3kindint integer :: iw3jdn integer :: jd1, jddd @@ -195,13 +194,7 @@ subroutine gfs_idate_calendar(idate, fhour, ddd, fddd) rinc(1:5) = 0. rinc(2) = fhour ! - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4 = rinc - call w3movdat(rinc4, idat,jdat) - else - call w3movdat(rinc, idat,jdat) - endif + call w3movdat(rinc, idat,jdat) ! jdate(8)- date and time (yr, mo, day, [tz], hr, min, sec) jdow = 0 jdoy = 0 diff --git a/physics/h2ointerp.f90 b/physics/h2ointerp.f90 index f26ae6c0c..de5eb855d 100644 --- a/physics/h2ointerp.f90 +++ b/physics/h2ointerp.f90 @@ -146,8 +146,6 @@ subroutine h2ointerpol(me,npts,idate,fhour,jindx1,jindx2,h2oplout,ddy) real(kind=kind_phys) h2oplout(npts,levh2o,h2o_coeff) real(kind=kind_phys) rinc(5), rjday integer jdow, jdoy, jday - real(4) rinc4(5) - integer w3kindreal, w3kindint ! idat = 0 idat(1) = idate(4) @@ -156,13 +154,7 @@ subroutine h2ointerpol(me,npts,idate,fhour,jindx1,jindx2,h2oplout,ddy) idat(5) = idate(1) rinc = 0. rinc(2) = fhour - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4 = rinc - CALL W3MOVDAT(RINC4,IDAT,JDAT) - else - CALL W3MOVDAT(RINC,IDAT,JDAT) - endif + CALL W3MOVDAT(RINC,IDAT,JDAT) ! jdow = 0 jdoy = 0 diff --git a/physics/iccninterp.F90 b/physics/iccninterp.F90 index a3a08dee8..37e0bfb00 100644 --- a/physics/iccninterp.F90 +++ b/physics/iccninterp.F90 @@ -23,6 +23,7 @@ SUBROUTINE read_cidata (me, master) integer, intent(in) :: me integer, intent(in) :: master !--- locals + integer :: ncerr integer :: i, n, k, ncid, varid,j,it real(kind=kind_phys), allocatable, dimension(:) :: hyam,hybm real(kind=4), allocatable, dimension(:,:,:) :: ci_ps @@ -31,29 +32,29 @@ SUBROUTINE read_cidata (me, master) allocate (ciplin(lonscip,latscip,kcipl,timeci)) allocate (ccnin(lonscip,latscip,kcipl,timeci)) allocate (ci_pres(lonscip,latscip,kcipl,timeci)) - call nf_open("cam5_4_143_NAAI_monclimo2.nc", NF90_NOWRITE, ncid) - call nf_inq_varid(ncid, "lat", varid) - call nf_get_var(ncid, varid, ci_lat) - call nf_inq_varid(ncid, "lon", varid) - call nf_get_var(ncid, varid, ci_lon) - call nf_inq_varid(ncid, "PS", varid) - call nf_get_var(ncid, varid, ci_ps) - call nf_inq_varid(ncid, "hyam", varid) - call nf_get_var(ncid, varid, hyam) - call nf_inq_varid(ncid, "hybm", varid) - call nf_get_var(ncid, varid, hybm) - call nf_inq_varid(ncid, "NAAI", varid) - call nf_get_var(ncid, varid, ciplin) + ncerr = nf90_open("cam5_4_143_NAAI_monclimo2.nc", NF90_NOWRITE, ncid) + ncerr = nf90_inq_varid(ncid, "lat", varid) + ncerr = nf90_get_var(ncid, varid, ci_lat) + ncerr = nf90_inq_varid(ncid, "lon", varid) + ncerr = nf90_get_var(ncid, varid, ci_lon) + ncerr = nf90_inq_varid(ncid, "PS", varid) + ncerr = nf90_get_var(ncid, varid, ci_ps) + ncerr = nf90_inq_varid(ncid, "hyam", varid) + ncerr = nf90_get_var(ncid, varid, hyam) + ncerr = nf90_inq_varid(ncid, "hybm", varid) + ncerr = nf90_get_var(ncid, varid, hybm) + ncerr = nf90_inq_varid(ncid, "NAAI", varid) + ncerr = nf90_get_var(ncid, varid, ciplin) do it = 1,timeci do k=1, kcipl ci_pres(:,:,k,it)=hyam(k)*1.e5+hybm(k)*ci_ps(:,:,it) end do end do - call nf_close(ncid) - call nf_open("cam5_4_143_NPCCN_monclimo2.nc", NF90_NOWRITE, ncid) - call nf_inq_varid(ncid, "NPCCN", varid) - call nf_get_var(ncid, varid, ccnin) - call nf_close(ncid) + ncerr = nf90_close(ncid) + ncerr = nf90_open("cam5_4_143_NPCCN_monclimo2.nc", NF90_NOWRITE, ncid) + ncerr = nf90_inq_varid(ncid, "NPCCN", varid) + ncerr = nf90_get_var(ncid, varid, ccnin) + ncerr = nf90_close(ncid) !--- deallocate (hyam, hybm, ci_ps) if (me == master) then @@ -145,8 +146,6 @@ SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, & real(kind=kind_phys) cipres(npts,kcipl), prsl(npts,lev) real(kind=kind_phys) RINC(5), rjday integer jdow, jdoy, jday - real(4) rinc4(5) - integer w3kindreal,w3kindint ! IDAT=0 IDAT(1)=IDATE(4) @@ -155,13 +154,7 @@ SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, & IDAT(5)=IDATE(1) RINC=0. RINC(2)=FHOUR - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4=rinc - CALL W3MOVDAT(RINC4,IDAT,JDAT) - else - CALL W3MOVDAT(RINC,IDAT,JDAT) - endif + CALL W3MOVDAT(RINC,IDAT,JDAT) ! jdow = 0 jdoy = 0 diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index c23b6d1d8..75f199305 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -64,7 +64,7 @@ MODULE module_mp_thompson USE module_mp_radar #ifdef MPI - use mpi + use mpi_f08 #endif IMPLICIT NONE @@ -419,7 +419,7 @@ MODULE module_mp_thompson REAL:: t1_qs_me, t2_qs_me, t1_qg_me, t2_qg_me !..MPI communicator - INTEGER:: mpi_communicator + TYPE(MPI_Comm):: mpi_communicator !..Write tables with master MPI task after computing them in thompson_init LOGICAL:: thompson_table_writer @@ -444,7 +444,8 @@ SUBROUTINE thompson_init(is_aerosol_aware_in, & IMPLICIT NONE LOGICAL, INTENT(IN) :: is_aerosol_aware_in - INTEGER, INTENT(IN) :: mpicomm, mpirank, mpiroot + TYPE(MPI_Comm), INTENT(IN) :: mpicomm + INTEGER, INTENT(IN) :: mpirank, mpiroot INTEGER, INTENT(IN) :: threads CHARACTER(len=*), INTENT(INOUT) :: errmsg INTEGER, INTENT(INOUT) :: errflg @@ -1810,7 +1811,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & qgten1, qiten1, niten1, nrten1, ncten1, qcten1) #ifdef MPI - use mpi + use mpi_f08 #endif implicit none diff --git a/physics/mp_fer_hires.meta b/physics/mp_fer_hires.meta index 9f7c63d4d..058154856 100644 --- a/physics/mp_fer_hires.meta +++ b/physics/mp_fer_hires.meta @@ -55,7 +55,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [mpirank] standard_name = mpi_rank diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index 7c76ea933..eb6166b3d 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -6,6 +6,7 @@ !! This module contains the aerosol-aware Thompson microphysics scheme. module mp_thompson + use mpi_f08 use machine, only : kind_phys use module_mp_thompson, only : thompson_init, mp_gt_driver, thompson_finalize, calc_effectRad @@ -72,7 +73,7 @@ subroutine mp_thompson_init(ncol, nlev, con_g, con_rd, con_eps, & real(kind_phys), intent(in ) :: phil(:,:) real(kind_phys), intent(in ) :: area(:) ! MPI information - integer, intent(in ) :: mpicomm + type(MPI_Comm), intent(in ) :: mpicomm integer, intent(in ) :: mpirank integer, intent(in ) :: mpiroot ! Threading/blocking information @@ -362,7 +363,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & integer, intent(in) :: decfl ! MPI and block information integer, intent(in) :: blkno - integer, intent(in) :: mpicomm + type(MPI_Comm), intent(in) :: mpicomm integer, intent(in) :: mpirank integer, intent(in) :: mpiroot ! Extended diagnostic output diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta index a3bc20615..c728cd14a 100644 --- a/physics/mp_thompson.meta +++ b/physics/mp_thompson.meta @@ -221,7 +221,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [mpirank] standard_name = mpi_rank @@ -593,7 +593,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [mpirank] standard_name = mpi_rank diff --git a/physics/mp_thompson_post.F90 b/physics/mp_thompson_post.F90 index c53f61b0c..9ab841928 100644 --- a/physics/mp_thompson_post.F90 +++ b/physics/mp_thompson_post.F90 @@ -1,5 +1,6 @@ module mp_thompson_post + use mpi_f08 use machine, only : kind_phys implicit none @@ -66,7 +67,7 @@ subroutine mp_thompson_post_run(ncol, nlev, tgrs_save, tgrs, prslk, dtp, ttendli real(kind_phys), intent(in) :: ttendlim integer, intent(in) :: kdt ! MPI information - integer, intent(in ) :: mpicomm + type(MPI_Comm), intent(in ) :: mpicomm integer, intent(in ) :: mpirank integer, intent(in ) :: mpiroot ! CCPP error handling diff --git a/physics/mp_thompson_post.meta b/physics/mp_thompson_post.meta index 82b035e99..7b843000e 100644 --- a/physics/mp_thompson_post.meta +++ b/physics/mp_thompson_post.meta @@ -101,7 +101,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [mpirank] standard_name = mpi_rank diff --git a/physics/ozinterp.f90 b/physics/ozinterp.f90 index 6fe86c8e1..2f0a28128 100644 --- a/physics/ozinterp.f90 +++ b/physics/ozinterp.f90 @@ -149,8 +149,6 @@ SUBROUTINE ozinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ozplout,ddy) real(kind=kind_phys) ozplout(npts,levozp,oz_coeff) real(kind=kind_phys) RINC(5), rjday integer jdow, jdoy, jday - real(4) rinc4(5) - integer w3kindreal,w3kindint ! IDAT=0 IDAT(1)=IDATE(4) @@ -159,13 +157,7 @@ SUBROUTINE ozinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ozplout,ddy) IDAT(5)=IDATE(1) RINC=0. RINC(2)=FHOUR - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4=rinc - CALL W3MOVDAT(RINC4,IDAT,JDAT) - else - CALL W3MOVDAT(RINC,IDAT,JDAT) - endif + CALL W3MOVDAT(RINC,IDAT,JDAT) ! jdow = 0 jdoy = 0 diff --git a/physics/rrtmgp_lw_cloud_optics.F90 b/physics/rrtmgp_lw_cloud_optics.F90 index 5ddcec078..28f1f5fb4 100644 --- a/physics/rrtmgp_lw_cloud_optics.F90 +++ b/physics/rrtmgp_lw_cloud_optics.F90 @@ -8,7 +8,7 @@ module rrtmgp_lw_cloud_optics use radiation_tools, only: check_error_msg use netcdf #ifdef MPI - use mpi + use mpi_f08 #endif implicit none @@ -81,8 +81,9 @@ subroutine rrtmgp_lw_cloud_optics_init(nrghice, mpicomm, mpirank, mpiroot, doGP_cldoptics_LUT ! Use RRTMGP cloud-optics: LUTs? integer, intent(inout) :: & nrghice ! Number of ice-roughness categories + type(MPI_Comm), intent(in) :: & + mpicomm ! MPI communicator integer, intent(in) :: & - mpicomm, & ! MPI communicator mpirank, & ! Current MPI rank mpiroot ! Master MPI rank character(len=128),intent(in) :: & diff --git a/physics/rrtmgp_lw_cloud_optics.meta b/physics/rrtmgp_lw_cloud_optics.meta index 35e27979e..3d34884cb 100644 --- a/physics/rrtmgp_lw_cloud_optics.meta +++ b/physics/rrtmgp_lw_cloud_optics.meta @@ -70,7 +70,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [errmsg] standard_name = ccpp_error_message diff --git a/physics/rrtmgp_lw_gas_optics.F90 b/physics/rrtmgp_lw_gas_optics.F90 index 67a888911..af47d86ab 100644 --- a/physics/rrtmgp_lw_gas_optics.F90 +++ b/physics/rrtmgp_lw_gas_optics.F90 @@ -8,7 +8,7 @@ module rrtmgp_lw_gas_optics use radiation_tools, only: check_error_msg use netcdf #ifdef MPI - use mpi + use mpi_f08 #endif implicit none @@ -82,8 +82,9 @@ subroutine rrtmgp_lw_gas_optics_init(rrtmgp_root_dir, rrtmgp_lw_file_gas, mpicom character(len=128),intent(in) :: & rrtmgp_root_dir, & ! RTE-RRTMGP root directory rrtmgp_lw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties + type(MPI_Comm),intent(in) :: & + mpicomm ! MPI communicator integer,intent(in) :: & - mpicomm, & ! MPI communicator mpirank, & ! Current MPI rank mpiroot ! Master MPI rank diff --git a/physics/rrtmgp_lw_gas_optics.meta b/physics/rrtmgp_lw_gas_optics.meta index 0b484b6ac..37b44f502 100644 --- a/physics/rrtmgp_lw_gas_optics.meta +++ b/physics/rrtmgp_lw_gas_optics.meta @@ -42,7 +42,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [minGPpres] standard_name = minimum_pressure_in_RRTMGP diff --git a/physics/rrtmgp_sw_cloud_optics.F90 b/physics/rrtmgp_sw_cloud_optics.F90 index f80440522..2a175a0e6 100644 --- a/physics/rrtmgp_sw_cloud_optics.F90 +++ b/physics/rrtmgp_sw_cloud_optics.F90 @@ -8,7 +8,7 @@ module rrtmgp_sw_cloud_optics use radiation_tools, only: check_error_msg use netcdf #ifdef MPI - use mpi + use mpi_f08 #endif implicit none @@ -81,8 +81,9 @@ subroutine rrtmgp_sw_cloud_optics_init(doG_cldoptics, doGP_cldoptics_PADE, doGP_cldoptics_LUT ! Use RRTMGP cloud-optics: LUTs? integer, intent(inout) :: & nrghice ! Number of ice-roughness categories + type(MPI_Comm), intent(in) :: & + mpicomm ! MPI communicator integer, intent(in) :: & - mpicomm, & ! MPI communicator mpirank, & ! Current MPI rank mpiroot ! Master MPI rank character(len=128),intent(in) :: & diff --git a/physics/rrtmgp_sw_cloud_optics.meta b/physics/rrtmgp_sw_cloud_optics.meta index d73258cb2..f852cf7cb 100644 --- a/physics/rrtmgp_sw_cloud_optics.meta +++ b/physics/rrtmgp_sw_cloud_optics.meta @@ -70,7 +70,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [errmsg] standard_name = ccpp_error_message diff --git a/physics/rrtmgp_sw_gas_optics.F90 b/physics/rrtmgp_sw_gas_optics.F90 index 260f65fe7..9f2078a51 100644 --- a/physics/rrtmgp_sw_gas_optics.F90 +++ b/physics/rrtmgp_sw_gas_optics.F90 @@ -7,7 +7,7 @@ module rrtmgp_sw_gas_optics use mo_optical_props, only: ty_optical_props_2str use netcdf #ifdef MPI - use mpi + use mpi_f08 #endif implicit none @@ -86,8 +86,9 @@ subroutine rrtmgp_sw_gas_optics_init(rrtmgp_root_dir, rrtmgp_sw_file_gas, character(len=128),intent(in) :: & rrtmgp_root_dir, & ! RTE-RRTMGP root directory rrtmgp_sw_file_gas ! RRTMGP file containing coefficients used to compute gaseous optical properties + type(MPI_Comm),intent(in) :: & + mpicomm ! MPI communicator integer,intent(in) :: & - mpicomm, & ! MPI communicator mpirank, & ! Current MPI rank mpiroot ! Master MPI rank character(len=*), dimension(:), intent(in) :: & diff --git a/physics/rrtmgp_sw_gas_optics.meta b/physics/rrtmgp_sw_gas_optics.meta index 1fdbc946b..8a018172d 100644 --- a/physics/rrtmgp_sw_gas_optics.meta +++ b/physics/rrtmgp_sw_gas_optics.meta @@ -50,7 +50,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [errmsg] standard_name = ccpp_error_message diff --git a/physics/sfcsub.F b/physics/sfcsub.F index e8b61f083..321e87a98 100644 --- a/physics/sfcsub.F +++ b/physics/sfcsub.F @@ -2740,7 +2740,7 @@ subroutine fixrdg(lugb,idim,jdim,fngrib, & use sfccyc_module, only : mdata implicit none integer lgrib,n,lskip,jret,j,ndata,lugi,jdim,idim,lugb, - & iret, me,kpds5,kdata,i,w3kindreal,w3kindint + & iret, me,kpds5,kdata,i ! character*(*) fngrib ! @@ -2748,7 +2748,6 @@ subroutine fixrdg(lugb,idim,jdim,fngrib, & logical gaus real (kind=kind_io8) blno,blto real (kind=kind_io8), allocatable :: data8(:) - real (kind=kind_io4), allocatable :: data4(:) ! logical*1, allocatable :: lbms(:) ! @@ -2807,20 +2806,8 @@ subroutine fixrdg(lugb,idim,jdim,fngrib, & jpds = kpds0 lskip = -1 kdata=idim*jdim - call w3kind(w3kindreal,w3kindint) - if (w3kindreal == 8) then call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip, & kpds,kgds,lbms,data8,jret) - else if (w3kindreal == 4) then - allocate(data4(1:idim*jdim)) - call getgb(lugb,lugi,kdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data4,jret) - data8 = real(data4, kind=kind_io8) - deallocate(data4) - else - write(0,*)' FATAL ERROR: Invalid w3kindreal' - call abort - endif ! if(jret == 0) then if(ndata.eq.0) then @@ -7041,8 +7028,6 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, & & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/ ! real (kind=kind_io8) fha(5) - real(4) fha4(5) - integer w3kindreal,w3kindint integer ida(8),jda(8),ivtyp, kpd7 ! real (kind=kind_io8), allocatable :: tsf(:,:),sno(:,:), @@ -7134,13 +7119,7 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, & ida(2) = im ida(3) = id ida(5) = ih - call w3kind(w3kindreal,w3kindint) - if(w3kindreal == 4) then - fha4 = fha - call w3movdat(fha4,ida,jda) - else - call w3movdat(fha,ida,jda) - endif + call w3movdat(fha,ida,jda) jy = jda(1) jm = jda(2) jd = jda(3) @@ -7210,13 +7189,7 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, & ida(2) = im ida(3) = id ida(5) = ih - call w3kind(w3kindreal,w3kindint) - if(w3kindreal == 4) then - fha4 = fha - call w3movdat(fha4,ida,jda) - else - call w3movdat(fha,ida,jda) - endif + call w3movdat(fha,ida,jda) jy = jda(1) jm = jda(2) jd = jda(3) @@ -8310,7 +8283,7 @@ subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, & implicit none integer imax,jmax,ijmax,i,j,n,jret,inttyp,iret,imsk, & & jmsk,len,lugb,kpds5,mon,lskip,lgrib,ndata,lugi,me,kmami & - &, jj,w3kindreal,w3kindint + &, jj real (kind=kind_io8) wlon,elon,rnlat,dlat,dlon,rslat,blno,blto ! ! @@ -8322,7 +8295,6 @@ subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, & real (kind=kind_io8) gdata(len), slmask(len) real (kind=kind_io8), allocatable :: data(:,:), rslmsk(:,:) real (kind=kind_io8), allocatable :: data8(:) - real (kind=kind_io4), allocatable :: data4(:) real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) ! logical lmask, yr2kc, gaus, ijordr @@ -8390,17 +8362,8 @@ subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, & jpds = kpds0 jpds(9) = mon if(jpds(9).eq.13) jpds(9) = 1 - call w3kind(w3kindreal,w3kindint) - if (w3kindreal==8) then - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data8,jret) - else if (w3kindreal==4) then - allocate(data4(1:mdata)) - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data4,jret) - data8 = real(data4, kind=kind_io8) - deallocate(data4) - endif + call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data8,jret) if (me .eq. 0) write(6,*) ' input grib file dates=', & (kpds(i),i=8,11) if(jret.eq.0) then @@ -8485,7 +8448,7 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, & integer nrepmx,nvalid,imo,iyr,idy,jret,ihr,nrept,lskip,lugi, & & lgrib,j,ndata,i,inttyp,jmax,imax,ijmax,ij,jday,len,iret, & & jmsk,imsk,ih,kpds5,lugb,iy,id,im,jh,jd,jdoy,jdow,jm,me, & - & monend,jy,iy4,kmami,iret2,jj,w3kindreal,w3kindint + & monend,jy,iy4,kmami,iret2,jj real (kind=kind_io8) rnlat,rslat,wlon,elon,dlon,dlat,fh,blno, & & rjday,blto ! @@ -8507,7 +8470,6 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, & real (kind=kind_io8) gdata(len), slmask(len) real (kind=kind_io8), allocatable :: data(:,:),rslmsk(:,:) real (kind=kind_io8), allocatable :: data8(:) - real (kind=kind_io4), allocatable :: data4(:) real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) ! logical lmask, yr2kc, gaus, ijordr @@ -8529,7 +8491,6 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, & data mjday/31,28,31,30,31,30,31,31,30,31,30,31/ ! real (kind=kind_io8) fha(5) - real(4) fha4(5) integer ida(8),jda(8) ! allocate(data8(1:mdata)) @@ -8548,13 +8509,7 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, & ida(2)=im ida(3)=id ida(5)=ih - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - fha4=fha - call w3movdat(fha4,ida,jda) - else - call w3movdat(fha,ida,jda) - endif + call w3movdat(fha,ida,jda) jy=jda(1) jm=jda(2) jd=jda(3) @@ -8637,17 +8592,8 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, & jpds(10)=idy ! jpds(11)=ihr jpds(21)=(iyr-1)/100+1 - call w3kind(w3kindreal,w3kindint) - if (w3kindreal == 8) then - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data8,jret) - elseif (w3kindreal == 4) then - allocate (data4(1:mdata)) - call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, - & kpds,kgds,lbms,data4,jret) - data8 = real(data4, kind=kind_io8) - deallocate(data4) - endif + call getgb(lugb,lugi,mdata,lskip,jpds,jgds,ndata,lskip, + & kpds,kgds,lbms,data8,jret) if (me .eq. 0) write(6,*) ' input grib file dates=', & (kpds(i),i=8,11) if(jret.eq.0) then From 16ef7f241efb568da6b860e27a7aac3e9b423036 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Tue, 19 Jul 2022 21:14:44 +0000 Subject: [PATCH 002/249] Declare variables passed to w3nco library as double precission --- physics/aerinterp.F90 | 7 ++++--- physics/h2ointerp.f90 | 3 ++- physics/iccninterp.F90 | 3 ++- physics/ozinterp.f90 | 3 ++- physics/sfcsub.F | 12 ++++++------ 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/physics/aerinterp.F90 b/physics/aerinterp.F90 index 90765e4d5..790aa0096 100644 --- a/physics/aerinterp.F90 +++ b/physics/aerinterp.F90 @@ -98,7 +98,7 @@ END SUBROUTINE read_aerdata ! !********************************************************************** SUBROUTINE read_aerdataf ( me, master, iflip, idate, FHOUR, errmsg, errflg) - use machine, only: kind_phys, kind_io4, kind_io8 + use machine, only: kind_phys, kind_dbl_prec use aerclm_def !--- in/out @@ -111,7 +111,7 @@ SUBROUTINE read_aerdataf ( me, master, iflip, idate, FHOUR, errmsg, errflg) logical :: file_exist integer IDAT(8),JDAT(8) real(kind=kind_phys) rjday - real(8) RINC(5) + real(kind=kind_dbl_prec) rinc(5) integer jdow, jdoy, jday integer, allocatable :: invardims(:) @@ -218,7 +218,7 @@ END SUBROUTINE setindxaer SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, & ddy,iindx1,iindx2,ddx,lev,prsl,aerout) ! - use machine, only: kind_phys, kind_io4, kind_io8 + use machine, only: kind_phys, kind_dbl_prec use aerclm_def implicit none @@ -238,6 +238,7 @@ SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, real(kind=kind_phys) aerpm(npts,levsaer,ntrcaer) real(kind=kind_phys) prsl(npts,lev), aerpres(npts,levsaer) real(kind=kind_phys) rjday + real(kind=kind_dbl_prec) rinc(5) integer jdow, jdoy, jday ! IDAT = 0 diff --git a/physics/h2ointerp.f90 b/physics/h2ointerp.f90 index 2d16decc0..f5a1f36c6 100644 --- a/physics/h2ointerp.f90 +++ b/physics/h2ointerp.f90 @@ -131,7 +131,7 @@ subroutine h2ointerpol(me,npts,idate,fhour,jindx1,jindx2,h2oplout,ddy) ! ! May 2015 Shrinivas Moorthi - Prepare for H2O interpolation ! - use machine , only : kind_phys + use machine , only : kind_phys, kind_dbl_prec use h2o_def implicit none integer j,j1,j2,l,npts,nc,n1,n2 @@ -145,6 +145,7 @@ subroutine h2ointerpol(me,npts,idate,fhour,jindx1,jindx2,h2oplout,ddy) real(kind=kind_phys) ddy(npts) real(kind=kind_phys) h2oplout(npts,levh2o,h2o_coeff) real(kind=kind_phys) rjday + real(kind=kind_dbl_prec) rinc(5) integer jdow, jdoy, jday ! idat = 0 diff --git a/physics/iccninterp.F90 b/physics/iccninterp.F90 index 1d613c53c..dd752d9b8 100644 --- a/physics/iccninterp.F90 +++ b/physics/iccninterp.F90 @@ -129,7 +129,7 @@ END SUBROUTINE setindxci SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, & iindx1,iindx2,ddx,lev, prsl, ciplout,ccnout) ! - USE MACHINE, ONLY : kind_phys + USE MACHINE, ONLY : kind_phys, kind_dbl_prec use iccn_def implicit none integer i1,i2, iday,j,j1,j2,l,npts,nc,n1,n2,lev,k,i @@ -145,6 +145,7 @@ SUBROUTINE ciinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ddy, & real(kind=kind_phys) ccnout(npts,lev),ccnpm(npts,kcipl) real(kind=kind_phys) cipres(npts,kcipl), prsl(npts,lev) real(kind=kind_phys) rjday + real(kind=kind_dbl_prec) rinc(5) integer jdow, jdoy, jday ! IDAT=0 diff --git a/physics/ozinterp.f90 b/physics/ozinterp.f90 index f92140eb1..e26d5a56e 100644 --- a/physics/ozinterp.f90 +++ b/physics/ozinterp.f90 @@ -135,7 +135,7 @@ END SUBROUTINE setindxoz ! SUBROUTINE ozinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ozplout,ddy) ! - USE MACHINE, ONLY : kind_phys + USE MACHINE, ONLY : kind_phys, kind_dbl_prec USE OZNE_DEF implicit none integer iday,j,j1,j2,l,npts,nc,n1,n2 @@ -148,6 +148,7 @@ SUBROUTINE ozinterpol(me,npts,IDATE,FHOUR,jindx1,jindx2,ozplout,ddy) real(kind=kind_phys) DDY(npts) real(kind=kind_phys) ozplout(npts,levozp,oz_coeff) real(kind=kind_phys) rjday + real(kind=kind_dbl_prec) rinc(5) integer jdow, jdoy, jday ! IDAT=0 diff --git a/physics/sfcsub.F b/physics/sfcsub.F index d5a1d997d..4c7168b90 100644 --- a/physics/sfcsub.F +++ b/physics/sfcsub.F @@ -2747,7 +2747,7 @@ subroutine fixrdg(lugb,idim,jdim,fngrib, & real (kind=kind_io8) gdata(idim*jdim) logical gaus real (kind=kind_io8) blno,blto - real (kind=kind_io8), allocatable :: data8(:) + real (kind=kind_dbl_prec), allocatable :: data8(:) ! logical*1, allocatable :: lbms(:) ! @@ -6969,7 +6969,7 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, & &, gaus, blno, blto, me,lprnt,iprnt, fnalbc2, ialb & &, tile_num_ch, i_index, j_index) ! - use machine , only : kind_io8,kind_io4 + use machine , only : kind_io8,kind_io4, kind_dbl_prec implicit none character(len=*), intent(in) :: tile_num_ch integer, intent(in) :: i_index(len), j_index(len) @@ -7029,7 +7029,7 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, & data dayhf/ 15.5, 45.0, 74.5,105.0,135.5,166.0, & 196.5,227.5,258.0,288.5,319.0,349.5,380.5/ ! - real (kind=kind_io8) fha(5) + real (kind=kind_dbl_prec) fha(5) integer ida(8),jda(8),ivtyp, kpd7 ! real (kind=kind_io8), allocatable :: tsf(:,:),sno(:,:), @@ -8296,7 +8296,7 @@ subroutine fixrdc(lugb,fngrib,kpds5,kpds7,mon,slmask, & ! real (kind=kind_io8) gdata(len), slmask(len) real (kind=kind_io8), allocatable :: data(:,:), rslmsk(:,:) - real (kind=kind_io8), allocatable :: data8(:) + real (kind=kind_dbl_prec), allocatable :: data8(:) real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) ! logical lmask, yr2kc, gaus, ijordr @@ -8471,7 +8471,7 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, & ! real (kind=kind_io8) gdata(len), slmask(len) real (kind=kind_io8), allocatable :: data(:,:),rslmsk(:,:) - real (kind=kind_io8), allocatable :: data8(:) + real (kind=kind_dbl_prec), allocatable :: data8(:) real (kind=kind_io8), allocatable :: rlngrb(:), rltgrb(:) ! logical lmask, yr2kc, gaus, ijordr @@ -8492,7 +8492,7 @@ subroutine fixrda(lugb,fngrib,kpds5,slmask, & integer mjday(12) data mjday/31,28,31,30,31,30,31,31,30,31,30,31/ ! - real (kind=kind_io8) fha(5) + real (kind=kind_dbl_prec) fha(5) integer ida(8),jda(8) ! allocate(data8(1:mdata)) From 696c0ea32d86259836016977621d05c316db0d73 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Wed, 20 Jul 2022 11:48:43 -0500 Subject: [PATCH 003/249] More argument mismatch fixes --- physics/GFS_time_vary_pre.fv3.F90 | 18 +++--------------- physics/GFS_time_vary_pre.scm.F90 | 18 +++--------------- 2 files changed, 6 insertions(+), 30 deletions(-) diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/GFS_time_vary_pre.fv3.F90 index 86dfe3f40..ba661f578 100644 --- a/physics/GFS_time_vary_pre.fv3.F90 +++ b/physics/GFS_time_vary_pre.fv3.F90 @@ -92,10 +92,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys - real(kind=kind_sngl_prec) :: rinc4(5) real(kind=kind_dbl_prec) :: rinc8(5) - integer :: w3kindreal,w3kindint integer :: iw3jdn integer :: jd0, jd1 real :: fjd @@ -113,19 +111,9 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, !--- jdat is being updated directly inside of FV3GFS_cap.F90 !--- update calendars and triggers - call w3kind(w3kindreal,w3kindint) - if (w3kindreal == 8) then - rinc8(1:5) = 0 - call w3difdat(jdat,idat,4,rinc8) - sec = rinc8(4) - else if (w3kindreal == 4) then - rinc4(1:5) = 0 - call w3difdat(jdat,idat,4,rinc4) - sec = rinc4(4) - else - write(0,*)' FATAL ERROR: Invalid w3kindreal' - call abort - endif + rinc8(1:5) = 0 + call w3difdat(jdat,idat,4,rinc8) + sec = rinc8(4) phour = sec/con_hr !--- set current bucket hour zhour = phour diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/GFS_time_vary_pre.scm.F90 index 2bb6b3ceb..3293e09e4 100644 --- a/physics/GFS_time_vary_pre.scm.F90 +++ b/physics/GFS_time_vary_pre.scm.F90 @@ -91,10 +91,8 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, & real(kind=kind_phys), parameter :: con_24 = 24.0_kind_phys real(kind=kind_phys), parameter :: con_hr = 3600.0_kind_phys - real(kind=kind_sngl_prec) :: rinc4(5) real(kind=kind_dbl_prec) :: rinc8(5) - integer :: w3kindreal,w3kindint integer :: iw3jdn integer :: jd0, jd1 real :: fjd @@ -114,19 +112,9 @@ subroutine GFS_time_vary_pre_timestep_init (jdat, idat, dtp, nsswr, & !--- jdat is being updated directly inside of the time integration !--- loop of scm.F90 !--- update calendars and triggers - call w3kind(w3kindreal,w3kindint) - if (w3kindreal == 8) then - rinc8(1:5) = 0 - call w3difdat(jdat,idat,4,rinc8) - sec = rinc8(4) - else if (w3kindreal == 4) then - rinc4(1:5) = 0 - call w3difdat(jdat,idat,4,rinc4) - sec = rina4c(4) - else - write(0,*)' FATAL ERROR: Invalid w3kindreal' - call abort - endif + rinc8(1:5) = 0 + call w3difdat(jdat,idat,4,rinc8) + sec = rinc8(4) phour = sec/con_hr !--- set current bucket hour zhour = phour From 92b8c857bd211770e53b2b3b80ecdf5115ba7e57 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 7 Nov 2022 11:35:12 -0700 Subject: [PATCH 004/249] If MPI is used, find package --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d14778b06..4de7aa24e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,12 @@ project(ccpp_physics set(PACKAGE "ccpp-physics") set(AUTHORS "Grant Firl" "Dom Heinzeller" "Man Zhang" "Mike Kavulich" "Chunxi Zhang") +#------------------------------------------------------------------------------ +# Set MPI flags for C/C++/Fortran +if (MPI) + find_package(MPI REQUIRED C Fortran) +endif (OPENMP) + #------------------------------------------------------------------------------ # Set OpenMP flags for C/C++/Fortran if (OPENMP) From f943d204fa9bb2200ce8b5ae545919c62c003664 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Fri, 18 Nov 2022 20:59:10 +0000 Subject: [PATCH 005/249] Fixed cmake if/endif mismatch --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4de7aa24e..8a88fadac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(AUTHORS "Grant Firl" "Dom Heinzeller" "Man Zhang" "Mike Kavulich" "Chunxi Zh # Set MPI flags for C/C++/Fortran if (MPI) find_package(MPI REQUIRED C Fortran) -endif (OPENMP) +endif() #------------------------------------------------------------------------------ # Set OpenMP flags for C/C++/Fortran From d2900143f7de8c3fe79e8135a0bab5f3267267b9 Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Tue, 10 Jan 2023 15:31:25 -0700 Subject: [PATCH 006/249] add sfc_land and allow sbs along with fully coupled --- CODEOWNERS | 2 + physics/noahmpdrv.F90 | 12 ++- physics/noahmpdrv.meta | 14 ++++ physics/sfc_land.f | 146 ++++++++++++++++++++++++++++++++ physics/sfc_land.meta | 186 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 358 insertions(+), 2 deletions(-) create mode 100644 physics/sfc_land.f create mode 100644 physics/sfc_land.meta diff --git a/CODEOWNERS b/CODEOWNERS index cf7a886aa..19e0eb2a5 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -126,6 +126,8 @@ physics/h2ophys.* @AlexBelochitski-NOAA physics/sfc_sice.* @wd20xw @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA physics/sfc_cice.* @wd20xw @climbfuji @SamuelTrahanNOAA @grantfirl @mzhangw @panll @mkavulich @ChunxiZhang-NOAA +physics/sfc_land.* @uturuncoglu @barlage + ######################################################################## # Lines starting with '#' are comments. diff --git a/physics/noahmpdrv.F90 b/physics/noahmpdrv.F90 index fed823ead..d15a9e82a 100644 --- a/physics/noahmpdrv.F90 +++ b/physics/noahmpdrv.F90 @@ -140,7 +140,7 @@ subroutine noahmpdrv_run & iopt_stc, iopt_trs,xlatin, xcoszin, iyrlen, julian, garea, & rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, & con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, & - con_fvirt, con_rd, con_hfus, thsfc_loc, & + con_fvirt, con_rd, con_hfus, thsfc_loc, cpllnd, cpllnd2atm,& ! --- in/outs: weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & @@ -274,6 +274,9 @@ subroutine noahmpdrv_run & logical , intent(in) :: thsfc_loc ! Flag for reference pressure in theta calculation + logical , intent(in) :: cpllnd ! Flag for land coupling (atm->lnd) + logical , intent(in) :: cpllnd2atm ! Flag for land coupling (lnd->atm) + real(kind=kind_phys), dimension(:) , intent(inout) :: weasd ! water equivalent accumulated snow depth [mm] real(kind=kind_phys), dimension(:) , intent(inout) :: snwdph ! snow depth [mm] real(kind=kind_phys), dimension(:) , intent(inout) :: tskin ! ground surface skin temperature [K] @@ -601,7 +604,12 @@ subroutine noahmpdrv_run & errmsg = '' errflg = 0 -do i = 1, im +! +! --- Just return if external land component is activated for two-way interaction +! + if (cpllnd .and. cpllnd2atm) return + + do i = 1, im if (flag_iter(i) .and. dry(i)) then diff --git a/physics/noahmpdrv.meta b/physics/noahmpdrv.meta index 3235b7c90..643987d98 100644 --- a/physics/noahmpdrv.meta +++ b/physics/noahmpdrv.meta @@ -611,6 +611,20 @@ dimensions = () type = logical intent = in +[cpllnd] + standard_name = flag_for_land_coupling + long_name = flag controlling cpllnd collection (default off) + units = flag + dimensions = () + type = logical + intent = in +[cpllnd2atm] + standard_name = flag_for_one_way_land_coupling_to_atmosphere + long_name = flag controlling land coupling to the atmosphere (default off) + units = flag + dimensions = () + type = logical + intent = in [weasd] standard_name = water_equivalent_accumulated_snow_depth_over_land long_name = water equiv of acc snow depth over land diff --git a/physics/sfc_land.f b/physics/sfc_land.f new file mode 100644 index 000000000..0c3130bbe --- /dev/null +++ b/physics/sfc_land.f @@ -0,0 +1,146 @@ +!> \file sfc_land.f +!! This file contains the code for coupling to land component + +!> This module contains the CCPP-compliant GFS land post +!! interstitial codes, which returns updated surface +!! properties such as latent heat and sensible heat +!! provided by the component version of land model + +!> This module contains the CCPP-compliant GFS land scheme. + module sfc_land + + contains + +!> \defgroup sfc_land for coupling to land +!! @{ +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication +!! +!> \brief Brief description of the subroutine +!! +!! \section arg_table_sfc_land_run Arguments +!! \htmlinclude sfc_land_run.html +!! + +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ + + +!! use physcons, only : hvap => con_hvap, cp => con_cp, & +!! & rvrdm1 => con_fvirt, rd => con_rd +! +!----------------------------------- + subroutine sfc_land_run & +! --- inputs: + & ( im, cpllnd, cpllnd2atm, flag_iter, dry, & + & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & + & ep_lnd, t2mmp_lnd, q2mp_lnd, & +! --- outputs: + & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & + & errmsg, errflg, naux2d, aux2d + & ) + +! ===================================================================== ! +! description: ! +! Dec 2022 -- Ufuk Turuncoglu created for coupling to land ! +! ! +! usage: ! +! ! +! call sfc_land ! +! inputs: ! +! ( im, cpllnd, cpllnd2atm, flag_iter, dry, ! +! sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ! +! ep_lnd, t2mmp_lnd, q2mp_lnd, ! +! outputs: ! +! sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, ! +! errmsg, errflg) ! +! ! +! ==================== defination of variables ==================== ! +! ! +! inputs: +! im - integer, horiz dimension +! cpllnd - logical, flag for land coupling +! cpllnd2atm - logical, flag for land coupling (lnd->atm) +! flag_iter - logical, flag for iteration +! dry - logical, eq T if a point with any land +! sncovr1_lnd - real , surface snow area fraction +! qsurf_lnd - real , specific humidity at sfc +! evap_lnd - real , evaporation from latent heat +! hflx_lnd - real , sensible heat +! ep_lnd - real , surface upward potential latent heat flux +! t2mmp_lnd - real , 2m temperature +! q2mp_lnd - real , 2m specific humidity +! outputs: +! sncovr1 - real , snow cover over land +! qsurf - real , specific humidity at sfc +! evap - real , evaporation from latent heat +! hflx - real , sensible heat +! ep - real , potential evaporation +! t2mmp - real , temperature at 2m +! q2mp - real , specific humidity at 2m +! ==================== end of description ===================== ! +! +! + use machine , only : kind_phys + implicit none + +! --- inputs: + integer, intent(in) :: im + logical, intent(in) :: cpllnd, cpllnd2atm + logical, dimension(:), intent(in) :: flag_iter + logical, dimension(:), intent(in) :: dry + + real (kind=kind_phys), dimension(:), intent(in) :: & + & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ep_lnd, & + & t2mmp_lnd, q2mp_lnd + +! --- outputs: + real (kind=kind_phys), dimension(:), intent(out) :: & + & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp +! + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + integer, intent(in) :: naux2d + real(kind_phys), intent(out) :: aux2d(:,:) + +! --- locals: + + integer :: i + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 +! + if (.not. cpllnd2atm) return +! + do i = 1, im + !if (flag_iter(i) .and. dry(i)) then + !if (dry(i)) then + sncovr1(i) = sncovr1_lnd(i) + qsurf(i) = qsurf_lnd(i) + hflx(i) = hflx_lnd(i) + evap(i) = evap_lnd(i) + ep(i) = ep_lnd(i) + t2mmp(i) = t2mmp_lnd(i) + q2mp(i) = q2mp_lnd(i) + !end if + enddo + + aux2d(:,1) = dry(:) !sncovr1(:) + aux2d(:,2) = qsurf(:) + aux2d(:,3) = hflx(:) + aux2d(:,4) = evap(:) + aux2d(:,5) = ep(:) + aux2d(:,6) = qsurf_lnd(:) !t2mmp(:) + aux2d(:,7) = q2mp(:) + + return +!----------------------------------- + end subroutine sfc_land_run +!----------------------------------- + +!> @} + end module sfc_land diff --git a/physics/sfc_land.meta b/physics/sfc_land.meta new file mode 100644 index 000000000..f31d779ae --- /dev/null +++ b/physics/sfc_land.meta @@ -0,0 +1,186 @@ +[ccpp-table-properties] + name = sfc_land + type = scheme + dependencies = machine.F + +######################################################################## +[ccpp-arg-table] + name = sfc_land_run + type = scheme +[im] + standard_name = horizontal_loop_extent + long_name = horizontal loop extent + units = count + dimensions = () + type = integer + intent = in +[cpllnd] + standard_name = flag_for_land_coupling + long_name = flag controlling cpllnd collection (default off) + units = flag + dimensions = () + type = logical + intent = in +[cpllnd2atm] + standard_name = flag_for_one_way_land_coupling_to_atmosphere + long_name = flag controlling land coupling to the atmosphere (default off) + units = flag + dimensions = () + type = logical + intent = in +[flag_iter] + standard_name = flag_for_iteration + long_name = flag for iteration + units = flag + dimensions = (horizontal_loop_extent) + type = logical + intent = in +[dry] + standard_name = flag_nonzero_land_surface_fraction + long_name = flag indicating presence of some land surface area fraction + units = flag + dimensions = (horizontal_loop_extent) + type = logical + intent = in +[sncovr1_lnd] + standard_name = surface_snow_area_fraction_over_land_from_land + long_name = surface snow area fraction over land for coupling + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[qsurf_lnd] + standard_name = surface_specific_humidity_over_land_from_land + long_name = surface air saturation specific humidity over land + units = kg kg-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[evap_lnd] + standard_name = surface_upward_latent_heat_flux_over_land_from_land + long_name = sfc latent heat flux input over land for coupling + units = kg kg-1 m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[hflx_lnd] + standard_name = surface_upward_sensible_heat_flux_over_land_from_land + long_name = sfc sensible heat flux input over land for coupling + units = K m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ep_lnd] + standard_name = surface_upward_potential_latent_heat_flux_over_land_from_land + long_name = surface upward potential latent heat flux over land for coupling + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[t2mmp_lnd] + standard_name = temperature_at_2m_over_land_from_land + long_name = 2 meter temperature over land for coupling + units = K + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[q2mp_lnd] + standard_name = specific_humidity_at_2m_over_land_from_land + long_name = 2 meter specific humidity over land for coupling + units = kg kg-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[sncovr1] + standard_name = surface_snow_area_fraction_over_land + long_name = surface snow area fraction + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[qsurf] + standard_name = surface_specific_humidity_over_land + long_name = surface air saturation specific humidity over land + units = kg kg-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[evap] + standard_name = kinematic_surface_upward_latent_heat_flux_over_land + long_name = kinematic surface upward latent heat flux over land + units = kg kg-1 m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[hflx] + standard_name = kinematic_surface_upward_sensible_heat_flux_over_land + long_name = kinematic surface upward sensible heat flux over land + units = K m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[ep] + standard_name = surface_upward_potential_latent_heat_flux_over_land + long_name = surface upward potential latent heat flux over land + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[t2mmp] + standard_name = temperature_at_2m_from_noahmp + long_name = 2 meter temperature from noahmp + units = K + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[q2mp] + standard_name = specific_humidity_at_2m_from_noahmp + long_name = 2 meter specific humidity from noahmp + units = kg kg-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out +[naux2d] + standard_name = number_of_xy_dimensioned_auxiliary_arrays + long_name = number of 2d auxiliary arrays to output (for debugging) + units = count + dimensions = () + type = integer + intent = in +[aux2d] + standard_name = auxiliary_2d_arrays + long_name = auxiliary 2d arrays to output (for debugging) + units = none + dimensions = (horizontal_loop_extent,number_of_xy_dimensioned_auxiliary_arrays) + type = real + kind = kind_phys + intent = out From c18c6d49c635198cf4bd1b3cddf9c8d4848090d6 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 30 Jan 2023 13:18:03 -0700 Subject: [PATCH 007/249] CCPP scheme simulator. --- physics/ccpp_scheme_simultator.F90 | 593 ++++++++++++++++++++++++++++ physics/ccpp_scheme_simultator.meta | 266 +++++++++++++ 2 files changed, 859 insertions(+) create mode 100644 physics/ccpp_scheme_simultator.F90 create mode 100644 physics/ccpp_scheme_simultator.meta diff --git a/physics/ccpp_scheme_simultator.F90 b/physics/ccpp_scheme_simultator.F90 new file mode 100644 index 000000000..4d53c8860 --- /dev/null +++ b/physics/ccpp_scheme_simultator.F90 @@ -0,0 +1,593 @@ +! ######################################################################################## +! +! CCPP scheme to replace physics schemes with simulated data tendencies. +! +! ######################################################################################## +module ccpp_scheme_simultator + use machine, only: kind_phys + use netcdf + implicit none + + ! + ! Data driven phsyics tendencies + ! + real(kind_phys), allocatable, dimension(:) :: time_data + real(kind_phys), allocatable, dimension(:,:) :: dTdt_LWRAD_data, dTdt_SWRAD_data, & + dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, dudt_GWD_data, & + dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, dTdt_DCNV_data, & + dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data + real(kind_phys), allocatable, dimension(:,:,:) :: dqdt_PBL_data, dqdt_SCNV_data, & + dqdt_DCNV_data, dqdt_cldMP_data + + ! + ! Logical switches for CCPP scheme simulator(s) + ! + logical :: use_RAD_scheme_sim = .false., & + use_PBL_scheme_sim = .false., & + use_GWD_scheme_sim = .false., & + use_SCNV_scheme_sim = .false., & + use_DCNV_scheme_sim = .false., & + use_cldMP_scheme_sim = .false. + logical :: have_dTdt_LWRAD_data = .false., & + have_dTdt_SWRAD_data = .false., & + have_dTdt_PBL_data = .false., & + have_dqdt_PBL_data = .false., & + have_dudt_PBL_data = .false., & + have_dvdt_PBL_data = .false., & + have_dTdt_GWD_data = .false., & + have_dudt_GWD_data = .false., & + have_dvdt_GWD_data = .false., & + have_dTdt_SCNV_data = .false., & + have_dudt_SCNV_data = .false., & + have_dvdt_SCNV_data = .false., & + have_dqdt_SCNV_data = .false., & + have_dTdt_DCNV_data = .false., & + have_dudt_DCNV_data = .false., & + have_dvdt_DCNV_data = .false., & + have_dqdt_DCNV_data = .false., & + have_dTdt_cldMP_data = .false., & + have_dqdt_cldMP_data = .false. + logical :: do_ccpp_scheme_simulator = .false. + + ! Host-model initial time information + integer :: init_year, init_month, init_day, init_hour, init_min, init_sec + + public ccpp_scheme_simultator_init, ccpp_scheme_simultator_run +contains + + ! ###################################################################################### + ! + ! SUBROUTINE ccpp_scheme_simultator_init + ! + ! ###################################################################################### +!! \section arg_table_ccpp_scheme_simultator_init +!! \htmlinclude ccpp_scheme_simultator_init.html +!! + subroutine ccpp_scheme_simultator_init(me, master, nlunit, nml_file, idat, errmsg, errflg) + + ! Inputs + integer, intent (in) :: me, master, nlunit + character(len=*), intent (in) :: nml_file + integer, intent (in), dimension(8) :: idat + + ! Outputs + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + integer :: ncid, dimID, varID, status, nlon, nlat, nlev, ntime, ios + character(len=256) :: fileIN + logical :: exists + integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality + + ! Namelist + namelist / scm_data_nml / & + fileIN, use_RAD_scheme_sim, use_PBL_scheme_sim, use_GWD_scheme_sim, use_SCNV_scheme_sim, & + use_DCNV_scheme_sim, use_cldMP_scheme_sim + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Store model initialization time. + init_year = idat(1) + init_month = idat(2) + init_day = idat(3) + init_hour = idat(5) + init_min = idat(6) + init_sec = idat(7) + + ! Read in namelist + inquire (file = trim (nml_file), exist = exists) + if (.not. exists) then + errmsg = 'SCM data tendency :: namelist file: '//trim(nml_file)//' does not exist' + errflg = 1 + return + else + open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) + endif + rewind (nlunit) + read (nlunit, nml = scm_data_nml) + close (nlunit) + + ! Only proceed if scheme simulator requested. + if (use_RAD_scheme_sim .or. use_PBL_scheme_sim .or. use_GWD_scheme_sim .or. & + use_SCNV_scheme_sim .or. use_DCNV_scheme_sim .or. use_cldMP_scheme_sim) then + do_ccpp_scheme_simulator = .true. + else + return + endif + + ! Check that input data file exists + inquire (file = trim (fileIN), exist = exists) + if (.not. exists) then + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not exist' + errflg = 1 + return + endif + + ! Open file (required) + status = nf90_open(trim(fileIN), NF90_NOWRITE, ncid) + if (status /= nf90_noerr) then + errmsg = 'Error reading in SCM data tendency file: '//trim(fileIN) + errflg = 1 + return + endif + + ! Get dimensions (required) + status = nf90_inq_dimid(ncid, 'time', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = ntime) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain time dimension' + errflg = 1 + return + endif + ! + status = nf90_inq_dimid(ncid, 'lev', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = nlev) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain lev dimension' + errflg = 1 + return + endif + + ! Temporal info (required) + status = nf90_inq_varid(ncid, 'times', varID) + if (status == nf90_noerr) then + allocate(time_data(ntime)) + status = nf90_get_var( ncid, varID, time_data) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' + errflg = 1 + return + endif + + ! Read in physics data tendencies (optional) + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) then + allocate(dTdt_LWRAD_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) + have_dTdt_LWRAD_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) then + allocate(dTdt_SWRAD_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) + have_dTdt_SWRAD_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) then + allocate(dTdt_PBL_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dTdt_PBL_data) + have_dTdt_PBL_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) then + allocate(dqdt_PBL_data(nlev, ntime, nTrc)) + status = nf90_get_var( ncid, varID, dqdt_PBL_data) + have_dqdt_PBL_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) then + allocate(dudt_PBL_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dudt_PBL_data) + have_dudt_PBL_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) then + allocate(dvdt_PBL_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dvdt_PBL_data) + have_dvdt_PBL_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) then + allocate(dTdt_GWD_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dTdt_GWD_data) + have_dTdt_GWD_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) then + allocate(dudt_GWD_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dudt_GWD_data) + have_dudt_GWD_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) then + allocate(dvdt_GWD_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dvdt_GWD_data) + have_dvdt_GWD_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) then + allocate(dTdt_SCNV_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dTdt_SCNV_data) + have_dTdt_SCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) then + allocate(dudt_SCNV_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dudt_SCNV_data) + have_dudt_SCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) then + allocate(dvdt_SCNV_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dvdt_SCNV_data) + have_dvdt_SCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) then + allocate(dqdt_SCNV_data(nlev, ntime, nTrc)) + status = nf90_get_var( ncid, varID, dqdt_SCNV_data) + have_dqdt_SCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) then + allocate(dTdt_DCNV_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dTdt_DCNV_data) + have_dTdt_DCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) then + allocate(dudt_DCNV_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dudt_DCNV_data) + have_dudt_DCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) then + allocate(dvdt_DCNV_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dvdt_DCNV_data) + have_dvdt_DCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) then + allocate(dqdt_DCNV_data(nlev, ntime, nTrc)) + status = nf90_get_var( ncid, varID, dqdt_DCNV_data) + have_dqdt_DCNV_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) then + allocate(dTdt_cldMP_data(nlev, ntime)) + status = nf90_get_var( ncid, varID, dTdt_cldMP_data) + have_dTdt_cldMP_data = .true. + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) then + allocate(dqdt_cldMP_data(nlev, ntime, nTrc)) + status = nf90_get_var( ncid, varID, dqdt_cldMP_data) + have_dqdt_cldMP_data = .true. + endif + + ! + if (me == 0) then + print*, "--- Using SCM data tendencies ---" + print*, "---------------------------------" + print*, " " + print*, "use_RAD_scheme_sim: ", use_RAD_scheme_sim + print*, " dTdt_LWRAD_data: ", have_dTdt_LWRAD_data + print*, " dTdt_SWRAD_data: ", have_dTdt_SWRAD_data + print*, "use_PBL_scheme_sim: ", use_PBL_scheme_sim + print*, " dTdt_PBL_data: ", have_dTdt_PBL_data + print*, " dqdt_PBL_data: ", have_dqdt_PBL_data + print*, " dudt_PBL_data: ", have_dudt_PBL_data + print*, " dvdt_PBL_data: ", have_dvdt_PBL_data + print*, "use_GWD_scheme_sim: ", use_GWD_scheme_sim + print*, " dTdt_gwd_data: ", have_dTdt_GWD_data + print*, " dudt_gwd_data: ", have_dudt_GWD_data + print*, " dvdt_gwd_data: ", have_dvdt_GWD_data + print*, "use_SCNV_scheme_sim: ", use_SCNV_scheme_sim + print*, " dTdt_SCNV_data: ", have_dTdt_SCNV_data + print*, " dudt_SCNV_data: ", have_dudt_SCNV_data + print*, " dvdt_SCNV_data: ", have_dvdt_SCNV_data + print*, " dqdt_SCNV_data: ", have_dqdt_SCNV_data + print*, "use_DCNV_scheme_sim: ", use_DCNV_scheme_sim + print*, " dTdt_DCNV_data: ", have_dTdt_DCNV_data + print*, " dudt_DCNV_data: ", have_dudt_DCNV_data + print*, " dvdt_DCNV_data: ", have_dvdt_DCNV_data + print*, " dqdt_DCNV_data: ", have_dqdt_DCNV_data + print*, "use_cldMP_scheme_sim: ", use_cldMP_scheme_sim + print*, " dTdt_cldMP_data: ", have_dTdt_cldMP_data + print*, " dqdt_cldMP_data: ", have_dqdt_cldMP_data + print*, "---------------------------------" + endif + + end subroutine ccpp_scheme_simultator_init + + ! ###################################################################################### + ! + ! SUBROUTINE ccpp_scheme_simultator_run + ! + ! ###################################################################################### +!! \section arg_table_ccpp_scheme_simultator_run +!! \htmlinclude ccpp_scheme_simultator_run.html +!! + subroutine ccpp_scheme_simultator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & + dtend, index_of_process_dcnv, index_of_process_longwave, & + index_of_process_shortwave, index_of_process_scnv, & + index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & + index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gt0, gu0, gv0, gq0, & + errmsg, errflg) + + ! Inputs + integer, intent(in ) :: kdt + integer, intent (in), dimension(8) :: jdat + real(kind_phys), intent(in ) :: dtp, solhr + real(kind_phys), intent(in ), dimension(:,:) :: tgrs, ugrs, vgrs + real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs, dtend + integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_process_longwave, & + index_of_process_shortwave, index_of_process_scnv, & + index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & + index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv + + ! Outputs + real(kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 + real(kind_phys), intent(inout), dimension(:,:,:) :: gq0 + character(len=*),intent(out ) :: errmsg + integer, intent(out ) :: errflg + + ! Locals + integer :: iCol, iLay, iTrc, nCol, nLay, nTrc, ti(1), tf(1), idtend, fcst_year, & + fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec + real(kind_phys) :: w1, w2,hrofday + real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1 + real(kind_phys), dimension(:,:,:), allocatable :: gq1 + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not. do_ccpp_scheme_simulator) return + + ! Current forecast time + fcst_year = jdat(1) + fcst_month = jdat(2) + fcst_day = jdat(3) + fcst_hour = jdat(5) + fcst_min = jdat(6) + fcst_sec = jdat(7) + + ! Dimensions + nCol = size(gq0(:,1,1)) + nLay = size(gq0(1,:,1)) + nTrc = size(gq0(1,1,:)) + + ! Allocate temporaries + allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay,1)) ! *only specific humidity to start (ntrc=1). + + ! Determine temporal interpolation weights for data-tendecies. + ! DJS: The data tendencies have a temporal dimension, to capture the diurnal cycle, + ! which is needed for reasonable solar forcing. + hrofday = fcst_hour*3600. + fcst_min*60. + fcst_sec + ti = findloc(abs(time_data-hrofday),minval(abs(time_data-hrofday))) + if (hrofday - time_data(ti(1)) .le. 0) ti = ti-1 + tf = ti + 1 + w1 = (time_data(tf(1))-hrofday) / (time_data(tf(1)) - time_data(ti(1))) + w2 = 1 - w1 + + do iCol = 1,nCol + ! Set state + gt1(iCol,:) = tgrs(iCol,:) + gu1(iCol,:) = ugrs(iCol,:) + gv1(iCol,:) = vgrs(iCol,:) + gq1(iCol,:,1) = qgrs(iCol,:,1) + + ! ############################################################################### + ! Radiation + ! ############################################################################### + if (use_RAD_scheme_sim) then + if (have_dTdt_LWRAD_data) then + gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_LWRAD_data(:,ti(1)) + w2*dTdt_LWRAD_data(:,tf(1))) * dtp + endif + if (have_dTdt_SWRAD_data) then + gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_SWRAD_data(:,ti(1)) + w2*dTdt_SWRAD_data(:,tf(1))) * dtp + endif + else + idtend = dtidx(index_of_temperature,index_of_process_longwave) + if (idtend >= 1) then + gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_temperature,index_of_process_shortwave) + if (idtend >=1) then + gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + endif + + ! ############################################################################### + ! PBL + ! ############################################################################### + if (use_PBL_scheme_sim) then + if (have_dTdt_PBL_data) then + gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_PBL_data(:,ti(1)) + w2*(dTdt_PBL_data(:,tf(1)))) * dtp + endif + if (have_dudt_PBL_data) then + gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_PBL_data(:,ti(1)) + w2*(dudt_PBL_data(:,tf(1)))) * dtp + endif + if (have_dvdt_PBL_data) then + gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_PBL_data(:,ti(1)) + w2*(dvdt_PBL_data(:,tf(1)))) * dtp + endif + if (have_dqdt_PBL_data) then + gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_PBL_data(:,ti(1),1) + w2*(dqdt_PBL_data(:,tf(1),1))) * dtp + endif + else + idtend = dtidx(index_of_temperature,index_of_process_pbl) + if (idtend >= 1) then + gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_x_wind,index_of_process_pbl) + if (idtend >= 1) then + gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_y_wind,index_of_process_pbl) + if (idtend >= 1) then + gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(100+ntqv, index_of_process_pbl) + if (idtend >= 1) then + gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp + endif + endif + + ! ############################################################################### + ! Gravity wave drag + ! ############################################################################### + if (use_GWD_scheme_sim) then + if (have_dTdt_GWD_data) then + gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_GWD_data(:,ti(1)) + w2*(dTdt_GWD_data(:,tf(1)))) * dtp + endif + if (have_dudt_GWD_data) then + gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_GWD_data(:,ti(1)) + w2*(dudt_GWD_data(:,tf(1)))) * dtp + endif + if (have_dvdt_GWD_data) then + gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_GWD_data(:,ti(1)) + w2*(dvdt_GWD_data(:,tf(1)))) * dtp + endif + else + idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) + if (idtend >= 1) then + gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) + if (idtend >= 1) then + gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) + if (idtend >= 1) then + gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + endif + + ! ############################################################################### + ! Shallow convection + ! ############################################################################### + if (use_SCNV_scheme_sim) then + if (have_dTdt_SCNV_data) then + gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_SCNV_data(:,ti(1)) + w2*(dTdt_SCNV_data(:,tf(1)))) * dtp + endif + if (have_dudt_SCNV_data) then + gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_SCNV_data(:,ti(1)) + w2*(dudt_SCNV_data(:,tf(1)))) * dtp + endif + if (have_dvdt_SCNV_data) then + gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_SCNV_data(:,ti(1)) + w2*(dvdt_SCNV_data(:,tf(1)))) * dtp + endif + if (have_dqdt_SCNV_data) then + gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_SCNV_data(:,ti(1),1) + w2*(dqdt_SCNV_data(:,tf(1),1))) * dtp + endif + else + idtend = dtidx(index_of_temperature,index_of_process_scnv) + if (idtend >= 1) then + gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_x_wind,index_of_process_scnv) + if (idtend >= 1) then + gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_y_wind,index_of_process_scnv) + if (idtend >= 1) then + gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(100+ntqv,index_of_process_scnv) + if (idtend >= 1) then + gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp + endif + endif + + ! ############################################################################### + ! Deep convection + ! ############################################################################### + if (use_DCNV_scheme_sim) then + if (have_dTdt_DCNV_data) then + gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_DCNV_data(:,ti(1)) + w2*(dTdt_DCNV_data(:,tf(1)) )) * dtp + endif + if (have_dudt_DCNV_data) then + gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_DCNV_data(:,ti(1)) + w2*(dudt_DCNV_data(:,tf(1)))) * dtp + endif + if (have_dvdt_DCNV_data) then + gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_DCNV_data(:,ti(1)) + w2*(dvdt_DCNV_data(:,tf(1)) )) * dtp + endif + if (have_dqdt_DCNV_data) then + gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_DCNV_data(:,ti(1),1) + w2*(dqdt_DCNV_data(:,tf(1),1))) * dtp + endif + else + idtend = dtidx(index_of_temperature,index_of_process_dcnv) + if (idtend >= 1) then + gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_x_wind,index_of_process_dcnv) + if (idtend >= 1) then + gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(index_of_y_wind,index_of_process_dcnv) + if (idtend >= 1) then + gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(100+ntqv,index_of_process_dcnv) + if (idtend >= 1) then + gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp + endif + endif + + ! ############################################################################### + ! Cloud microphysics + ! ############################################################################### + if (use_cldMP_scheme_sim) then + if (have_dTdt_cldMP_data) then + gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_cldMP_data(:,ti(1)) + w2*(dTdt_cldMP_data(:,tf(1)))) * dtp + endif + if (have_dqdt_cldMP_data) then + gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_cldMP_data(:,ti(1),1) + w2*(dqdt_cldMP_data(:,tf(1),1))) * dtp + endif + else + idtend = dtidx(index_of_temperature,index_of_process_mp) + if (idtend >= 1) then + gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp + endif + idtend = dtidx(100+ntqv,index_of_process_mp) + if (idtend >= 1) then + gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp + endif + endif + + enddo ! columns + ! + end subroutine ccpp_scheme_simultator_run + +end module ccpp_scheme_simultator diff --git a/physics/ccpp_scheme_simultator.meta b/physics/ccpp_scheme_simultator.meta new file mode 100644 index 000000000..e60248721 --- /dev/null +++ b/physics/ccpp_scheme_simultator.meta @@ -0,0 +1,266 @@ +[ccpp-table-properties] + name = ccpp_scheme_simultator + type = scheme + dependencies = machine.F + +######################################################################## +[ccpp-arg-table] + name = ccpp_scheme_simultator_init + type = scheme +[me] + standard_name = mpi_rank + long_name = MPI rank of current process + units = index + dimensions = () + type = integer + intent = in +[master] + standard_name = mpi_root + long_name = MPI rank of master process + units = index + dimensions = () + type = integer + intent = in +[nlunit] + standard_name = iounit_of_namelist + long_name = fortran unit number for opening nameliust file + units = none + dimensions = () + type = integer + intent = in +[nml_file] + standard_name = filename_of_namelist + long_name = namelist filename + units = none + dimensions = () + type = character + kind = len=* + intent = in +[idat] + standard_name = date_and_time_at_model_initialization_in_iso_order + long_name = initialization date and time + units = none + dimensions = (8) + type = integer + intent = in +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out + +######################################################################## +[ccpp-arg-table] + name = ccpp_scheme_simultator_run + type = scheme +[solhr] + standard_name = forecast_utc_hour + long_name = time in hours after 00z at the current timestep + units = h + dimensions = () + type = real + kind = kind_phys + intent = in +[kdt] + standard_name = index_of_timestep + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in +[dtp] + standard_name = timestep_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in +[jdat] + standard_name = date_and_time_of_forecast_in_united_states_order + long_name = current forecast date and time + units = none + dimensions = (8) + type = integer + intent = in +[tgrs] + standard_name = air_temperature + long_name = model layer mean temperature + units = K + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[ugrs] + standard_name = x_wind + long_name = zonal wind + units = m s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[vgrs] + standard_name = y_wind + long_name = meridional wind + units = m s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[qgrs] + standard_name = tracer_concentration + long_name = model layer mean tracer concentration + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = in +[dtend] + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables + units = mixed + dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) + type = real + kind = kind_phys + intent = in +[dtidx] + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) + type = integer + intent = in +[index_of_process_dcnv] + standard_name = index_of_deep_convection_process_process_in_cumulative_change_index + long_name = index of deep convection process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_longwave] + standard_name = index_of_longwave_heating_process_in_cumulative_change_index + long_name = index of longwave heating process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_shortwave] + standard_name = index_of_shortwave_heating_process_in_cumulative_change_index + long_name = index of shortwave heating process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_scnv] + standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index + long_name = index of shallow convection process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_mp] + standard_name = index_of_microphysics_process_process_in_cumulative_change_index + long_name = index of microphysics transport process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[ntqv] + standard_name = index_of_specific_humidity_in_tracer_concentration_array + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in +[gt0] + standard_name = air_temperature_of_new_state + long_name = temperature updated by physics + units = K + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[gu0] + standard_name = x_wind_of_new_state + long_name = zonal wind updated by physics + units = m s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[gv0] + standard_name = y_wind_of_new_state + long_name = meridional wind updated by physics + units = m s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[gq0] + standard_name = tracer_concentration_of_new_state + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out \ No newline at end of file From f9abb735c0741eff2b79420f49082a5300fe46c9 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 30 Jan 2023 13:26:48 -0700 Subject: [PATCH 008/249] Fix file rename typo --- ...multator.F90 => ccpp_scheme_simulator.F90} | 26 +++++++++---------- ...ltator.meta => ccpp_scheme_simulator.meta} | 6 ++--- 2 files changed, 16 insertions(+), 16 deletions(-) rename physics/{ccpp_scheme_simultator.F90 => ccpp_scheme_simulator.F90} (96%) rename physics/{ccpp_scheme_simultator.meta => ccpp_scheme_simulator.meta} (98%) diff --git a/physics/ccpp_scheme_simultator.F90 b/physics/ccpp_scheme_simulator.F90 similarity index 96% rename from physics/ccpp_scheme_simultator.F90 rename to physics/ccpp_scheme_simulator.F90 index 4d53c8860..2954e3759 100644 --- a/physics/ccpp_scheme_simultator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -3,7 +3,7 @@ ! CCPP scheme to replace physics schemes with simulated data tendencies. ! ! ######################################################################################## -module ccpp_scheme_simultator +module ccpp_scheme_ccpp_scheme_simulator use machine, only: kind_phys use netcdf implicit none @@ -52,18 +52,18 @@ module ccpp_scheme_simultator ! Host-model initial time information integer :: init_year, init_month, init_day, init_hour, init_min, init_sec - public ccpp_scheme_simultator_init, ccpp_scheme_simultator_run + public ccpp_scheme_ccpp_scheme_simulator_init, ccpp_scheme_ccpp_scheme_simulator_run contains ! ###################################################################################### ! - ! SUBROUTINE ccpp_scheme_simultator_init + ! SUBROUTINE ccpp_scheme_ccpp_scheme_simulator_init ! ! ###################################################################################### -!! \section arg_table_ccpp_scheme_simultator_init -!! \htmlinclude ccpp_scheme_simultator_init.html +!! \section arg_table_ccpp_scheme_ccpp_scheme_simulator_init +!! \htmlinclude ccpp_scheme_ccpp_scheme_simulator_init.html !! - subroutine ccpp_scheme_simultator_init(me, master, nlunit, nml_file, idat, errmsg, errflg) + subroutine ccpp_scheme_ccpp_scheme_simulator_init(me, master, nlunit, nml_file, idat, errmsg, errflg) ! Inputs integer, intent (in) :: me, master, nlunit @@ -331,17 +331,17 @@ subroutine ccpp_scheme_simultator_init(me, master, nlunit, nml_file, idat, errms print*, "---------------------------------" endif - end subroutine ccpp_scheme_simultator_init + end subroutine ccpp_scheme_ccpp_scheme_simulator_init ! ###################################################################################### ! - ! SUBROUTINE ccpp_scheme_simultator_run + ! SUBROUTINE ccpp_scheme_ccpp_scheme_simulator_run ! ! ###################################################################################### -!! \section arg_table_ccpp_scheme_simultator_run -!! \htmlinclude ccpp_scheme_simultator_run.html +!! \section arg_table_ccpp_scheme_ccpp_scheme_simulator_run +!! \htmlinclude ccpp_scheme_ccpp_scheme_simulator_run.html !! - subroutine ccpp_scheme_simultator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & + subroutine ccpp_scheme_ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & dtend, index_of_process_dcnv, index_of_process_longwave, & index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & @@ -588,6 +588,6 @@ subroutine ccpp_scheme_simultator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, q enddo ! columns ! - end subroutine ccpp_scheme_simultator_run + end subroutine ccpp_scheme_ccpp_scheme_simulator_run -end module ccpp_scheme_simultator +end module ccpp_scheme_ccpp_scheme_simulator diff --git a/physics/ccpp_scheme_simultator.meta b/physics/ccpp_scheme_simulator.meta similarity index 98% rename from physics/ccpp_scheme_simultator.meta rename to physics/ccpp_scheme_simulator.meta index e60248721..cad1bd7ed 100644 --- a/physics/ccpp_scheme_simultator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -1,11 +1,11 @@ [ccpp-table-properties] - name = ccpp_scheme_simultator + name = ccpp_scheme_ccpp_scheme_simulator type = scheme dependencies = machine.F ######################################################################## [ccpp-arg-table] - name = ccpp_scheme_simultator_init + name = ccpp_scheme_ccpp_scheme_simulator_init type = scheme [me] standard_name = mpi_rank @@ -61,7 +61,7 @@ ######################################################################## [ccpp-arg-table] - name = ccpp_scheme_simultator_run + name = ccpp_scheme_ccpp_scheme_simulator_run type = scheme [solhr] standard_name = forecast_utc_hour From ef0d369f607aa78908ac1a3687236ee7468f0fc6 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Tue, 31 Jan 2023 15:02:09 -0700 Subject: [PATCH 009/249] Added MPI commands to ccpp_scheme_simulator --- physics/ccpp_scheme_simulator.F90 | 534 ++++++++++++++++++++--------- physics/ccpp_scheme_simulator.meta | 17 +- 2 files changed, 382 insertions(+), 169 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 2954e3759..8289db769 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -3,9 +3,13 @@ ! CCPP scheme to replace physics schemes with simulated data tendencies. ! ! ######################################################################################## -module ccpp_scheme_ccpp_scheme_simulator +module ccpp_scheme_simulator use machine, only: kind_phys use netcdf +#ifdef MPI + use mpi +#endif + implicit none ! @@ -52,21 +56,21 @@ module ccpp_scheme_ccpp_scheme_simulator ! Host-model initial time information integer :: init_year, init_month, init_day, init_hour, init_min, init_sec - public ccpp_scheme_ccpp_scheme_simulator_init, ccpp_scheme_ccpp_scheme_simulator_run + public ccpp_scheme_simulator_init, ccpp_scheme_simulator_run contains ! ###################################################################################### ! - ! SUBROUTINE ccpp_scheme_ccpp_scheme_simulator_init + ! SUBROUTINE ccpp_scheme_simulator_init ! ! ###################################################################################### -!! \section arg_table_ccpp_scheme_ccpp_scheme_simulator_init -!! \htmlinclude ccpp_scheme_ccpp_scheme_simulator_init.html +!! \section arg_table_ccpp_scheme_simulator_init +!! \htmlinclude ccpp_scheme_simulator_init.html !! - subroutine ccpp_scheme_ccpp_scheme_simulator_init(me, master, nlunit, nml_file, idat, errmsg, errflg) + subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_file, idat, errmsg, errflg) ! Inputs - integer, intent (in) :: me, master, nlunit + integer, intent (in) :: mpirank, mpiroot, mpicomm, nlunit character(len=*), intent (in) :: nml_file integer, intent (in), dimension(8) :: idat @@ -75,7 +79,7 @@ subroutine ccpp_scheme_ccpp_scheme_simulator_init(me, master, nlunit, nml_file, integer, intent(out) :: errflg ! Local variables - integer :: ncid, dimID, varID, status, nlon, nlat, nlev, ntime, ios + integer :: ncid, dimID, varID, status, nlon, nlat, nlev_data, ntime_data, ios character(len=256) :: fileIN logical :: exists integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality @@ -97,7 +101,11 @@ subroutine ccpp_scheme_ccpp_scheme_simulator_init(me, master, nlunit, nml_file, init_min = idat(6) init_sec = idat(7) + ! ###################################################################################### + ! ! Read in namelist + ! + ! ###################################################################################### inquire (file = trim (nml_file), exist = exists) if (.not. exists) then errmsg = 'SCM data tendency :: namelist file: '//trim(nml_file)//' does not exist' @@ -110,6 +118,12 @@ subroutine ccpp_scheme_ccpp_scheme_simulator_init(me, master, nlunit, nml_file, read (nlunit, nml = scm_data_nml) close (nlunit) + + ! ###################################################################################### + ! + ! Error checking + ! + ! ###################################################################################### ! Only proceed if scheme simulator requested. if (use_RAD_scheme_sim .or. use_PBL_scheme_sim .or. use_GWD_scheme_sim .or. & use_SCNV_scheme_sim .or. use_DCNV_scheme_sim .or. use_cldMP_scheme_sim) then @@ -126,180 +140,372 @@ subroutine ccpp_scheme_ccpp_scheme_simulator_init(me, master, nlunit, nml_file, return endif - ! Open file (required) - status = nf90_open(trim(fileIN), NF90_NOWRITE, ncid) - if (status /= nf90_noerr) then - errmsg = 'Error reading in SCM data tendency file: '//trim(fileIN) - errflg = 1 - return - endif + ! ####################################################################################### + ! + ! Read mandatory information from data file... + ! (ONLY master processor(0), if MPI enabled) + ! + ! ####################################################################################### +#ifdef MPI + if (mpirank .eq. mpiroot) then +#endif + + ! Open file (required) + status = nf90_open(trim(fileIN), NF90_NOWRITE, ncid) + if (status /= nf90_noerr) then + errmsg = 'Error reading in SCM data tendency file: '//trim(fileIN) + errflg = 1 + return + endif + + ! Get dimensions (required) + status = nf90_inq_dimid(ncid, 'time', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [time] dimension' + errflg = 1 + return + endif + ! + status = nf90_inq_dimid(ncid, 'lev', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [lev] dimension' + errflg = 1 + return + endif +#ifdef MPI + endif ! On master processor - ! Get dimensions (required) - status = nf90_inq_dimid(ncid, 'time', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = ntime) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain time dimension' - errflg = 1 - return - endif + ! Other processors waiting... + call mpi_barrier(mpicomm, mpierr) + + ! ####################################################################################### ! - status = nf90_inq_dimid(ncid, 'lev', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = nlev) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain lev dimension' - errflg = 1 - return - endif + ! Broadcast dimensions... + ! (ALL processors) + ! + ! ####################################################################################### + call mpi_bcast(ntime_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) + call mpi_bcast(nlev_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) + call mpi_barrier(mpicomm, mpierr) + + if (mpirank .eq. mpiroot) then +#endif + + ! #################################################################################### + ! + ! What data fields do we have? + ! + ! #################################################################################### + + ! Temporal info (required) + status = nf90_inq_varid(ncid, 'times', varID) + if (status /= nf90_noerr) then + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' + errflg = 1 + return + endif - ! Temporal info (required) - status = nf90_inq_varid(ncid, 'times', varID) - if (status == nf90_noerr) then - allocate(time_data(ntime)) - status = nf90_get_var( ncid, varID, time_data) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' - errflg = 1 - return - endif + ! Physics tendencies + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) then + have_dTdt_LWRAD_data = .true. + endif + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) then + have_dTdt_SWRAD_data = .true. + endif + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) then + have_dTdt_PBL_data = .true. + endif + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) then + have_dqdt_PBL_data = .true. + endif + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) then + have_dudt_PBL_data = .true. + endif + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) then + have_dvdt_PBL_data = .true. + endif + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) then + have_dTdt_GWD_data = .true. + endif + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) then + have_dudt_GWD_data = .true. + endif + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) then + have_dvdt_GWD_data = .true. + endif + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) then + have_dTdt_SCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) then + have_dudt_SCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) then + have_dvdt_SCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) then + have_dqdt_SCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) then + have_dTdt_DCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) then + have_dudt_DCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) then + have_dvdt_DCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) then + have_dqdt_DCNV_data = .true. + endif + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) then + have_dTdt_cldMP_data = .true. + endif + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) then + have_dqdt_cldMP_data = .true. + endif - ! Read in physics data tendencies (optional) - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) then - allocate(dTdt_LWRAD_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) - have_dTdt_LWRAD_data = .true. - endif +#ifdef MPI + endif ! Master process +#endif + + ! Allocate space for data + allocate(time_data(ntime_data)) + if (have_dTdt_LWRAD_data) allocate(dTdt_LWRAD_data(nlev_data, ntime_data)) + if (have_dTdt_SWRAD_data) allocate(dTdt_SWRAD_data(nlev_data, ntime_data)) + if (have_dTdt_PBL_data) allocate(dTdt_PBL_data( nlev_data, ntime_data)) + if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data, nTrc)) + if (have_dudt_PBL_data) allocate(dudt_PBL_data( nlev_data, ntime_data)) + if (have_dvdt_PBL_data) allocate(dvdt_PBL_data( nlev_data, ntime_data)) + if (have_dTdt_GWD_data) allocate(dTdt_GWD_data( nlev_data, ntime_data)) + if (have_dudt_GWD_data) allocate(dudt_GWD_data( nlev_data, ntime_data)) + if (have_dvdt_GWD_data) allocate(dvdt_GWD_data( nlev_data, ntime_data)) + if (have_dTdt_SCNV_data) allocate(dTdt_SCNV_data( nlev_data, ntime_data)) + if (have_dudt_SCNV_data) allocate(dudt_SCNV_data( nlev_data, ntime_data)) + if (have_dvdt_SCNV_data) allocate(dvdt_SCNV_data( nlev_data, ntime_data)) + if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data, nTrc)) + if (have_dTdt_DCNV_data) allocate(dTdt_DCNV_data( nlev_data, ntime_data)) + if (have_dudt_DCNV_data) allocate(dudt_DCNV_data( nlev_data, ntime_data)) + if (have_dvdt_DCNV_data) allocate(dvdt_DCNV_data( nlev_data, ntime_data)) + if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data, nTrc)) + if (have_dTdt_cldMP_data) allocate(dTdt_cldMP_data(nlev_data, ntime_data)) + if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data, nTrc)) + + ! ####################################################################################### ! - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) then - allocate(dTdt_SWRAD_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) - have_dTdt_SWRAD_data = .true. - endif + ! Read in data ... + ! (ONLY master processor(0), if MPI enabled) ! - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) then - allocate(dTdt_PBL_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dTdt_PBL_data) - have_dTdt_PBL_data = .true. - endif + ! ####################################################################################### +#ifdef MPI + if (mpirank .eq. mpiroot) then +#endif + + ! Temporal info (required) + status = nf90_inq_varid(ncid, 'times', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, time_data) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' + errflg = 1 + return + endif + + ! Read in physics data tendencies (optional) + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dTdt_PBL_data) + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dqdt_PBL_data) + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dudt_PBL_data) + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dvdt_PBL_data) + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dTdt_GWD_data) + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dudt_GWD_data) + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dvdt_GWD_data) + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dTdt_SCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dudt_SCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dvdt_SCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dqdt_SCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dTdt_DCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dudt_DCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dvdt_DCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dqdt_DCNV_data) + endif + ! + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dTdt_cldMP_data) + endif + ! + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, dqdt_cldMP_data) + endif + ! + status = nf90_close(ncid) +#ifdef MPI + endif ! Master process + + ! Other processors waiting... + call mpi_barrier(mpicomm, mpierr) + ! ####################################################################################### ! - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) then - allocate(dqdt_PBL_data(nlev, ntime, nTrc)) - status = nf90_get_var( ncid, varID, dqdt_PBL_data) - have_dqdt_PBL_data = .true. - endif + ! Broadcast data... + ! (ALL processors) ! - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) then - allocate(dudt_PBL_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dudt_PBL_data) - have_dudt_PBL_data = .true. + ! ####################################################################################### + + if (have_dTdt_LWRAD_data) then + call mpi_bcast(dTdt_LWRAD_data, size(dTdt_LWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) then - allocate(dvdt_PBL_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dvdt_PBL_data) - have_dvdt_PBL_data = .true. + if (have_dTdt_SWRAD_data) then + call mpi_bcast(dTdt_SWRAD_data, size(dTdt_SWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) then - allocate(dTdt_GWD_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dTdt_GWD_data) - have_dTdt_GWD_data = .true. + if (have_dTdt_PBL_data) then + call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) then - allocate(dudt_GWD_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dudt_GWD_data) - have_dudt_GWD_data = .true. + if (have_dqdt_PBL_data) then + call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) then - allocate(dvdt_GWD_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dvdt_GWD_data) - have_dvdt_GWD_data = .true. + if (have_dudt_PBL_data) then + call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) then - allocate(dTdt_SCNV_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dTdt_SCNV_data) - have_dTdt_SCNV_data = .true. + if (have_dvdt_PBL_data) then + call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) then - allocate(dudt_SCNV_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dudt_SCNV_data) - have_dudt_SCNV_data = .true. + if (have_dTdt_GWD_data) then + call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) then - allocate(dvdt_SCNV_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dvdt_SCNV_data) - have_dvdt_SCNV_data = .true. + if (have_dudt_GWD_data) then + call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) then - allocate(dqdt_SCNV_data(nlev, ntime, nTrc)) - status = nf90_get_var( ncid, varID, dqdt_SCNV_data) - have_dqdt_SCNV_data = .true. + if (have_dvdt_GWD_data) then + call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) then - allocate(dTdt_DCNV_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dTdt_DCNV_data) - have_dTdt_DCNV_data = .true. + if (have_dTdt_SCNV_data) then + call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) then - allocate(dudt_DCNV_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dudt_DCNV_data) - have_dudt_DCNV_data = .true. + if (have_dudt_SCNV_data) then + call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) then - allocate(dvdt_DCNV_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dvdt_DCNV_data) - have_dvdt_DCNV_data = .true. + if (have_dvdt_SCNV_data) then + call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) then - allocate(dqdt_DCNV_data(nlev, ntime, nTrc)) - status = nf90_get_var( ncid, varID, dqdt_DCNV_data) - have_dqdt_DCNV_data = .true. + if (have_dqdt_SCNV_data) then + call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) then - allocate(dTdt_cldMP_data(nlev, ntime)) - status = nf90_get_var( ncid, varID, dTdt_cldMP_data) - have_dTdt_cldMP_data = .true. + if (have_dTdt_DCNV_data) then + call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) then - allocate(dqdt_cldMP_data(nlev, ntime, nTrc)) - status = nf90_get_var( ncid, varID, dqdt_cldMP_data) - have_dqdt_cldMP_data = .true. + if (have_dudt_DCNV_data) then + call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_DCNV_data) then + call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif + if (have_dqdt_DCNV_data) then + call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_cldMP_data) then + call mpi_bcast(dTdt_cldMP_data, size(dTdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_cldMP_data) then + call mpi_bcast(dqdt_cldMP_data, size(dqdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + + ! + call mpi_barrier(mpicomm, mpierr) +#endif ! - if (me == 0) then + if (mpirank .eq. mpiroot) then print*, "--- Using SCM data tendencies ---" print*, "---------------------------------" print*, " " @@ -331,17 +537,17 @@ subroutine ccpp_scheme_ccpp_scheme_simulator_init(me, master, nlunit, nml_file, print*, "---------------------------------" endif - end subroutine ccpp_scheme_ccpp_scheme_simulator_init + end subroutine ccpp_scheme_simulator_init ! ###################################################################################### ! - ! SUBROUTINE ccpp_scheme_ccpp_scheme_simulator_run + ! SUBROUTINE ccpp_scheme_simulator_run ! ! ###################################################################################### -!! \section arg_table_ccpp_scheme_ccpp_scheme_simulator_run -!! \htmlinclude ccpp_scheme_ccpp_scheme_simulator_run.html +!! \section arg_table_ccpp_scheme_simulator_run +!! \htmlinclude ccpp_scheme_simulator_run.html !! - subroutine ccpp_scheme_ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & + subroutine ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & dtend, index_of_process_dcnv, index_of_process_longwave, & index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & @@ -588,6 +794,6 @@ subroutine ccpp_scheme_ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ug enddo ! columns ! - end subroutine ccpp_scheme_ccpp_scheme_simulator_run + end subroutine ccpp_scheme_simulator_run -end module ccpp_scheme_ccpp_scheme_simulator +end module ccpp_scheme_simulator diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index cad1bd7ed..909089bb9 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -1,26 +1,33 @@ [ccpp-table-properties] - name = ccpp_scheme_ccpp_scheme_simulator + name = ccpp_scheme_simulator type = scheme dependencies = machine.F ######################################################################## [ccpp-arg-table] - name = ccpp_scheme_ccpp_scheme_simulator_init + name = ccpp_scheme_simulator_init type = scheme -[me] +[mpirank] standard_name = mpi_rank long_name = MPI rank of current process units = index dimensions = () type = integer intent = in -[master] +[mpiroot] standard_name = mpi_root long_name = MPI rank of master process units = index dimensions = () type = integer intent = in +[mpicomm] + standard_name = mpi_communicator + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in [nlunit] standard_name = iounit_of_namelist long_name = fortran unit number for opening nameliust file @@ -61,7 +68,7 @@ ######################################################################## [ccpp-arg-table] - name = ccpp_scheme_ccpp_scheme_simulator_run + name = ccpp_scheme_simulator_run type = scheme [solhr] standard_name = forecast_utc_hour From fd72b355bc99486bda0aff5d5a1c78f835756938 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Fri, 3 Feb 2023 10:27:05 -0700 Subject: [PATCH 010/249] Work in progress... --- physics/ccpp_scheme_simulator.F90 | 821 +++++++++++++++-------------- physics/ccpp_scheme_simulator.meta | 8 - 2 files changed, 416 insertions(+), 413 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 8289db769..258687416 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -2,6 +2,8 @@ ! ! CCPP scheme to replace physics schemes with simulated data tendencies. ! +! Description: +! ! ######################################################################################## module ccpp_scheme_simulator use machine, only: kind_phys @@ -9,50 +11,118 @@ module ccpp_scheme_simulator #ifdef MPI use mpi #endif - implicit none + ! Avaialble physics processes to simulate. + integer,parameter :: & + nPhysProcess = 7 + + ! Type containing physics tendencies for a physics process. + type phys_tend + real(kind_phys), dimension(:,:), pointer :: T + real(kind_phys), dimension(:,:), pointer :: u + real(kind_phys), dimension(:,:), pointer :: v + real(kind_phys), dimension(:,:,:), pointer :: q + end type phys_tend + + ! This type contains the meta information and data for each physics process. + type base_physics_process + character(len=16) :: name + logical :: time_split + logical :: use_sim + integer :: order + type(phys_tend) :: tend + end type base_physics_process + + ! This array contains the governing information on how to advance the physics timestep. + type(base_physics_process),dimension(nPhysProcess) :: & + physics_process + + ! ######################################################################################## + ! + ! Configuration for CCPP scheme simulator. Set in namelist. Used during initialization to + ! populate "physics_processes" type array. + ! + ! ######################################################################################## + + ! Set which schemes to be replaced with simulated tendencies. + logical :: use_LWRAD_scheme_sim = .false., & !< If true, use LongWave RADiation scheme simulator. + !< If false, use tendencies from radiation scheme. + use_SWRAD_scheme_sim = .false., & !< If true, use ShortWave RADiation scheme simulator. + !< If false, use tendencies from radiation scheme. + use_PBL_scheme_sim = .false., & !< If true, use Planetary Boubdary Layer scheme simulator. + !< If false, use tendencies from PBL scheme. + use_GWD_scheme_sim = .false., & !< If true, use Gravity Wave Drag scheme simulator. + !< If false, use tendencies from GWD scheme. + use_SCNV_scheme_sim = .false., & !< If true, use Shallow CoNVection scheme simulator. + !< If false, use tendencies from SCNV scheme. + use_DCNV_scheme_sim = .false., & !< If true, use Deep CoNVection scheme simulator. + !< If false, use tendencies from DCNV scheme. + use_cldMP_scheme_sim = .false. !< If true, use cloud MicroPhysics scheme simulator. + !< If false, use tendencies from cldMP acheme. + + ! Are the processes time-split or process-split? + logical :: time_split_LWRAD = .false., & !< If true, time-split process. Update internal physics state prior to scheme. + !< If false, process-split process. Accumulate tendencies. + time_split_SWRAD = .false., & !< If true, time-split process. Update internal physics state prior to scheme. + !< If false, process-split process. Accumulate tendencies. + time_split_PBL = .false., & !< If true, time-split process. Update internal physics state prior to scheme. + !< If false, process-split process. Accumulate tendencies. + time_split_GWD = .false., & !< If true, time-split process. Update internal physics state prior to scheme. + !< If false, process-split process. Accumulate tendencies. + time_split_SCNV = .true., & !< If true, time-split process. Update internal physics state prior to scheme. + !< If false, process-split process. Accumulate tendencies. + time_split_DCNV = .true., & !< If true, time-split process. Update internal physics state prior to scheme. + !< If false, process-split process. Accumulate tendencies. + time_split_cldMP = .true. !< If true, time-split process. Update internal physics state prior to scheme. + !< If false, process-split process. Accumulate tendencies. + + ! What is physics process ordering? (Important if their are time-split processes in the physics scheme) + integer :: scheme_order_SWRAD = 1, & !< Order of Radiation scheme (shortwave). + scheme_order_LWRAD = 2, & !< Order of Radiation scheme (longwave). + scheme_order_PBL = 3, & !< Order of Planetary Boubdary Layer scheme. + scheme_order_GWD = 4, & !< Order of Gravity Wave Drag scheme. + scheme_order_SCNV = 5, & !< Order of Shallow CoNVection scheme. + scheme_order_DCNV = 6, & !< Order of Deep CoNVection scheme. + scheme_order_cldMP = 7 !< Order of cloud MicroPhysics scheme. ! - ! Data driven phsyics tendencies + ! Locals ! + + ! Activation flag for scheme. + logical :: do_ccpp_scheme_simulator = .false. + + ! Switches for input data + logical :: have_dTdt_LWRAD_data = .false., & !< If true, input file contains LongWave RADiation temperature tendencies. + have_dTdt_SWRAD_data = .false., & !< If true, input file contains ShortWave RADiation temperature tendencies. + have_dTdt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer temperature tendencies. + have_dqdt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer specific-humidity tendencies. + have_dudt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer zonal-wind tendencies. + have_dvdt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer meridional-wind tendencies. + have_dTdt_GWD_data = .false., & !< If true, input file contains Gravity Wave Drag temperature tendencies. + have_dudt_GWD_data = .false., & !< If true, input file contains Gravity Wave Drag zonal-wind tendencies. + have_dvdt_GWD_data = .false., & !< If true, input file contains Gravity Wave Drag meridional-wind tendencies. + have_dTdt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection temperature tendencies. + have_dudt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection zonal-wind tendencies. + have_dvdt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection meridional-wind tendencies. + have_dqdt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection specific-humidity tendencies. + have_dTdt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection temperature tendencies. + have_dudt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection zonal-wind tendencies. + have_dvdt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection meridional-wind tendencies. + have_dqdt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection specific-humidity tendencies. + have_dTdt_cldMP_data = .false., & !< If true, input file contains cloud MicroPhysics temperature tendencies. + have_dqdt_cldMP_data = .false. !< If true, input file contains cloud MicroPhysics specific-humidity tendencies. + + ! Data driven physics tendencies + integer :: nlev_data, ntime_data real(kind_phys), allocatable, dimension(:) :: time_data - real(kind_phys), allocatable, dimension(:,:) :: dTdt_LWRAD_data, dTdt_SWRAD_data, & + real(kind_phys), allocatable, dimension(:,:),target :: dTdt_LWRAD_data, dTdt_SWRAD_data, & dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, dudt_GWD_data, & dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, dTdt_DCNV_data, & dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data - real(kind_phys), allocatable, dimension(:,:,:) :: dqdt_PBL_data, dqdt_SCNV_data, & + real(kind_phys), allocatable, dimension(:,:,:),target :: dqdt_PBL_data, dqdt_SCNV_data, & dqdt_DCNV_data, dqdt_cldMP_data - ! - ! Logical switches for CCPP scheme simulator(s) - ! - logical :: use_RAD_scheme_sim = .false., & - use_PBL_scheme_sim = .false., & - use_GWD_scheme_sim = .false., & - use_SCNV_scheme_sim = .false., & - use_DCNV_scheme_sim = .false., & - use_cldMP_scheme_sim = .false. - logical :: have_dTdt_LWRAD_data = .false., & - have_dTdt_SWRAD_data = .false., & - have_dTdt_PBL_data = .false., & - have_dqdt_PBL_data = .false., & - have_dudt_PBL_data = .false., & - have_dvdt_PBL_data = .false., & - have_dTdt_GWD_data = .false., & - have_dudt_GWD_data = .false., & - have_dvdt_GWD_data = .false., & - have_dTdt_SCNV_data = .false., & - have_dudt_SCNV_data = .false., & - have_dvdt_SCNV_data = .false., & - have_dqdt_SCNV_data = .false., & - have_dTdt_DCNV_data = .false., & - have_dudt_DCNV_data = .false., & - have_dvdt_DCNV_data = .false., & - have_dqdt_DCNV_data = .false., & - have_dTdt_cldMP_data = .false., & - have_dqdt_cldMP_data = .false. - logical :: do_ccpp_scheme_simulator = .false. - ! Host-model initial time information integer :: init_year, init_month, init_day, init_hour, init_min, init_sec @@ -67,7 +137,8 @@ module ccpp_scheme_simulator !! \section arg_table_ccpp_scheme_simulator_init !! \htmlinclude ccpp_scheme_simulator_init.html !! - subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_file, idat, errmsg, errflg) + subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_file, & + idat, errmsg, errflg) ! Inputs integer, intent (in) :: mpirank, mpiroot, mpicomm, nlunit @@ -79,15 +150,19 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil integer, intent(out) :: errflg ! Local variables - integer :: ncid, dimID, varID, status, nlon, nlat, nlev_data, ntime_data, ios + integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc character(len=256) :: fileIN logical :: exists integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality ! Namelist - namelist / scm_data_nml / & - fileIN, use_RAD_scheme_sim, use_PBL_scheme_sim, use_GWD_scheme_sim, use_SCNV_scheme_sim, & - use_DCNV_scheme_sim, use_cldMP_scheme_sim + namelist / scm_data_nml / fileIN, & + use_SWRAD_scheme_sim, use_LWRAD_scheme_sim, use_PBL_scheme_sim, & + use_GWD_scheme_sim, use_SCNV_scheme_sim, use_DCNV_scheme_sim, & + use_cldMP_scheme_sim, scheme_order_SWRAD, scheme_order_LWRAD, scheme_order_PBL, & + scheme_order_GWD, scheme_order_SCNV, scheme_order_DCNV, scheme_order_cldMP, & + time_split_SWRAD, time_split_LWRAD, time_split_PBL, time_split_GWD, & + time_split_SCNV, time_split_DCNV, time_split_cldMP ! Initialize CCPP error handling variables errmsg = '' @@ -118,27 +193,27 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil read (nlunit, nml = scm_data_nml) close (nlunit) - ! ###################################################################################### ! ! Error checking ! ! ###################################################################################### ! Only proceed if scheme simulator requested. - if (use_RAD_scheme_sim .or. use_PBL_scheme_sim .or. use_GWD_scheme_sim .or. & - use_SCNV_scheme_sim .or. use_DCNV_scheme_sim .or. use_cldMP_scheme_sim) then + if (use_SWRAD_scheme_sim .or. use_LWRAD_scheme_sim .or. use_PBL_scheme_sim .or. & + use_GWD_scheme_sim .or. use_SCNV_scheme_sim .or. use_DCNV_scheme_sim .or. & + use_cldMP_scheme_sim) then do_ccpp_scheme_simulator = .true. else return endif - + ! Check that input data file exists inquire (file = trim (fileIN), exist = exists) if (.not. exists) then - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not exist' - errflg = 1 - return - endif + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not exist' + errflg = 1 + return + endif ! ####################################################################################### ! @@ -201,91 +276,63 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil ! ! #################################################################################### - ! Temporal info (required) - status = nf90_inq_varid(ncid, 'times', varID) - if (status /= nf90_noerr) then - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' - errflg = 1 - return - endif - - ! Physics tendencies + ! status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) then - have_dTdt_LWRAD_data = .true. - endif + if (status == nf90_noerr) have_dTdt_LWRAD_data = .true. + ! status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) then - have_dTdt_SWRAD_data = .true. - endif + if (status == nf90_noerr) have_dTdt_SWRAD_data = .true. + ! status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) then - have_dTdt_PBL_data = .true. - endif + if (status == nf90_noerr) have_dTdt_PBL_data = .true. + ! status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) then - have_dqdt_PBL_data = .true. - endif + if (status == nf90_noerr) have_dqdt_PBL_data = .true. + ! status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) then - have_dudt_PBL_data = .true. - endif + if (status == nf90_noerr) have_dudt_PBL_data = .true. + ! status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) then - have_dvdt_PBL_data = .true. - endif + if (status == nf90_noerr) have_dvdt_PBL_data = .true. + ! status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) then - have_dTdt_GWD_data = .true. - endif + if (status == nf90_noerr) have_dTdt_GWD_data = .true. + ! status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) then - have_dudt_GWD_data = .true. - endif + if (status == nf90_noerr) have_dudt_GWD_data = .true. + ! status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) then - have_dvdt_GWD_data = .true. - endif + if (status == nf90_noerr) have_dvdt_GWD_data = .true. + ! status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) then - have_dTdt_SCNV_data = .true. - endif + if (status == nf90_noerr) have_dTdt_SCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) then - have_dudt_SCNV_data = .true. - endif + if (status == nf90_noerr) have_dudt_SCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) then - have_dvdt_SCNV_data = .true. - endif + if (status == nf90_noerr) have_dvdt_SCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) then - have_dqdt_SCNV_data = .true. - endif + if (status == nf90_noerr) have_dqdt_SCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) then - have_dTdt_DCNV_data = .true. - endif + if (status == nf90_noerr) have_dTdt_DCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) then - have_dudt_DCNV_data = .true. - endif + if (status == nf90_noerr) have_dudt_DCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) then - have_dvdt_DCNV_data = .true. - endif + if (status == nf90_noerr) have_dvdt_DCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) then - have_dqdt_DCNV_data = .true. - endif + if (status == nf90_noerr) have_dqdt_DCNV_data = .true. + ! status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) then - have_dTdt_cldMP_data = .true. - endif + if (status == nf90_noerr) have_dTdt_cldMP_data = .true. + ! status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) then - have_dqdt_cldMP_data = .true. - endif + if (status == nf90_noerr) have_dqdt_cldMP_data = .true. #ifdef MPI endif ! Master process @@ -335,101 +382,64 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil ! Read in physics data tendencies (optional) status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) ! status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) ! status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dTdt_PBL_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_PBL_data) ! status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dqdt_PBL_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_PBL_data) ! status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dudt_PBL_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_PBL_data) ! status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dvdt_PBL_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_PBL_data) ! status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dTdt_GWD_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_GWD_data) ! status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dudt_GWD_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_GWD_data) ! status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dvdt_GWD_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_GWD_data) ! status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dTdt_SCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SCNV_data) ! status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dudt_SCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_SCNV_data) ! status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dvdt_SCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_SCNV_data) ! status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dqdt_SCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_SCNV_data) ! status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dTdt_DCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_DCNV_data) ! status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dudt_DCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_DCNV_data) ! status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dvdt_DCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_DCNV_data) ! status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dqdt_DCNV_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_DCNV_data) ! status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dTdt_cldMP_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_cldMP_data) ! status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, dqdt_cldMP_data) - endif + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_cldMP_data) ! status = nf90_close(ncid) + #ifdef MPI endif ! Master process @@ -449,49 +459,49 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil call mpi_bcast(dTdt_SWRAD_data, size(dTdt_SWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dTdt_PBL_data) then - call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dqdt_PBL_data) then - call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dudt_PBL_data) then - call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dvdt_PBL_data) then - call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dTdt_GWD_data) then - call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dudt_GWD_data) then - call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dvdt_GWD_data) then - call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dTdt_SCNV_data) then - call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dudt_SCNV_data) then - call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dvdt_SCNV_data) then - call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dqdt_SCNV_data) then - call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dTdt_DCNV_data) then - call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dudt_DCNV_data) then - call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dvdt_DCNV_data) then - call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dqdt_DCNV_data) then - call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif if (have_dTdt_cldMP_data) then call mpi_bcast(dTdt_cldMP_data, size(dTdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) @@ -499,41 +509,94 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil if (have_dqdt_cldMP_data) then call mpi_bcast(dqdt_cldMP_data, size(dqdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) endif - ! call mpi_barrier(mpicomm, mpierr) #endif + ! ####################################################################################### + ! + ! Populate physics_process type. + ! + ! ####################################################################################### + + ! Metadata + do iprc = 1,nPhysProcess + if (iprc == scheme_order_SWRAD) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "SWRAD" + physics_process(iprc)%use_sim = use_SWRAD_scheme_sim + physics_process(iprc)%time_split = time_split_SWRAD + endif + if (iprc == scheme_order_LWRAD) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "LWRAD" + physics_process(iprc)%use_sim = use_LWRAD_scheme_sim + physics_process(iprc)%time_split = time_split_LWRAD + endif + if (iprc == scheme_order_GWD) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "GWD" + physics_process(iprc)%use_sim = use_GWD_scheme_sim + physics_process(iprc)%time_split = time_split_GWD + endif + if (iprc == scheme_order_PBL) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "PBL" + physics_process(iprc)%use_sim = use_PBL_scheme_sim + physics_process(iprc)%time_split = time_split_PBL + endif + if (iprc == scheme_order_SCNV) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "SCNV" + physics_process(iprc)%use_sim = use_SCNV_scheme_sim + physics_process(iprc)%time_split = time_split_SCNV + endif + if (iprc == scheme_order_DCNV) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "DCNV" + physics_process(iprc)%use_sim = use_DCNV_scheme_sim + physics_process(iprc)%time_split = time_split_DCNV + endif + if (iprc == scheme_order_cldMP) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "cldMP" + physics_process(iprc)%use_sim = use_cldMP_scheme_sim + physics_process(iprc)%time_split = time_split_cldMP + endif + enddo + + ! Data + if (have_dTdt_LWRAD_data) physics_process(scheme_order_LWRAD)%tend%T => dTdt_LWRAD_data + if (have_dTdt_SWRAD_data) physics_process(scheme_order_SWRAD)%tend%T => dTdt_SWRAD_data + if (have_dTdt_PBL_data) physics_process(scheme_order_PBL)%tend%T => dTdt_PBL_data + if (have_dudt_PBL_data) physics_process(scheme_order_PBL)%tend%u => dudt_PBL_data + if (have_dvdt_PBL_data) physics_process(scheme_order_PBL)%tend%v => dvdt_PBL_data + if (have_dqdt_PBL_data) physics_process(scheme_order_PBL)%tend%q => dqdt_PBL_data + if (have_dTdt_GWD_data) physics_process(scheme_order_GWD)%tend%T => dTdt_GWD_data + if (have_dudt_GWD_data) physics_process(scheme_order_GWD)%tend%u => dudt_GWD_data + if (have_dvdt_GWD_data) physics_process(scheme_order_GWD)%tend%v => dvdt_GWD_data + if (have_dTdt_SCNV_data) physics_process(scheme_order_SCNV)%tend%T => dTdt_SCNV_data + if (have_dudt_SCNV_data) physics_process(scheme_order_SCNV)%tend%u => dudt_SCNV_data + if (have_dvdt_SCNV_data) physics_process(scheme_order_SCNV)%tend%v => dvdt_SCNV_data + if (have_dqdt_SCNV_data) physics_process(scheme_order_SCNV)%tend%q => dqdt_SCNV_data + if (have_dTdt_DCNV_data) physics_process(scheme_order_DCNV)%tend%T => dTdt_DCNV_data + if (have_dudt_DCNV_data) physics_process(scheme_order_DCNV)%tend%u => dudt_DCNV_data + if (have_dvdt_DCNV_data) physics_process(scheme_order_DCNV)%tend%v => dvdt_DCNV_data + if (have_dqdt_DCNV_data) physics_process(scheme_order_DCNV)%tend%q => dqdt_DCNV_data + if (have_dTdt_cldMP_data) physics_process(scheme_order_cldMP)%tend%T => dTdt_cldMP_data + if (have_dqdt_cldMP_data) physics_process(scheme_order_cldMP)%tend%q => dqdt_cldMP_data + ! if (mpirank .eq. mpiroot) then - print*, "--- Using SCM data tendencies ---" + print*, "--- Using CCPP data tendencies ---" print*, "---------------------------------" print*, " " - print*, "use_RAD_scheme_sim: ", use_RAD_scheme_sim - print*, " dTdt_LWRAD_data: ", have_dTdt_LWRAD_data - print*, " dTdt_SWRAD_data: ", have_dTdt_SWRAD_data - print*, "use_PBL_scheme_sim: ", use_PBL_scheme_sim - print*, " dTdt_PBL_data: ", have_dTdt_PBL_data - print*, " dqdt_PBL_data: ", have_dqdt_PBL_data - print*, " dudt_PBL_data: ", have_dudt_PBL_data - print*, " dvdt_PBL_data: ", have_dvdt_PBL_data - print*, "use_GWD_scheme_sim: ", use_GWD_scheme_sim - print*, " dTdt_gwd_data: ", have_dTdt_GWD_data - print*, " dudt_gwd_data: ", have_dudt_GWD_data - print*, " dvdt_gwd_data: ", have_dvdt_GWD_data - print*, "use_SCNV_scheme_sim: ", use_SCNV_scheme_sim - print*, " dTdt_SCNV_data: ", have_dTdt_SCNV_data - print*, " dudt_SCNV_data: ", have_dudt_SCNV_data - print*, " dvdt_SCNV_data: ", have_dvdt_SCNV_data - print*, " dqdt_SCNV_data: ", have_dqdt_SCNV_data - print*, "use_DCNV_scheme_sim: ", use_DCNV_scheme_sim - print*, " dTdt_DCNV_data: ", have_dTdt_DCNV_data - print*, " dudt_DCNV_data: ", have_dudt_DCNV_data - print*, " dvdt_DCNV_data: ", have_dvdt_DCNV_data - print*, " dqdt_DCNV_data: ", have_dqdt_DCNV_data - print*, "use_cldMP_scheme_sim: ", use_cldMP_scheme_sim - print*, " dTdt_cldMP_data: ", have_dTdt_cldMP_data - print*, " dqdt_cldMP_data: ", have_dqdt_cldMP_data + do iprc = 1,nPhysProcess + print*,"Process : ", trim(physics_process(iprc)%name) + print*," order : ", physics_process(iprc)%order + print*," use_sim : ", physics_process(iprc)%use_sim + print*," time_split : ", physics_process(iprc)%time_split + enddo print*, "---------------------------------" endif @@ -547,7 +610,7 @@ end subroutine ccpp_scheme_simulator_init !! \section arg_table_ccpp_scheme_simulator_run !! \htmlinclude ccpp_scheme_simulator_run.html !! - subroutine ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & + subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & dtend, index_of_process_dcnv, index_of_process_longwave, & index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & @@ -555,28 +618,29 @@ subroutine ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qg errmsg, errflg) ! Inputs - integer, intent(in ) :: kdt - integer, intent (in), dimension(8) :: jdat - real(kind_phys), intent(in ) :: dtp, solhr - real(kind_phys), intent(in ), dimension(:,:) :: tgrs, ugrs, vgrs - real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs, dtend - integer, intent(in) :: dtidx(:,:), index_of_process_dcnv, index_of_process_longwave, & - index_of_process_shortwave, index_of_process_scnv, & + integer, intent(in) :: kdt, ntqv, index_of_process_dcnv, & + index_of_process_longwave, index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv + index_of_temperature, index_of_x_wind, index_of_y_wind + integer, intent(in), dimension(8) :: jdat + integer, intent(in), dimension(:,:) :: dtidx + real(kind_phys), intent(in) :: dtp + real(kind_phys), intent(in), dimension(:,:) :: tgrs, ugrs, vgrs + real(kind_phys), intent(in), dimension(:,:,:) :: qgrs, dtend ! Outputs real(kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 real(kind_phys), intent(inout), dimension(:,:,:) :: gq0 - character(len=*),intent(out ) :: errmsg - integer, intent(out ) :: errflg + character(len=*),intent(out) :: errmsg + integer, intent(out) :: errflg ! Locals integer :: iCol, iLay, iTrc, nCol, nLay, nTrc, ti(1), tf(1), idtend, fcst_year, & - fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec + fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, iprc, index_of_process real(kind_phys) :: w1, w2,hrofday - real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1 - real(kind_phys), dimension(:,:,:), allocatable :: gq1 + real(kind_phys), dimension(:), allocatable :: dT, du, dv, dq + real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1, dTdt, dudt, dvdt + real(kind_phys), dimension(:,:,:), allocatable :: gq1, dqdt ! Initialize CCPP error handling variables errmsg = '' @@ -596,9 +660,11 @@ subroutine ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qg nCol = size(gq0(:,1,1)) nLay = size(gq0(1,:,1)) nTrc = size(gq0(1,1,:)) - + ! Allocate temporaries allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay,1)) ! *only specific humidity to start (ntrc=1). + allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay,1)) + allocate(dT(nLay), du(nLay), dv(nLay), dq(nLay)) ! Determine temporal interpolation weights for data-tendecies. ! DJS: The data tendencies have a temporal dimension, to capture the diurnal cycle, @@ -610,190 +676,135 @@ subroutine ccpp_scheme_simulator_run(solhr, kdt, dtp, jdat, tgrs, ugrs, vgrs, qg w1 = (time_data(tf(1))-hrofday) / (time_data(tf(1)) - time_data(ti(1))) w2 = 1 - w1 - do iCol = 1,nCol - ! Set state - gt1(iCol,:) = tgrs(iCol,:) - gu1(iCol,:) = ugrs(iCol,:) - gv1(iCol,:) = vgrs(iCol,:) - gq1(iCol,:,1) = qgrs(iCol,:,1) - - ! ############################################################################### - ! Radiation - ! ############################################################################### - if (use_RAD_scheme_sim) then - if (have_dTdt_LWRAD_data) then - gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_LWRAD_data(:,ti(1)) + w2*dTdt_LWRAD_data(:,tf(1))) * dtp - endif - if (have_dTdt_SWRAD_data) then - gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_SWRAD_data(:,ti(1)) + w2*dTdt_SWRAD_data(:,tf(1))) * dtp - endif - else - idtend = dtidx(index_of_temperature,index_of_process_longwave) - if (idtend >= 1) then - gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_temperature,index_of_process_shortwave) - if (idtend >=1) then - gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - endif + ! + ! DJS BEGIN: This section will, eventually, replace the icol loop below, using the physics_process type. + ! - ! ############################################################################### - ! PBL - ! ############################################################################### - if (use_PBL_scheme_sim) then - if (have_dTdt_PBL_data) then - gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_PBL_data(:,ti(1)) + w2*(dTdt_PBL_data(:,tf(1)))) * dtp - endif - if (have_dudt_PBL_data) then - gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_PBL_data(:,ti(1)) + w2*(dudt_PBL_data(:,tf(1)))) * dtp - endif - if (have_dvdt_PBL_data) then - gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_PBL_data(:,ti(1)) + w2*(dvdt_PBL_data(:,tf(1)))) * dtp - endif - if (have_dqdt_PBL_data) then - gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_PBL_data(:,ti(1),1) + w2*(dqdt_PBL_data(:,tf(1),1))) * dtp - endif - else - idtend = dtidx(index_of_temperature,index_of_process_pbl) - if (idtend >= 1) then - gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_x_wind,index_of_process_pbl) - if (idtend >= 1) then - gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_y_wind,index_of_process_pbl) - if (idtend >= 1) then - gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(100+ntqv, index_of_process_pbl) - if (idtend >= 1) then - gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp + ! Set state + gt1(:,:) = tgrs(:,:) + gu1(:,:) = ugrs(:,:) + gv1(:,:) = vgrs(:,:) + gq1(:,:,1) = qgrs(:,:,1) + dTdt(:,:) = 0. + dudt(:,:) = 0. + dvdt(:,:) = 0. + dqdt(:,:,1)= 0. + do iCol = 1,nCol + do iprc = 1,nPhysProcess + + ! Using scheme simulator + if (physics_process(iprc)%use_sim) then + print*,"Using CCPP scheme simulator for ",trim(physics_process(iprc)%name) + + ! Temperature + if (associated(physics_process(iprc)%tend%T)) then + call interp_data_tend("T", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dT) + endif + + ! Zonal-wind + if (associated(physics_process(iprc)%tend%u)) then + call interp_data_tend("u", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, du) + endif + + ! Meridional-wind + if (associated(physics_process(iprc)%tend%v)) then + call interp_data_tend("v", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dv) + endif + + ! Specific-humidity + if (associated(physics_process(iprc)%tend%q)) then + call interp_data_tend("q", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dq) + endif + + ! Using data tendency from "active" scheme(s). + else + print*,"ACTIVE PHYSICS SCHEME: ",trim(physics_process(iprc)%name) + if (physics_process(iprc)%name == "LWRAD") index_of_process = index_of_process_longwave + if (physics_process(iprc)%name == "SWRAD") index_of_process = index_of_process_shortwave + if (physics_process(iprc)%name == "PBL") index_of_process = index_of_process_pbl + if (physics_process(iprc)%name == "GWD") index_of_process = index_of_process_orographic_gwd + if (physics_process(iprc)%name == "SCNV") index_of_process = index_of_process_scnv + if (physics_process(iprc)%name == "DCNV") index_of_process = index_of_process_dcnv + if (physics_process(iprc)%name == "cldMP") index_of_process = index_of_process_mp + ! + idtend = dtidx(index_of_temperature,index_of_process) + if (idtend >= 1) dT = dtend(iCol,:,idtend) + ! + idtend = dtidx(index_of_x_wind,index_of_process) + if (idtend >= 1) du = dtend(iCol,:,idtend) + ! + idtend = dtidx(index_of_y_wind,index_of_process) + if (idtend >= 1) dv = dtend(iCol,:,idtend) + ! + idtend = dtidx(100+ntqv,index_of_process) + if (idtend >= 1) dq = dtend(iCol,:,idtend) endif - endif + + ! Update state now? + if (physics_process(iprc)%time_split) then + gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + dT)*dtp + gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + du)*dtp + gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + dv)*dtp + gq1(iCol,:,1) = gq1(iCol,:,1) + (dqdt(iCol,:,1) + dq)*dtp + dTdt(iCol,:) = 0. + dudt(iCol,:) = 0. + dvdt(iCol,:) = 0. + dqdt(iCol,:,1) = 0. + ! Accumulate tendencies, update later? + else + dTdt(iCol,:) = dTdt(iCol,:) + dT + dudt(iCol,:) = dudt(iCol,:) + du + dvdt(iCol,:) = dvdt(iCol,:) + dv + dqdt(iCol,:,1) = dqdt(iCol,:,1) + dq + endif + enddo + ! + gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp + gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp + gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp + gq0(iCol,:,1) = gq1(iCol,:,1) + dqdt(iCol,:,1)*dtp + enddo + ! + end subroutine ccpp_scheme_simulator_run - ! ############################################################################### - ! Gravity wave drag - ! ############################################################################### - if (use_GWD_scheme_sim) then - if (have_dTdt_GWD_data) then - gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_GWD_data(:,ti(1)) + w2*(dTdt_GWD_data(:,tf(1)))) * dtp - endif - if (have_dudt_GWD_data) then - gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_GWD_data(:,ti(1)) + w2*(dudt_GWD_data(:,tf(1)))) * dtp - endif - if (have_dvdt_GWD_data) then - gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_GWD_data(:,ti(1)) + w2*(dvdt_GWD_data(:,tf(1)))) * dtp - endif - else - idtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) - if (idtend >= 1) then - gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) - if (idtend >= 1) then - gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) - if (idtend >= 1) then - gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - endif + ! #################################################################################### + ! Utility functions/routines + ! #################################################################################### + subroutine interp_data_tend(var_name, process_name, iprc, year, month, day, hour, minute, & + second, var_out) + ! Inputs + character(len=*), intent(in) :: var_name, process_name + integer, intent(in) :: year, month, day, hour, minute, second, iprc + + ! Outputs + real(kind_phys),dimension(:),intent(out) :: var_out - ! ############################################################################### - ! Shallow convection - ! ############################################################################### - if (use_SCNV_scheme_sim) then - if (have_dTdt_SCNV_data) then - gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_SCNV_data(:,ti(1)) + w2*(dTdt_SCNV_data(:,tf(1)))) * dtp - endif - if (have_dudt_SCNV_data) then - gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_SCNV_data(:,ti(1)) + w2*(dudt_SCNV_data(:,tf(1)))) * dtp - endif - if (have_dvdt_SCNV_data) then - gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_SCNV_data(:,ti(1)) + w2*(dvdt_SCNV_data(:,tf(1)))) * dtp - endif - if (have_dqdt_SCNV_data) then - gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_SCNV_data(:,ti(1),1) + w2*(dqdt_SCNV_data(:,tf(1),1))) * dtp - endif - else - idtend = dtidx(index_of_temperature,index_of_process_scnv) - if (idtend >= 1) then - gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_x_wind,index_of_process_scnv) - if (idtend >= 1) then - gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_y_wind,index_of_process_scnv) - if (idtend >= 1) then - gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(100+ntqv,index_of_process_scnv) - if (idtend >= 1) then - gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp - endif - endif + ! Locals + integer :: ti(1), tf(1) + real(kind_phys) :: w1, w2, hrofday - ! ############################################################################### - ! Deep convection - ! ############################################################################### - if (use_DCNV_scheme_sim) then - if (have_dTdt_DCNV_data) then - gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_DCNV_data(:,ti(1)) + w2*(dTdt_DCNV_data(:,tf(1)) )) * dtp - endif - if (have_dudt_DCNV_data) then - gu1(iCol,:) = gu1(iCol,:) + (w1*dudt_DCNV_data(:,ti(1)) + w2*(dudt_DCNV_data(:,tf(1)))) * dtp - endif - if (have_dvdt_DCNV_data) then - gv1(iCol,:) = gv1(iCol,:) + (w1*dvdt_DCNV_data(:,ti(1)) + w2*(dvdt_DCNV_data(:,tf(1)) )) * dtp - endif - if (have_dqdt_DCNV_data) then - gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_DCNV_data(:,ti(1),1) + w2*(dqdt_DCNV_data(:,tf(1),1))) * dtp - endif - else - idtend = dtidx(index_of_temperature,index_of_process_dcnv) - if (idtend >= 1) then - gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_x_wind,index_of_process_dcnv) - if (idtend >= 1) then - gu1(iCol,:) = gu1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(index_of_y_wind,index_of_process_dcnv) - if (idtend >= 1) then - gv1(iCol,:) = gv1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(100+ntqv,index_of_process_dcnv) - if (idtend >= 1) then - gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp - endif - endif + hrofday = hour*3600. + minute*60. + second + ti = findloc(abs(time_data-hrofday),minval(abs(time_data-hrofday))) + if (hrofday - time_data(ti(1)) .le. 0) ti = ti-1 + tf = ti + 1 + w1 = (time_data(tf(1))-hrofday) / (time_data(tf(1)) - time_data(ti(1))) + w2 = 1 - w1 - ! ############################################################################### - ! Cloud microphysics - ! ############################################################################### - if (use_cldMP_scheme_sim) then - if (have_dTdt_cldMP_data) then - gt1(iCol,:) = gt1(iCol,:) + (w1*dTdt_cldMP_data(:,ti(1)) + w2*(dTdt_cldMP_data(:,tf(1)))) * dtp - endif - if (have_dqdt_cldMP_data) then - gq1(iCol,:,1) = gq1(iCol,:,1) + (w1*dqdt_cldMP_data(:,ti(1),1) + w2*(dqdt_cldMP_data(:,tf(1),1))) * dtp - endif - else - idtend = dtidx(index_of_temperature,index_of_process_mp) - if (idtend >= 1) then - gt1(iCol,:) = gt1(iCol,:) + dtend(iCol,:,idtend)! * dtp - endif - idtend = dtidx(100+ntqv,index_of_process_mp) - if (idtend >= 1) then - gq1(iCol,:,1) = gq1(iCol,:,1) + dtend(iCol,:,idtend)! * dtp - endif - endif + if (var_name == "T") then + var_out = w1*physics_process(iprc)%tend%T(:,ti(1)) + w2*physics_process(iprc)%tend%T(:,tf(1)) + endif - enddo ! columns - ! - end subroutine ccpp_scheme_simulator_run + if (var_name == "u") then + var_out = w1*physics_process(iprc)%tend%u(:,ti(1)) + w2*physics_process(iprc)%tend%u(:,tf(1)) + endif + + if (var_name == "v") then + var_out = w1*physics_process(iprc)%tend%v(:,ti(1)) + w2*physics_process(iprc)%tend%v(:,tf(1)) + endif + + if (var_name == "q") then + var_out = w1*physics_process(iprc)%tend%q(:,ti(1),1) + w2*physics_process(iprc)%tend%q(:,tf(1),1) + endif + end subroutine interp_data_tend end module ccpp_scheme_simulator diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index 909089bb9..92e39ff61 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -70,14 +70,6 @@ [ccpp-arg-table] name = ccpp_scheme_simulator_run type = scheme -[solhr] - standard_name = forecast_utc_hour - long_name = time in hours after 00z at the current timestep - units = h - dimensions = () - type = real - kind = kind_phys - intent = in [kdt] standard_name = index_of_timestep long_name = current forecast iteration From ffd26ab39759091969c23995dfc051c077b330c6 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 6 Feb 2023 10:55:30 -0700 Subject: [PATCH 011/249] Some changes --- physics/ccpp_scheme_simulator.F90 | 42 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 258687416..be7ad03f9 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -666,20 +666,6 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay,1)) allocate(dT(nLay), du(nLay), dv(nLay), dq(nLay)) - ! Determine temporal interpolation weights for data-tendecies. - ! DJS: The data tendencies have a temporal dimension, to capture the diurnal cycle, - ! which is needed for reasonable solar forcing. - hrofday = fcst_hour*3600. + fcst_min*60. + fcst_sec - ti = findloc(abs(time_data-hrofday),minval(abs(time_data-hrofday))) - if (hrofday - time_data(ti(1)) .le. 0) ti = ti-1 - tf = ti + 1 - w1 = (time_data(tf(1))-hrofday) / (time_data(tf(1)) - time_data(ti(1))) - w2 = 1 - w1 - - ! - ! DJS BEGIN: This section will, eventually, replace the icol loop below, using the physics_process type. - ! - ! Set state gt1(:,:) = tgrs(:,:) gu1(:,:) = ugrs(:,:) @@ -689,8 +675,13 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dudt(:,:) = 0. dvdt(:,:) = 0. dqdt(:,:,1)= 0. - do iCol = 1,nCol - do iprc = 1,nPhysProcess + do iprc = 1,nPhysProcess + do iCol = 1,nCol + ! + dT = 0. + du = 0. + dv = 0. + dq = 0. ! Using scheme simulator if (physics_process(iprc)%use_sim) then @@ -728,18 +719,18 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (physics_process(iprc)%name == "cldMP") index_of_process = index_of_process_mp ! idtend = dtidx(index_of_temperature,index_of_process) - if (idtend >= 1) dT = dtend(iCol,:,idtend) + if (idtend >= 1) dT = dtend(iCol,:,idtend)/dtp ! idtend = dtidx(index_of_x_wind,index_of_process) - if (idtend >= 1) du = dtend(iCol,:,idtend) + if (idtend >= 1) du = dtend(iCol,:,idtend)/dtp ! idtend = dtidx(index_of_y_wind,index_of_process) - if (idtend >= 1) dv = dtend(iCol,:,idtend) + if (idtend >= 1) dv = dtend(iCol,:,idtend)/dtp ! idtend = dtidx(100+ntqv,index_of_process) - if (idtend >= 1) dq = dtend(iCol,:,idtend) + if (idtend >= 1) dq = dtend(iCol,:,idtend)/dtp endif - + ! Update state now? if (physics_process(iprc)%time_split) then gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + dT)*dtp @@ -750,7 +741,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dudt(iCol,:) = 0. dvdt(iCol,:) = 0. dqdt(iCol,:,1) = 0. - ! Accumulate tendencies, update later? + ! Accumulate tendencies, update later? else dTdt(iCol,:) = dTdt(iCol,:) + dT dudt(iCol,:) = dudt(iCol,:) + du @@ -765,6 +756,13 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti gq0(iCol,:,1) = gq1(iCol,:,1) + dqdt(iCol,:,1)*dtp enddo ! + + do iCol=1,size(gq0(:,1,1)) + do iLay=1,size(gq0(1,:,1)) + write(*,'(i5,4f8.3)') iLay,tgrs(iCol,iLay),gt0(iCol,iLay),gt1(iCol,iLay),gt0(iCol,iLay)-gt1(iCol,iLay) + enddo + enddo + end subroutine ccpp_scheme_simulator_run ! #################################################################################### From 112ac895f62c3d4034dac67ec73b0d126b78098f Mon Sep 17 00:00:00 2001 From: dustinswales Date: Tue, 7 Feb 2023 12:36:11 -0700 Subject: [PATCH 012/249] Some small cleanup --- physics/ccpp_scheme_simulator.F90 | 103 +++++++++++------------------ physics/ccpp_scheme_simulator.meta | 7 -- 2 files changed, 39 insertions(+), 71 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index be7ad03f9..b3075e36a 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -116,15 +116,12 @@ module ccpp_scheme_simulator ! Data driven physics tendencies integer :: nlev_data, ntime_data real(kind_phys), allocatable, dimension(:) :: time_data - real(kind_phys), allocatable, dimension(:,:),target :: dTdt_LWRAD_data, dTdt_SWRAD_data, & - dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, dudt_GWD_data, & - dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, dTdt_DCNV_data, & - dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data - real(kind_phys), allocatable, dimension(:,:,:),target :: dqdt_PBL_data, dqdt_SCNV_data, & - dqdt_DCNV_data, dqdt_cldMP_data - - ! Host-model initial time information - integer :: init_year, init_month, init_day, init_hour, init_min, init_sec + real(kind_phys), allocatable, dimension(:,:), target :: dTdt_LWRAD_data, & + dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & + dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & + dTdt_DCNV_data, dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data + real(kind_phys), allocatable, dimension(:,:,:), target :: dqdt_PBL_data, & + dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data public ccpp_scheme_simulator_init, ccpp_scheme_simulator_run contains @@ -138,12 +135,11 @@ module ccpp_scheme_simulator !! \htmlinclude ccpp_scheme_simulator_init.html !! subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_file, & - idat, errmsg, errflg) + errmsg, errflg) ! Inputs integer, intent (in) :: mpirank, mpiroot, mpicomm, nlunit character(len=*), intent (in) :: nml_file - integer, intent (in), dimension(8) :: idat ! Outputs character(len=*), intent(out) :: errmsg @@ -168,14 +164,6 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil errmsg = '' errflg = 0 - ! Store model initialization time. - init_year = idat(1) - init_month = idat(2) - init_day = idat(3) - init_hour = idat(5) - init_min = idat(6) - init_sec = idat(7) - ! ###################################################################################### ! ! Read in namelist @@ -592,10 +580,12 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil print*, "---------------------------------" print*, " " do iprc = 1,nPhysProcess - print*,"Process : ", trim(physics_process(iprc)%name) - print*," order : ", physics_process(iprc)%order - print*," use_sim : ", physics_process(iprc)%use_sim - print*," time_split : ", physics_process(iprc)%time_split + if (physics_process(iprc)%use_sim) then + print*,"Process : ", trim(physics_process(iprc)%name) + print*," order : ", physics_process(iprc)%order + print*," use_sim : ", physics_process(iprc)%use_sim + print*," time_split : ", physics_process(iprc)%time_split + endif enddo print*, "---------------------------------" endif @@ -662,7 +652,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti nTrc = size(gq0(1,1,:)) ! Allocate temporaries - allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay,1)) ! *only specific humidity to start (ntrc=1). + allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay,1)) allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay,1)) allocate(dT(nLay), du(nLay), dv(nLay), dq(nLay)) @@ -675,6 +665,8 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dudt(:,:) = 0. dvdt(:,:) = 0. dqdt(:,:,1)= 0. + + ! Model internal physics timestep evolution of "state". do iprc = 1,nPhysProcess do iCol = 1,nCol ! @@ -685,31 +677,21 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Using scheme simulator if (physics_process(iprc)%use_sim) then - print*,"Using CCPP scheme simulator for ",trim(physics_process(iprc)%name) - - ! Temperature if (associated(physics_process(iprc)%tend%T)) then - call interp_data_tend("T", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dT) + call linterp_data_tend("T", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dT) endif - - ! Zonal-wind if (associated(physics_process(iprc)%tend%u)) then - call interp_data_tend("u", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, du) + call linterp_data_tend("u", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, du) endif - - ! Meridional-wind if (associated(physics_process(iprc)%tend%v)) then - call interp_data_tend("v", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dv) + call linterp_data_tend("v", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dv) endif - - ! Specific-humidity if (associated(physics_process(iprc)%tend%q)) then - call interp_data_tend("q", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dq) + call linterp_data_tend("q", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dq) endif ! Using data tendency from "active" scheme(s). else - print*,"ACTIVE PHYSICS SCHEME: ",trim(physics_process(iprc)%name) if (physics_process(iprc)%name == "LWRAD") index_of_process = index_of_process_longwave if (physics_process(iprc)%name == "SWRAD") index_of_process = index_of_process_shortwave if (physics_process(iprc)%name == "PBL") index_of_process = index_of_process_pbl @@ -730,7 +712,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti idtend = dtidx(100+ntqv,index_of_process) if (idtend >= 1) dq = dtend(iCol,:,idtend)/dtp endif - + ! Update state now? if (physics_process(iprc)%time_split) then gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + dT)*dtp @@ -754,22 +736,17 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp gq0(iCol,:,1) = gq1(iCol,:,1) + dqdt(iCol,:,1)*dtp - enddo - ! - do iCol=1,size(gq0(:,1,1)) - do iLay=1,size(gq0(1,:,1)) - write(*,'(i5,4f8.3)') iLay,tgrs(iCol,iLay),gt0(iCol,iLay),gt1(iCol,iLay),gt0(iCol,iLay)-gt1(iCol,iLay) - enddo enddo - + ! end subroutine ccpp_scheme_simulator_run ! #################################################################################### ! Utility functions/routines ! #################################################################################### - subroutine interp_data_tend(var_name, process_name, iprc, year, month, day, hour, minute, & - second, var_out) + ! The routine interpolates the data-tendencies + subroutine linterp_data_tend(var_name, process_name, iprc, year, month, day, hour, & + minute, second, var_out) ! Inputs character(len=*), intent(in) :: var_name, process_name integer, intent(in) :: year, month, day, hour, minute, second, iprc @@ -781,6 +758,7 @@ subroutine interp_data_tend(var_name, process_name, iprc, year, month, day, hour integer :: ti(1), tf(1) real(kind_phys) :: w1, w2, hrofday + ! Linear interpolation weights hrofday = hour*3600. + minute*60. + second ti = findloc(abs(time_data-hrofday),minval(abs(time_data-hrofday))) if (hrofday - time_data(ti(1)) .le. 0) ti = ti-1 @@ -788,21 +766,18 @@ subroutine interp_data_tend(var_name, process_name, iprc, year, month, day, hour w1 = (time_data(tf(1))-hrofday) / (time_data(tf(1)) - time_data(ti(1))) w2 = 1 - w1 - if (var_name == "T") then - var_out = w1*physics_process(iprc)%tend%T(:,ti(1)) + w2*physics_process(iprc)%tend%T(:,tf(1)) - endif - - if (var_name == "u") then - var_out = w1*physics_process(iprc)%tend%u(:,ti(1)) + w2*physics_process(iprc)%tend%u(:,tf(1)) - endif - - if (var_name == "v") then - var_out = w1*physics_process(iprc)%tend%v(:,ti(1)) + w2*physics_process(iprc)%tend%v(:,tf(1)) - endif - - if (var_name == "q") then - var_out = w1*physics_process(iprc)%tend%q(:,ti(1),1) + w2*physics_process(iprc)%tend%q(:,tf(1),1) - endif - end subroutine interp_data_tend + ! + select case(var_name) + case("T") + var_out = w1*physics_process(iprc)%tend%T(:,ti(1)) + w2*physics_process(iprc)%tend%T(:,tf(1)) + case("u") + var_out = w1*physics_process(iprc)%tend%u(:,ti(1)) + w2*physics_process(iprc)%tend%u(:,tf(1)) + case("v") + var_out = w1*physics_process(iprc)%tend%v(:,ti(1)) + w2*physics_process(iprc)%tend%v(:,tf(1)) + case("q") + var_out = w1*physics_process(iprc)%tend%q(:,ti(1),1) + w2*physics_process(iprc)%tend%q(:,tf(1),1) + end select + + end subroutine linterp_data_tend end module ccpp_scheme_simulator diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index 92e39ff61..80f898ed2 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -43,13 +43,6 @@ type = character kind = len=* intent = in -[idat] - standard_name = date_and_time_at_model_initialization_in_iso_order - long_name = initialization date and time - units = none - dimensions = (8) - type = integer - intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 7e2954615d03ee085c2cbc91d6326ee2ecac88cb Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Tue, 7 Feb 2023 15:12:09 -0700 Subject: [PATCH 013/249] update sfc_land --- physics/sfc_land.f | 39 +++++++++++++++++++++------------------ physics/sfc_land.meta | 16 ++++++++++++++++ 2 files changed, 37 insertions(+), 18 deletions(-) diff --git a/physics/sfc_land.f b/physics/sfc_land.f index 0c3130bbe..ab0691251 100644 --- a/physics/sfc_land.f +++ b/physics/sfc_land.f @@ -36,9 +36,10 @@ subroutine sfc_land_run & ! --- inputs: & ( im, cpllnd, cpllnd2atm, flag_iter, dry, & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & - & ep_lnd, t2mmp_lnd, q2mp_lnd, & + & ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & ! --- outputs: & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & + & gflux, & & errmsg, errflg, naux2d, aux2d & ) @@ -52,9 +53,10 @@ subroutine sfc_land_run & ! inputs: ! ! ( im, cpllnd, cpllnd2atm, flag_iter, dry, ! ! sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ! -! ep_lnd, t2mmp_lnd, q2mp_lnd, ! +! ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, ! ! outputs: ! ! sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, ! +! gflux, ! ! errmsg, errflg) ! ! ! ! ==================== defination of variables ==================== ! @@ -71,7 +73,8 @@ subroutine sfc_land_run & ! hflx_lnd - real , sensible heat ! ep_lnd - real , surface upward potential latent heat flux ! t2mmp_lnd - real , 2m temperature -! q2mp_lnd - real , 2m specific humidity +! q2mp_lnd - real , 2m specific humidity +! gflux_lnd - real , soil heat flux over land ! outputs: ! sncovr1 - real , snow cover over land ! qsurf - real , specific humidity at sfc @@ -79,7 +82,8 @@ subroutine sfc_land_run & ! hflx - real , sensible heat ! ep - real , potential evaporation ! t2mmp - real , temperature at 2m -! q2mp - real , specific humidity at 2m +! q2mp - real , specific humidity at 2m +! gflux - real , soil heat flux over land ! ==================== end of description ===================== ! ! ! @@ -94,11 +98,11 @@ subroutine sfc_land_run & real (kind=kind_phys), dimension(:), intent(in) :: & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ep_lnd, & - & t2mmp_lnd, q2mp_lnd + & t2mmp_lnd, q2mp_lnd, gflux_lnd ! --- outputs: real (kind=kind_phys), dimension(:), intent(out) :: & - & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp + & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, gflux ! character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -117,25 +121,24 @@ subroutine sfc_land_run & if (.not. cpllnd2atm) return ! do i = 1, im - !if (flag_iter(i) .and. dry(i)) then - !if (dry(i)) then - sncovr1(i) = sncovr1_lnd(i) - qsurf(i) = qsurf_lnd(i) - hflx(i) = hflx_lnd(i) - evap(i) = evap_lnd(i) - ep(i) = ep_lnd(i) - t2mmp(i) = t2mmp_lnd(i) - q2mp(i) = q2mp_lnd(i) - !end if + sncovr1(i) = sncovr1_lnd(i) + qsurf(i) = qsurf_lnd(i) + hflx(i) = hflx_lnd(i) + evap(i) = evap_lnd(i) + ep(i) = ep_lnd(i) + t2mmp(i) = t2mmp_lnd(i) + q2mp(i) = q2mp_lnd(i) + gflux(i) = gflux_lnd(i) enddo - aux2d(:,1) = dry(:) !sncovr1(:) + aux2d(:,1) = sncovr1(:) aux2d(:,2) = qsurf(:) aux2d(:,3) = hflx(:) aux2d(:,4) = evap(:) aux2d(:,5) = ep(:) - aux2d(:,6) = qsurf_lnd(:) !t2mmp(:) + aux2d(:,6) = t2mmp(:) aux2d(:,7) = q2mp(:) + aux2d(:,8) = gflux(:) return !----------------------------------- diff --git a/physics/sfc_land.meta b/physics/sfc_land.meta index f31d779ae..50ddecd46 100644 --- a/physics/sfc_land.meta +++ b/physics/sfc_land.meta @@ -98,6 +98,14 @@ type = real kind = kind_phys intent = in +[gflux_lnd] + standard_name = upward_heat_flux_in_soil_over_land_from_land + long_name = soil heat flux over land for coupling + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [sncovr1] standard_name = surface_snow_area_fraction_over_land long_name = surface snow area fraction @@ -154,6 +162,14 @@ type = real kind = kind_phys intent = out +[gflux] + standard_name = upward_heat_flux_in_soil_over_land + long_name = soil heat flux over land + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 6a4c4b17c94130955de38b5dff5fc7e284d77dce Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 9 Feb 2023 15:04:23 -0700 Subject: [PATCH 014/249] More OO changes. Will split into load_data and ccpp_scheme components soon. --- physics/ccpp_scheme_simulator.F90 | 274 ++++++++++++++++-------------- 1 file changed, 143 insertions(+), 131 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index b3075e36a..3c82fe094 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -13,10 +13,6 @@ module ccpp_scheme_simulator #endif implicit none - ! Avaialble physics processes to simulate. - integer,parameter :: & - nPhysProcess = 7 - ! Type containing physics tendencies for a physics process. type phys_tend real(kind_phys), dimension(:,:), pointer :: T @@ -28,16 +24,18 @@ module ccpp_scheme_simulator ! This type contains the meta information and data for each physics process. type base_physics_process character(len=16) :: name - logical :: time_split - logical :: use_sim + logical :: time_split = .false. + logical :: use_sim = .false. integer :: order type(phys_tend) :: tend end type base_physics_process ! This array contains the governing information on how to advance the physics timestep. - type(base_physics_process),dimension(nPhysProcess) :: & + type(base_physics_process),dimension(:), allocatable :: & physics_process + integer :: nPhysProcess + ! ######################################################################################## ! ! Configuration for CCPP scheme simulator. Set in namelist. Used during initialization to @@ -45,74 +43,20 @@ module ccpp_scheme_simulator ! ! ######################################################################################## - ! Set which schemes to be replaced with simulated tendencies. - logical :: use_LWRAD_scheme_sim = .false., & !< If true, use LongWave RADiation scheme simulator. - !< If false, use tendencies from radiation scheme. - use_SWRAD_scheme_sim = .false., & !< If true, use ShortWave RADiation scheme simulator. - !< If false, use tendencies from radiation scheme. - use_PBL_scheme_sim = .false., & !< If true, use Planetary Boubdary Layer scheme simulator. - !< If false, use tendencies from PBL scheme. - use_GWD_scheme_sim = .false., & !< If true, use Gravity Wave Drag scheme simulator. - !< If false, use tendencies from GWD scheme. - use_SCNV_scheme_sim = .false., & !< If true, use Shallow CoNVection scheme simulator. - !< If false, use tendencies from SCNV scheme. - use_DCNV_scheme_sim = .false., & !< If true, use Deep CoNVection scheme simulator. - !< If false, use tendencies from DCNV scheme. - use_cldMP_scheme_sim = .false. !< If true, use cloud MicroPhysics scheme simulator. - !< If false, use tendencies from cldMP acheme. - - ! Are the processes time-split or process-split? - logical :: time_split_LWRAD = .false., & !< If true, time-split process. Update internal physics state prior to scheme. - !< If false, process-split process. Accumulate tendencies. - time_split_SWRAD = .false., & !< If true, time-split process. Update internal physics state prior to scheme. - !< If false, process-split process. Accumulate tendencies. - time_split_PBL = .false., & !< If true, time-split process. Update internal physics state prior to scheme. - !< If false, process-split process. Accumulate tendencies. - time_split_GWD = .false., & !< If true, time-split process. Update internal physics state prior to scheme. - !< If false, process-split process. Accumulate tendencies. - time_split_SCNV = .true., & !< If true, time-split process. Update internal physics state prior to scheme. - !< If false, process-split process. Accumulate tendencies. - time_split_DCNV = .true., & !< If true, time-split process. Update internal physics state prior to scheme. - !< If false, process-split process. Accumulate tendencies. - time_split_cldMP = .true. !< If true, time-split process. Update internal physics state prior to scheme. - !< If false, process-split process. Accumulate tendencies. - - ! What is physics process ordering? (Important if their are time-split processes in the physics scheme) - integer :: scheme_order_SWRAD = 1, & !< Order of Radiation scheme (shortwave). - scheme_order_LWRAD = 2, & !< Order of Radiation scheme (longwave). - scheme_order_PBL = 3, & !< Order of Planetary Boubdary Layer scheme. - scheme_order_GWD = 4, & !< Order of Gravity Wave Drag scheme. - scheme_order_SCNV = 5, & !< Order of Shallow CoNVection scheme. - scheme_order_DCNV = 6, & !< Order of Deep CoNVection scheme. - scheme_order_cldMP = 7 !< Order of cloud MicroPhysics scheme. - ! - ! Locals - ! + ! For each process there is a corresponding namelist entry, which is constructed as follows: + ! {use_scheme_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} + integer, dimension(3) :: & + proc_LWRAD_config = (/0,0,0/), & + proc_SWRAD_config = (/0,0,0/), & + proc_PBL_config = (/0,0,0/), & + proc_GWD_config = (/0,0,0/), & + proc_SCNV_config = (/0,0,0/), & + proc_DCNV_config = (/0,0,0/), & + proc_cldMP_config = (/0,0,0/) ! Activation flag for scheme. logical :: do_ccpp_scheme_simulator = .false. - ! Switches for input data - logical :: have_dTdt_LWRAD_data = .false., & !< If true, input file contains LongWave RADiation temperature tendencies. - have_dTdt_SWRAD_data = .false., & !< If true, input file contains ShortWave RADiation temperature tendencies. - have_dTdt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer temperature tendencies. - have_dqdt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer specific-humidity tendencies. - have_dudt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer zonal-wind tendencies. - have_dvdt_PBL_data = .false., & !< If true, input file contains Planetary Boubdary Layer meridional-wind tendencies. - have_dTdt_GWD_data = .false., & !< If true, input file contains Gravity Wave Drag temperature tendencies. - have_dudt_GWD_data = .false., & !< If true, input file contains Gravity Wave Drag zonal-wind tendencies. - have_dvdt_GWD_data = .false., & !< If true, input file contains Gravity Wave Drag meridional-wind tendencies. - have_dTdt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection temperature tendencies. - have_dudt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection zonal-wind tendencies. - have_dvdt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection meridional-wind tendencies. - have_dqdt_SCNV_data = .false., & !< If true, input file contains Shallow CoNVection specific-humidity tendencies. - have_dTdt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection temperature tendencies. - have_dudt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection zonal-wind tendencies. - have_dvdt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection meridional-wind tendencies. - have_dqdt_DCNV_data = .false., & !< If true, input file contains Deep CoNVection specific-humidity tendencies. - have_dTdt_cldMP_data = .false., & !< If true, input file contains cloud MicroPhysics temperature tendencies. - have_dqdt_cldMP_data = .false. !< If true, input file contains cloud MicroPhysics specific-humidity tendencies. - ! Data driven physics tendencies integer :: nlev_data, ntime_data real(kind_phys), allocatable, dimension(:) :: time_data @@ -123,6 +67,12 @@ module ccpp_scheme_simulator real(kind_phys), allocatable, dimension(:,:,:), target :: dqdt_PBL_data, & dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data + ! Scheme initialization flag. + logical :: module_initialized = .false. + + ! Order in process loop for "active" physics process. + integer :: iactive_scheme + public ccpp_scheme_simulator_init, ccpp_scheme_simulator_run contains @@ -151,19 +101,39 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil logical :: exists integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality + ! Switches for input data + logical :: have_dTdt_LWRAD_data = .false., & + have_dTdt_SWRAD_data = .false., & + have_dTdt_PBL_data = .false., & + have_dqdt_PBL_data = .false., & + have_dudt_PBL_data = .false., & + have_dvdt_PBL_data = .false., & + have_dTdt_GWD_data = .false., & + have_dudt_GWD_data = .false., & + have_dvdt_GWD_data = .false., & + have_dTdt_SCNV_data = .false., & + have_dudt_SCNV_data = .false., & + have_dvdt_SCNV_data = .false., & + have_dqdt_SCNV_data = .false., & + have_dTdt_DCNV_data = .false., & + have_dudt_DCNV_data = .false., & + have_dvdt_DCNV_data = .false., & + have_dqdt_DCNV_data = .false., & + have_dTdt_cldMP_data = .false., & + have_dqdt_cldMP_data = .false. + ! Namelist - namelist / scm_data_nml / fileIN, & - use_SWRAD_scheme_sim, use_LWRAD_scheme_sim, use_PBL_scheme_sim, & - use_GWD_scheme_sim, use_SCNV_scheme_sim, use_DCNV_scheme_sim, & - use_cldMP_scheme_sim, scheme_order_SWRAD, scheme_order_LWRAD, scheme_order_PBL, & - scheme_order_GWD, scheme_order_SCNV, scheme_order_DCNV, scheme_order_cldMP, & - time_split_SWRAD, time_split_LWRAD, time_split_PBL, time_split_GWD, & - time_split_SCNV, time_split_DCNV, time_split_cldMP + namelist / scm_data_nml / fileIN, nPhysProcess, proc_LWRAD_config, proc_SWRAD_config, & + proc_PBL_config, proc_GWD_config, proc_SCNV_config, proc_DCNV_config, & + proc_cldMP_config ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + if (module_initialized) return + module_initialized = .true. + ! ###################################################################################### ! ! Read in namelist @@ -187,9 +157,9 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil ! ! ###################################################################################### ! Only proceed if scheme simulator requested. - if (use_SWRAD_scheme_sim .or. use_LWRAD_scheme_sim .or. use_PBL_scheme_sim .or. & - use_GWD_scheme_sim .or. use_SCNV_scheme_sim .or. use_DCNV_scheme_sim .or. & - use_cldMP_scheme_sim) then + if (proc_SWRAD_config(1) .or. proc_LWRAD_config(1) .or. proc_PBL_config(1) .or. & + proc_GWD_config(1) .or. proc_SCNV_config(1) .or. proc_DCNV_config(1) .or. & + proc_cldMP_config(1)) then do_ccpp_scheme_simulator = .true. else return @@ -507,87 +477,128 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil ! ! ####################################################################################### + ! Allocate + allocate(physics_process(nPhysProcess)) + ! Metadata do iprc = 1,nPhysProcess - if (iprc == scheme_order_SWRAD) then + if (iprc == proc_SWRAD_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "SWRAD" - physics_process(iprc)%use_sim = use_SWRAD_scheme_sim - physics_process(iprc)%time_split = time_split_SWRAD + if (proc_SWRAD_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_SWRAD_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif endif - if (iprc == scheme_order_LWRAD) then + if (iprc == proc_LWRAD_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "LWRAD" - physics_process(iprc)%use_sim = use_LWRAD_scheme_sim - physics_process(iprc)%time_split = time_split_LWRAD + if (proc_LWRAD_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_LWRAD_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif endif - if (iprc == scheme_order_GWD) then + if (iprc == proc_GWD_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "GWD" - physics_process(iprc)%use_sim = use_GWD_scheme_sim - physics_process(iprc)%time_split = time_split_GWD + if (proc_GWD_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_GWD_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif endif - if (iprc == scheme_order_PBL) then + if (iprc == proc_PBL_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "PBL" - physics_process(iprc)%use_sim = use_PBL_scheme_sim - physics_process(iprc)%time_split = time_split_PBL + if (proc_PBL_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_PBL_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif endif - if (iprc == scheme_order_SCNV) then + if (iprc == proc_SCNV_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "SCNV" - physics_process(iprc)%use_sim = use_SCNV_scheme_sim - physics_process(iprc)%time_split = time_split_SCNV + if (proc_SCNV_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_SCNV_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif endif - if (iprc == scheme_order_DCNV) then + if (iprc == proc_DCNV_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "DCNV" - physics_process(iprc)%use_sim = use_DCNV_scheme_sim - physics_process(iprc)%time_split = time_split_DCNV + if (proc_DCNV_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_DCNV_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif endif - if (iprc == scheme_order_cldMP) then + if (iprc == proc_cldMP_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "cldMP" - physics_process(iprc)%use_sim = use_cldMP_scheme_sim - physics_process(iprc)%time_split = time_split_cldMP + if (proc_cldMP_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_cldMP_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif endif enddo - ! Data - if (have_dTdt_LWRAD_data) physics_process(scheme_order_LWRAD)%tend%T => dTdt_LWRAD_data - if (have_dTdt_SWRAD_data) physics_process(scheme_order_SWRAD)%tend%T => dTdt_SWRAD_data - if (have_dTdt_PBL_data) physics_process(scheme_order_PBL)%tend%T => dTdt_PBL_data - if (have_dudt_PBL_data) physics_process(scheme_order_PBL)%tend%u => dudt_PBL_data - if (have_dvdt_PBL_data) physics_process(scheme_order_PBL)%tend%v => dvdt_PBL_data - if (have_dqdt_PBL_data) physics_process(scheme_order_PBL)%tend%q => dqdt_PBL_data - if (have_dTdt_GWD_data) physics_process(scheme_order_GWD)%tend%T => dTdt_GWD_data - if (have_dudt_GWD_data) physics_process(scheme_order_GWD)%tend%u => dudt_GWD_data - if (have_dvdt_GWD_data) physics_process(scheme_order_GWD)%tend%v => dvdt_GWD_data - if (have_dTdt_SCNV_data) physics_process(scheme_order_SCNV)%tend%T => dTdt_SCNV_data - if (have_dudt_SCNV_data) physics_process(scheme_order_SCNV)%tend%u => dudt_SCNV_data - if (have_dvdt_SCNV_data) physics_process(scheme_order_SCNV)%tend%v => dvdt_SCNV_data - if (have_dqdt_SCNV_data) physics_process(scheme_order_SCNV)%tend%q => dqdt_SCNV_data - if (have_dTdt_DCNV_data) physics_process(scheme_order_DCNV)%tend%T => dTdt_DCNV_data - if (have_dudt_DCNV_data) physics_process(scheme_order_DCNV)%tend%u => dudt_DCNV_data - if (have_dvdt_DCNV_data) physics_process(scheme_order_DCNV)%tend%v => dvdt_DCNV_data - if (have_dqdt_DCNV_data) physics_process(scheme_order_DCNV)%tend%q => dqdt_DCNV_data - if (have_dTdt_cldMP_data) physics_process(scheme_order_cldMP)%tend%T => dTdt_cldMP_data - if (have_dqdt_cldMP_data) physics_process(scheme_order_cldMP)%tend%q => dqdt_cldMP_data + ! Load data + if (have_dTdt_LWRAD_data) physics_process(proc_SWRAD_config(3))%tend%T => dTdt_LWRAD_data + if (have_dTdt_SWRAD_data) physics_process(proc_LWRAD_config(3))%tend%T => dTdt_SWRAD_data + if (have_dTdt_PBL_data) physics_process(proc_PBL_config(3))%tend%T => dTdt_PBL_data + if (have_dudt_PBL_data) physics_process(proc_PBL_config(3))%tend%u => dudt_PBL_data + if (have_dvdt_PBL_data) physics_process(proc_PBL_config(3))%tend%v => dvdt_PBL_data + if (have_dqdt_PBL_data) physics_process(proc_PBL_config(3))%tend%q => dqdt_PBL_data + if (have_dTdt_GWD_data) physics_process(proc_GWD_config(3))%tend%T => dTdt_GWD_data + if (have_dudt_GWD_data) physics_process(proc_GWD_config(3))%tend%u => dudt_GWD_data + if (have_dvdt_GWD_data) physics_process(proc_GWD_config(3))%tend%v => dvdt_GWD_data + if (have_dTdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%T => dTdt_SCNV_data + if (have_dudt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%u => dudt_SCNV_data + if (have_dvdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%v => dvdt_SCNV_data + if (have_dqdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%q => dqdt_SCNV_data + if (have_dTdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%T => dTdt_DCNV_data + if (have_dudt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%u => dudt_DCNV_data + if (have_dvdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%v => dvdt_DCNV_data + if (have_dqdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%q => dqdt_DCNV_data + if (have_dTdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend%T => dTdt_cldMP_data + if (have_dqdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend%q => dqdt_cldMP_data + + ! Which process-scheme is "Active"? + do iprc = 1,nPhysProcess + if (.not. physics_process(iprc)%use_sim) then + iactive_scheme = iprc + endif + enddo ! if (mpirank .eq. mpiroot) then + print*, "----------------------------------" print*, "--- Using CCPP data tendencies ---" - print*, "---------------------------------" - print*, " " + print*, "----------------------------------" do iprc = 1,nPhysProcess if (physics_process(iprc)%use_sim) then - print*,"Process : ", trim(physics_process(iprc)%name) - print*," order : ", physics_process(iprc)%order - print*," use_sim : ", physics_process(iprc)%use_sim - print*," time_split : ", physics_process(iprc)%time_split + print*," simulate_scheme: ", trim(physics_process(iprc)%name) + print*," order: ", physics_process(iprc)%order + print*," time_split: ", physics_process(iprc)%time_split endif enddo - print*, "---------------------------------" + print*, " active_scheme: ", trim(physics_process(iactive_scheme)%name) + print*, " order: ", physics_process(iactive_scheme)%order + print*, " time_split : ", physics_process(iactive_scheme)%time_split + print*, "----------------------------------" + print*, "----------------------------------" endif end subroutine ccpp_scheme_simulator_init @@ -675,7 +686,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dv = 0. dq = 0. - ! Using scheme simulator + ! Using scheme simulator (very simple, interpolate data tendency to local time) if (physics_process(iprc)%use_sim) then if (associated(physics_process(iprc)%tend%T)) then call linterp_data_tend("T", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dT) @@ -691,6 +702,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti endif ! Using data tendency from "active" scheme(s). + ! DJS2023: This block is very ufs specific. Need to tidy this up. else if (physics_process(iprc)%name == "LWRAD") index_of_process = index_of_process_longwave if (physics_process(iprc)%name == "SWRAD") index_of_process = index_of_process_shortwave @@ -745,7 +757,7 @@ end subroutine ccpp_scheme_simulator_run ! Utility functions/routines ! #################################################################################### ! The routine interpolates the data-tendencies - subroutine linterp_data_tend(var_name, process_name, iprc, year, month, day, hour, & + subroutine linterp_data_tend(var_name, process_name, iprc, year, month, day, hour, & minute, second, var_out) ! Inputs character(len=*), intent(in) :: var_name, process_name From be4cc2e5acb11c99794d465496503833a4842a45 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 9 Feb 2023 19:25:45 -0700 Subject: [PATCH 015/249] More OO changes --- physics/ccpp_scheme_simulator.F90 | 134 +++++++++++++++++------------- 1 file changed, 75 insertions(+), 59 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 3c82fe094..f8f040be2 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -13,27 +13,41 @@ module ccpp_scheme_simulator #endif implicit none - ! Type containing physics tendencies for a physics process. - type phys_tend + ! Type containing 1D (instantaneous) physics tendencies + type tend_inst + real(kind_phys), dimension(:), pointer :: dT + real(kind_phys), dimension(:), pointer :: du + real(kind_phys), dimension(:), pointer :: dv + real(kind_phys), dimension(:), pointer :: dq + end type tend_inst + + ! Type containing 2D data physics tendencies. + type phys_tend_2d + real(kind_phys), dimension(:), pointer :: time real(kind_phys), dimension(:,:), pointer :: T real(kind_phys), dimension(:,:), pointer :: u real(kind_phys), dimension(:,:), pointer :: v real(kind_phys), dimension(:,:,:), pointer :: q - end type phys_tend + end type phys_tend_2d ! This type contains the meta information and data for each physics process. type base_physics_process - character(len=16) :: name - logical :: time_split = .false. - logical :: use_sim = .false. - integer :: order - type(phys_tend) :: tend + character(len=16) :: name + logical :: time_split = .false. + logical :: use_sim = .false. + integer :: order + type(phys_tend_2d) :: tend + type(tend_inst) :: itend + contains + generic, public :: linterp => linterp_1D + procedure, private :: linterp_1D end type base_physics_process ! This array contains the governing information on how to advance the physics timestep. type(base_physics_process),dimension(:), allocatable :: & physics_process + ! Number of physics process (set in namelist) integer :: nPhysProcess ! ######################################################################################## @@ -59,7 +73,7 @@ module ccpp_scheme_simulator ! Data driven physics tendencies integer :: nlev_data, ntime_data - real(kind_phys), allocatable, dimension(:) :: time_data + real(kind_phys), allocatable, dimension(:), target :: time_data real(kind_phys), allocatable, dimension(:,:), target :: dTdt_LWRAD_data, & dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & @@ -482,6 +496,10 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil ! Metadata do iprc = 1,nPhysProcess + allocate(physics_process(iprc)%itend%dT(nlev_data)) + allocate(physics_process(iprc)%itend%du(nlev_data)) + allocate(physics_process(iprc)%itend%dv(nlev_data)) + allocate(physics_process(iprc)%itend%dq(nlev_data)) if (iprc == proc_SWRAD_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "SWRAD" @@ -555,6 +573,13 @@ subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_fil enddo ! Load data + physics_process(proc_LWRAD_config(3))%tend%time => time_data + physics_process(proc_SWRAD_config(3))%tend%time => time_data + physics_process(proc_PBL_config(3))%tend%time => time_data + physics_process(proc_GWD_config(3))%tend%time => time_data + physics_process(proc_DCNV_config(3))%tend%time => time_data + physics_process(proc_SCNV_config(3))%tend%time => time_data + physics_process(proc_cldMP_config(3))%tend%time => time_data if (have_dTdt_LWRAD_data) physics_process(proc_SWRAD_config(3))%tend%T => dTdt_LWRAD_data if (have_dTdt_SWRAD_data) physics_process(proc_LWRAD_config(3))%tend%T => dTdt_SWRAD_data if (have_dTdt_PBL_data) physics_process(proc_PBL_config(3))%tend%T => dTdt_PBL_data @@ -639,7 +664,6 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti integer :: iCol, iLay, iTrc, nCol, nLay, nTrc, ti(1), tf(1), idtend, fcst_year, & fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, iprc, index_of_process real(kind_phys) :: w1, w2,hrofday - real(kind_phys), dimension(:), allocatable :: dT, du, dv, dq real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1, dTdt, dudt, dvdt real(kind_phys), dimension(:,:,:), allocatable :: gq1, dqdt @@ -649,7 +673,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (.not. do_ccpp_scheme_simulator) return - ! Current forecast time + ! Current forecast time (Data-format specific) fcst_year = jdat(1) fcst_month = jdat(2) fcst_day = jdat(3) @@ -665,7 +689,6 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Allocate temporaries allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay,1)) allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay,1)) - allocate(dT(nLay), du(nLay), dv(nLay), dq(nLay)) ! Set state gt1(:,:) = tgrs(:,:) @@ -680,25 +703,25 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Model internal physics timestep evolution of "state". do iprc = 1,nPhysProcess do iCol = 1,nCol - ! - dT = 0. - du = 0. - dv = 0. - dq = 0. + ! Reset locals + physics_process(iprc)%itend%dT(:) = 0. + physics_process(iprc)%itend%du(:) = 0. + physics_process(iprc)%itend%dv(:) = 0. + physics_process(iprc)%itend%dq(:) = 0. ! Using scheme simulator (very simple, interpolate data tendency to local time) if (physics_process(iprc)%use_sim) then if (associated(physics_process(iprc)%tend%T)) then - call linterp_data_tend("T", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dT) + errmsg = physics_process(iprc)%linterp("T", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif if (associated(physics_process(iprc)%tend%u)) then - call linterp_data_tend("u", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, du) + errmsg = physics_process(iprc)%linterp("u", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif if (associated(physics_process(iprc)%tend%v)) then - call linterp_data_tend("v", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dv) + errmsg = physics_process(iprc)%linterp("v", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif if (associated(physics_process(iprc)%tend%q)) then - call linterp_data_tend("q", physics_process(iprc)%name, iprc, fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, dq) + errmsg = physics_process(iprc)%linterp("q", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif ! Using data tendency from "active" scheme(s). @@ -713,34 +736,34 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (physics_process(iprc)%name == "cldMP") index_of_process = index_of_process_mp ! idtend = dtidx(index_of_temperature,index_of_process) - if (idtend >= 1) dT = dtend(iCol,:,idtend)/dtp + if (idtend >= 1) physics_process(iprc)%itend%dT = dtend(iCol,:,idtend)/dtp ! idtend = dtidx(index_of_x_wind,index_of_process) - if (idtend >= 1) du = dtend(iCol,:,idtend)/dtp + if (idtend >= 1) physics_process(iprc)%itend%du = dtend(iCol,:,idtend)/dtp ! idtend = dtidx(index_of_y_wind,index_of_process) - if (idtend >= 1) dv = dtend(iCol,:,idtend)/dtp + if (idtend >= 1) physics_process(iprc)%itend%dv = dtend(iCol,:,idtend)/dtp ! idtend = dtidx(100+ntqv,index_of_process) - if (idtend >= 1) dq = dtend(iCol,:,idtend)/dtp + if (idtend >= 1) physics_process(iprc)%itend%dq = dtend(iCol,:,idtend)/dtp endif ! Update state now? if (physics_process(iprc)%time_split) then - gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + dT)*dtp - gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + du)*dtp - gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + dv)*dtp - gq1(iCol,:,1) = gq1(iCol,:,1) + (dqdt(iCol,:,1) + dq)*dtp + gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%itend%dT)*dtp + gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%itend%du)*dtp + gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%itend%dv)*dtp + gq1(iCol,:,1) = gq1(iCol,:,1) + (dqdt(iCol,:,1) + physics_process(iprc)%itend%dq)*dtp dTdt(iCol,:) = 0. dudt(iCol,:) = 0. dvdt(iCol,:) = 0. dqdt(iCol,:,1) = 0. ! Accumulate tendencies, update later? else - dTdt(iCol,:) = dTdt(iCol,:) + dT - dudt(iCol,:) = dudt(iCol,:) + du - dvdt(iCol,:) = dvdt(iCol,:) + dv - dqdt(iCol,:,1) = dqdt(iCol,:,1) + dq + dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%itend%dT + dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%itend%du + dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%itend%dv + dqdt(iCol,:,1) = dqdt(iCol,:,1) + physics_process(iprc)%itend%dq endif enddo ! @@ -756,40 +779,33 @@ end subroutine ccpp_scheme_simulator_run ! #################################################################################### ! Utility functions/routines ! #################################################################################### - ! The routine interpolates the data-tendencies - subroutine linterp_data_tend(var_name, process_name, iprc, year, month, day, hour, & - minute, second, var_out) - ! Inputs - character(len=*), intent(in) :: var_name, process_name - integer, intent(in) :: year, month, day, hour, minute, second, iprc - - ! Outputs - real(kind_phys),dimension(:),intent(out) :: var_out - - ! Locals + function linterp_1D(this, var_name, year, month, day, hour, minute, second) result(err_message) + class(base_physics_process), intent(inout) :: this + character(len=*), intent(in) :: var_name + integer, intent(in) :: year, month, day, hour, minute, second + character(len=128) :: err_message integer :: ti(1), tf(1) real(kind_phys) :: w1, w2, hrofday - ! Linear interpolation weights + ! Interpolation weights hrofday = hour*3600. + minute*60. + second - ti = findloc(abs(time_data-hrofday),minval(abs(time_data-hrofday))) - if (hrofday - time_data(ti(1)) .le. 0) ti = ti-1 + ti = findloc(abs(this%tend%time-hrofday),minval(abs(this%tend%time-hrofday))) + if (hrofday - this%tend%time(ti(1)) .le. 0) ti = ti-1 tf = ti + 1 - w1 = (time_data(tf(1))-hrofday) / (time_data(tf(1)) - time_data(ti(1))) + w1 = (this%tend%time(tf(1))-hrofday) / (this%tend%time(tf(1)) - this%tend%time(ti(1))) w2 = 1 - w1 - ! select case(var_name) - case("T") - var_out = w1*physics_process(iprc)%tend%T(:,ti(1)) + w2*physics_process(iprc)%tend%T(:,tf(1)) - case("u") - var_out = w1*physics_process(iprc)%tend%u(:,ti(1)) + w2*physics_process(iprc)%tend%u(:,tf(1)) - case("v") - var_out = w1*physics_process(iprc)%tend%v(:,ti(1)) + w2*physics_process(iprc)%tend%v(:,tf(1)) - case("q") - var_out = w1*physics_process(iprc)%tend%q(:,ti(1),1) + w2*physics_process(iprc)%tend%q(:,tf(1),1) + case("T") + this%itend%dT = w1*this%tend%T(:,ti(1)) + w2*this%tend%T(:,tf(1)) + case("u") + this%itend%du = w1*this%tend%u(:,ti(1)) + w2*this%tend%u(:,tf(1)) + case("v") + this%itend%dv = w1*this%tend%v(:,ti(1)) + w2*this%tend%v(:,tf(1)) + case("q") + this%itend%dq = w1*this%tend%q(:,ti(1),1) + w2*this%tend%q(:,tf(1),1) end select - end subroutine linterp_data_tend - + end function linterp_1D + end module ccpp_scheme_simulator From 7001ef9134859977e1c92c2d1b4f54a1c697183c Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 13 Feb 2023 09:50:59 -0700 Subject: [PATCH 016/249] Split scheme into load and simulator components. --- physics/ccpp_scheme_simulator.F90 | 837 +++++++---------------------- physics/ccpp_scheme_simulator.meta | 56 -- physics/load_ccpp_scheme_sim.F90 | 577 ++++++++++++++++++++ physics/load_ccpp_scheme_sim.meta | 60 +++ 4 files changed, 830 insertions(+), 700 deletions(-) create mode 100644 physics/load_ccpp_scheme_sim.F90 create mode 100644 physics/load_ccpp_scheme_sim.meta diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index f8f040be2..3b478844f 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -7,21 +7,21 @@ ! ######################################################################################## module ccpp_scheme_simulator use machine, only: kind_phys - use netcdf -#ifdef MPI - use mpi -#endif - implicit none - ! Type containing 1D (instantaneous) physics tendencies - type tend_inst - real(kind_phys), dimension(:), pointer :: dT - real(kind_phys), dimension(:), pointer :: du - real(kind_phys), dimension(:), pointer :: dv - real(kind_phys), dimension(:), pointer :: dq - end type tend_inst + implicit none - ! Type containing 2D data physics tendencies. + ! ######################################################################################## + ! Types used by the scheme simulator + ! ######################################################################################## + ! Type containing 1D (time) physics tendencies. + type phys_tend_1d + real(kind_phys), dimension(:), pointer :: T + real(kind_phys), dimension(:), pointer :: u + real(kind_phys), dimension(:), pointer :: v + real(kind_phys), dimension(:,:), pointer :: q + end type phys_tend_1d + + ! Type containing 2D (lev,time) physics tendencies. type phys_tend_2d real(kind_phys), dimension(:), pointer :: time real(kind_phys), dimension(:,:), pointer :: T @@ -30,603 +30,65 @@ module ccpp_scheme_simulator real(kind_phys), dimension(:,:,:), pointer :: q end type phys_tend_2d + ! Type containing 3D (loc,lev,time) physics tendencies. + type phys_tend_3d + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:), pointer :: lon + real(kind_phys), dimension(:), pointer :: lat + real(kind_phys), dimension(:,:,:), pointer :: T + real(kind_phys), dimension(:,:,:), pointer :: u + real(kind_phys), dimension(:,:,:), pointer :: v + real(kind_phys), dimension(:,:,:,:), pointer :: q + end type phys_tend_3d + + ! Type containing 4D (lon, lat,lev,time) physics tendencies. + type phys_tend_4d + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:,:), pointer :: lon + real(kind_phys), dimension(:,:), pointer :: lat + real(kind_phys), dimension(:,:,:,:), pointer :: T + real(kind_phys), dimension(:,:,:,:), pointer :: u + real(kind_phys), dimension(:,:,:,:), pointer :: v + real(kind_phys), dimension(:,:,:,:,:), pointer :: q + end type phys_tend_4d + ! This type contains the meta information and data for each physics process. type base_physics_process character(len=16) :: name logical :: time_split = .false. logical :: use_sim = .false. integer :: order - type(phys_tend_2d) :: tend - type(tend_inst) :: itend + type(phys_tend_1d) :: tend1d + type(phys_tend_2d) :: tend2d + type(phys_tend_3d) :: tend3d + type(phys_tend_4d) :: tend4d contains - generic, public :: linterp => linterp_1D + generic, public :: linterp => linterp_1D, linterp_2D procedure, private :: linterp_1D + procedure, private :: linterp_2D + procedure, public :: find_nearest_loc_2d_1d + procedure, public :: cmp_time_wts end type base_physics_process ! This array contains the governing information on how to advance the physics timestep. - type(base_physics_process),dimension(:), allocatable :: & + type(base_physics_process), dimension(:), allocatable :: & physics_process - ! Number of physics process (set in namelist) - integer :: nPhysProcess - - ! ######################################################################################## - ! - ! Configuration for CCPP scheme simulator. Set in namelist. Used during initialization to - ! populate "physics_processes" type array. - ! - ! ######################################################################################## - - ! For each process there is a corresponding namelist entry, which is constructed as follows: - ! {use_scheme_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} - integer, dimension(3) :: & - proc_LWRAD_config = (/0,0,0/), & - proc_SWRAD_config = (/0,0,0/), & - proc_PBL_config = (/0,0,0/), & - proc_GWD_config = (/0,0,0/), & - proc_SCNV_config = (/0,0,0/), & - proc_DCNV_config = (/0,0,0/), & - proc_cldMP_config = (/0,0,0/) - - ! Activation flag for scheme. - logical :: do_ccpp_scheme_simulator = .false. - - ! Data driven physics tendencies - integer :: nlev_data, ntime_data - real(kind_phys), allocatable, dimension(:), target :: time_data - real(kind_phys), allocatable, dimension(:,:), target :: dTdt_LWRAD_data, & - dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & - dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & - dTdt_DCNV_data, dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data - real(kind_phys), allocatable, dimension(:,:,:), target :: dqdt_PBL_data, & - dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data - - ! Scheme initialization flag. - logical :: module_initialized = .false. - - ! Order in process loop for "active" physics process. + ! For time-split physics process we need to call this scheme twice in the SDF, once + ! before the "active" scheme is called, and once after. This is because the active + ! scheme uses an internal physics state that has been advanced forward by a subsequent + ! physics process(es). + character(len=16) :: active_name integer :: iactive_scheme + integer :: proc_start, proc_end + logical :: active_time_split_process=.false. - public ccpp_scheme_simulator_init, ccpp_scheme_simulator_run -contains - - ! ###################################################################################### - ! - ! SUBROUTINE ccpp_scheme_simulator_init - ! - ! ###################################################################################### -!! \section arg_table_ccpp_scheme_simulator_init -!! \htmlinclude ccpp_scheme_simulator_init.html -!! - subroutine ccpp_scheme_simulator_init(mpirank, mpiroot, mpicomm, nlunit, nml_file, & - errmsg, errflg) - - ! Inputs - integer, intent (in) :: mpirank, mpiroot, mpicomm, nlunit - character(len=*), intent (in) :: nml_file - - ! Outputs - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Local variables - integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc - character(len=256) :: fileIN - logical :: exists - integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality - - ! Switches for input data - logical :: have_dTdt_LWRAD_data = .false., & - have_dTdt_SWRAD_data = .false., & - have_dTdt_PBL_data = .false., & - have_dqdt_PBL_data = .false., & - have_dudt_PBL_data = .false., & - have_dvdt_PBL_data = .false., & - have_dTdt_GWD_data = .false., & - have_dudt_GWD_data = .false., & - have_dvdt_GWD_data = .false., & - have_dTdt_SCNV_data = .false., & - have_dudt_SCNV_data = .false., & - have_dvdt_SCNV_data = .false., & - have_dqdt_SCNV_data = .false., & - have_dTdt_DCNV_data = .false., & - have_dudt_DCNV_data = .false., & - have_dvdt_DCNV_data = .false., & - have_dqdt_DCNV_data = .false., & - have_dTdt_cldMP_data = .false., & - have_dqdt_cldMP_data = .false. - - ! Namelist - namelist / scm_data_nml / fileIN, nPhysProcess, proc_LWRAD_config, proc_SWRAD_config, & - proc_PBL_config, proc_GWD_config, proc_SCNV_config, proc_DCNV_config, & - proc_cldMP_config - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (module_initialized) return - module_initialized = .true. - - ! ###################################################################################### - ! - ! Read in namelist - ! - ! ###################################################################################### - inquire (file = trim (nml_file), exist = exists) - if (.not. exists) then - errmsg = 'SCM data tendency :: namelist file: '//trim(nml_file)//' does not exist' - errflg = 1 - return - else - open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) - endif - rewind (nlunit) - read (nlunit, nml = scm_data_nml) - close (nlunit) - - ! ###################################################################################### - ! - ! Error checking - ! - ! ###################################################################################### - ! Only proceed if scheme simulator requested. - if (proc_SWRAD_config(1) .or. proc_LWRAD_config(1) .or. proc_PBL_config(1) .or. & - proc_GWD_config(1) .or. proc_SCNV_config(1) .or. proc_DCNV_config(1) .or. & - proc_cldMP_config(1)) then - do_ccpp_scheme_simulator = .true. - else - return - endif - - ! Check that input data file exists - inquire (file = trim (fileIN), exist = exists) - if (.not. exists) then - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not exist' - errflg = 1 - return - endif - - ! ####################################################################################### - ! - ! Read mandatory information from data file... - ! (ONLY master processor(0), if MPI enabled) - ! - ! ####################################################################################### -#ifdef MPI - if (mpirank .eq. mpiroot) then -#endif - - ! Open file (required) - status = nf90_open(trim(fileIN), NF90_NOWRITE, ncid) - if (status /= nf90_noerr) then - errmsg = 'Error reading in SCM data tendency file: '//trim(fileIN) - errflg = 1 - return - endif - - ! Get dimensions (required) - status = nf90_inq_dimid(ncid, 'time', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [time] dimension' - errflg = 1 - return - endif - ! - status = nf90_inq_dimid(ncid, 'lev', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [lev] dimension' - errflg = 1 - return - endif -#ifdef MPI - endif ! On master processor - - ! Other processors waiting... - call mpi_barrier(mpicomm, mpierr) - - ! ####################################################################################### - ! - ! Broadcast dimensions... - ! (ALL processors) - ! - ! ####################################################################################### - call mpi_bcast(ntime_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) - call mpi_bcast(nlev_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) - call mpi_barrier(mpicomm, mpierr) - - if (mpirank .eq. mpiroot) then -#endif - - ! #################################################################################### - ! - ! What data fields do we have? - ! - ! #################################################################################### - - ! - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) have_dTdt_LWRAD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) have_dTdt_SWRAD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) have_dTdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) have_dqdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) have_dudt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) have_dvdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) have_dTdt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) have_dudt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) have_dvdt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) have_dTdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) have_dudt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) have_dvdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) have_dqdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) have_dTdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) have_dudt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) have_dvdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) have_dqdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) have_dTdt_cldMP_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) have_dqdt_cldMP_data = .true. - -#ifdef MPI - endif ! Master process -#endif - - ! Allocate space for data - allocate(time_data(ntime_data)) - if (have_dTdt_LWRAD_data) allocate(dTdt_LWRAD_data(nlev_data, ntime_data)) - if (have_dTdt_SWRAD_data) allocate(dTdt_SWRAD_data(nlev_data, ntime_data)) - if (have_dTdt_PBL_data) allocate(dTdt_PBL_data( nlev_data, ntime_data)) - if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data, nTrc)) - if (have_dudt_PBL_data) allocate(dudt_PBL_data( nlev_data, ntime_data)) - if (have_dvdt_PBL_data) allocate(dvdt_PBL_data( nlev_data, ntime_data)) - if (have_dTdt_GWD_data) allocate(dTdt_GWD_data( nlev_data, ntime_data)) - if (have_dudt_GWD_data) allocate(dudt_GWD_data( nlev_data, ntime_data)) - if (have_dvdt_GWD_data) allocate(dvdt_GWD_data( nlev_data, ntime_data)) - if (have_dTdt_SCNV_data) allocate(dTdt_SCNV_data( nlev_data, ntime_data)) - if (have_dudt_SCNV_data) allocate(dudt_SCNV_data( nlev_data, ntime_data)) - if (have_dvdt_SCNV_data) allocate(dvdt_SCNV_data( nlev_data, ntime_data)) - if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data, nTrc)) - if (have_dTdt_DCNV_data) allocate(dTdt_DCNV_data( nlev_data, ntime_data)) - if (have_dudt_DCNV_data) allocate(dudt_DCNV_data( nlev_data, ntime_data)) - if (have_dvdt_DCNV_data) allocate(dvdt_DCNV_data( nlev_data, ntime_data)) - if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data, nTrc)) - if (have_dTdt_cldMP_data) allocate(dTdt_cldMP_data(nlev_data, ntime_data)) - if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data, nTrc)) - - ! ####################################################################################### - ! - ! Read in data ... - ! (ONLY master processor(0), if MPI enabled) - ! - ! ####################################################################################### -#ifdef MPI - if (mpirank .eq. mpiroot) then -#endif - - ! Temporal info (required) - status = nf90_inq_varid(ncid, 'times', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, time_data) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' - errflg = 1 - return - endif - - ! Read in physics data tendencies (optional) - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_cldMP_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_cldMP_data) - ! - status = nf90_close(ncid) + ! Set to true in data was loaded into "physics_process" + logical :: do_ccpp_scheme_simulator=.false. -#ifdef MPI - endif ! Master process + public ccpp_scheme_simulator_run - ! Other processors waiting... - call mpi_barrier(mpicomm, mpierr) - ! ####################################################################################### - ! - ! Broadcast data... - ! (ALL processors) - ! - ! ####################################################################################### - - if (have_dTdt_LWRAD_data) then - call mpi_bcast(dTdt_LWRAD_data, size(dTdt_LWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_SWRAD_data) then - call mpi_bcast(dTdt_SWRAD_data, size(dTdt_SWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_PBL_data) then - call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_PBL_data) then - call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_PBL_data) then - call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_PBL_data) then - call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_GWD_data) then - call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_GWD_data) then - call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_GWD_data) then - call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_SCNV_data) then - call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_SCNV_data) then - call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_SCNV_data) then - call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_SCNV_data) then - call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_DCNV_data) then - call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_DCNV_data) then - call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_DCNV_data) then - call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_DCNV_data) then - call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_cldMP_data) then - call mpi_bcast(dTdt_cldMP_data, size(dTdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_cldMP_data) then - call mpi_bcast(dqdt_cldMP_data, size(dqdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - ! - call mpi_barrier(mpicomm, mpierr) -#endif - - ! ####################################################################################### - ! - ! Populate physics_process type. - ! - ! ####################################################################################### - - ! Allocate - allocate(physics_process(nPhysProcess)) - - ! Metadata - do iprc = 1,nPhysProcess - allocate(physics_process(iprc)%itend%dT(nlev_data)) - allocate(physics_process(iprc)%itend%du(nlev_data)) - allocate(physics_process(iprc)%itend%dv(nlev_data)) - allocate(physics_process(iprc)%itend%dq(nlev_data)) - if (iprc == proc_SWRAD_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "SWRAD" - if (proc_SWRAD_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_SWRAD_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_LWRAD_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "LWRAD" - if (proc_LWRAD_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_LWRAD_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_GWD_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "GWD" - if (proc_GWD_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_GWD_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_PBL_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "PBL" - if (proc_PBL_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_PBL_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_SCNV_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "SCNV" - if (proc_SCNV_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_SCNV_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_DCNV_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "DCNV" - if (proc_DCNV_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_DCNV_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_cldMP_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "cldMP" - if (proc_cldMP_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_cldMP_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - enddo - - ! Load data - physics_process(proc_LWRAD_config(3))%tend%time => time_data - physics_process(proc_SWRAD_config(3))%tend%time => time_data - physics_process(proc_PBL_config(3))%tend%time => time_data - physics_process(proc_GWD_config(3))%tend%time => time_data - physics_process(proc_DCNV_config(3))%tend%time => time_data - physics_process(proc_SCNV_config(3))%tend%time => time_data - physics_process(proc_cldMP_config(3))%tend%time => time_data - if (have_dTdt_LWRAD_data) physics_process(proc_SWRAD_config(3))%tend%T => dTdt_LWRAD_data - if (have_dTdt_SWRAD_data) physics_process(proc_LWRAD_config(3))%tend%T => dTdt_SWRAD_data - if (have_dTdt_PBL_data) physics_process(proc_PBL_config(3))%tend%T => dTdt_PBL_data - if (have_dudt_PBL_data) physics_process(proc_PBL_config(3))%tend%u => dudt_PBL_data - if (have_dvdt_PBL_data) physics_process(proc_PBL_config(3))%tend%v => dvdt_PBL_data - if (have_dqdt_PBL_data) physics_process(proc_PBL_config(3))%tend%q => dqdt_PBL_data - if (have_dTdt_GWD_data) physics_process(proc_GWD_config(3))%tend%T => dTdt_GWD_data - if (have_dudt_GWD_data) physics_process(proc_GWD_config(3))%tend%u => dudt_GWD_data - if (have_dvdt_GWD_data) physics_process(proc_GWD_config(3))%tend%v => dvdt_GWD_data - if (have_dTdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%T => dTdt_SCNV_data - if (have_dudt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%u => dudt_SCNV_data - if (have_dvdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%v => dvdt_SCNV_data - if (have_dqdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend%q => dqdt_SCNV_data - if (have_dTdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%T => dTdt_DCNV_data - if (have_dudt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%u => dudt_DCNV_data - if (have_dvdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%v => dvdt_DCNV_data - if (have_dqdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend%q => dqdt_DCNV_data - if (have_dTdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend%T => dTdt_cldMP_data - if (have_dqdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend%q => dqdt_cldMP_data - - ! Which process-scheme is "Active"? - do iprc = 1,nPhysProcess - if (.not. physics_process(iprc)%use_sim) then - iactive_scheme = iprc - endif - enddo - - ! - if (mpirank .eq. mpiroot) then - print*, "----------------------------------" - print*, "--- Using CCPP data tendencies ---" - print*, "----------------------------------" - do iprc = 1,nPhysProcess - if (physics_process(iprc)%use_sim) then - print*," simulate_scheme: ", trim(physics_process(iprc)%name) - print*," order: ", physics_process(iprc)%order - print*," time_split: ", physics_process(iprc)%time_split - endif - enddo - print*, " active_scheme: ", trim(physics_process(iactive_scheme)%name) - print*, " order: ", physics_process(iactive_scheme)%order - print*, " time_split : ", physics_process(iactive_scheme)%time_split - print*, "----------------------------------" - print*, "----------------------------------" - endif - - end subroutine ccpp_scheme_simulator_init +contains ! ###################################################################################### ! @@ -662,7 +124,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Locals integer :: iCol, iLay, iTrc, nCol, nLay, nTrc, ti(1), tf(1), idtend, fcst_year, & - fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, iprc, index_of_process + fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, iprc, index_of_active_process real(kind_phys) :: w1, w2,hrofday real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1, dTdt, dudt, dvdt real(kind_phys), dimension(:,:,:), allocatable :: gq1, dqdt @@ -690,7 +152,27 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay,1)) allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay,1)) - ! Set state + ! Get tendency for "active" process. + ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional + ! array, CCPP standard_name = cumulative_change_of_state_variables. + ! These are not the instantaneous physics tendencies that are applied to the state by the + ! physics schemes. Not all schemes output physics tendencies... + ! Rather these are intended for diagnostic puposes and are accumulated over some interval. + ! In the UFS/SCM this is controlled by the diagnostic bucket interval, namelist option "fhzero". + ! For this to work, you need to clear the diagnostic buckets after each physics timestep when + ! running in the UFS/SCM. + ! In the SCM this is done by adding the following runtime options: + ! --n_itt_out 1 --n_itt_diag 1 + ! + if (active_name == "LWRAD") index_of_active_process = index_of_process_longwave + if (active_name == "SWRAD") index_of_active_process = index_of_process_shortwave + if (active_name == "PBL") index_of_active_process = index_of_process_pbl + if (active_name == "GWD") index_of_active_process = index_of_process_orographic_gwd + if (active_name == "SCNV") index_of_active_process = index_of_process_scnv + if (active_name == "DCNV") index_of_active_process = index_of_process_dcnv + if (active_name == "cldMP") index_of_active_process = index_of_process_mp + + ! Set state at beginning of the physics timestep. gt1(:,:) = tgrs(:,:) gu1(:,:) = ugrs(:,:) gv1(:,:) = vgrs(:,:) @@ -700,70 +182,67 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dvdt(:,:) = 0. dqdt(:,:,1)= 0. - ! Model internal physics timestep evolution of "state". - do iprc = 1,nPhysProcess + ! Internal physics timestep evolution. + do iprc = proc_start,proc_end + if (iprc == iactive_scheme .and. active_time_split_process) then + proc_start = iactive_scheme + exit + endif + do iCol = 1,nCol ! Reset locals - physics_process(iprc)%itend%dT(:) = 0. - physics_process(iprc)%itend%du(:) = 0. - physics_process(iprc)%itend%dv(:) = 0. - physics_process(iprc)%itend%dq(:) = 0. + physics_process(iprc)%tend1d%T(:) = 0. + physics_process(iprc)%tend1d%u(:) = 0. + physics_process(iprc)%tend1d%v(:) = 0. + physics_process(iprc)%tend1d%q(:,1) = 0. ! Using scheme simulator (very simple, interpolate data tendency to local time) if (physics_process(iprc)%use_sim) then - if (associated(physics_process(iprc)%tend%T)) then + if (associated(physics_process(iprc)%tend2d%T)) then errmsg = physics_process(iprc)%linterp("T", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif - if (associated(physics_process(iprc)%tend%u)) then + if (associated(physics_process(iprc)%tend2d%u)) then errmsg = physics_process(iprc)%linterp("u", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif - if (associated(physics_process(iprc)%tend%v)) then + if (associated(physics_process(iprc)%tend2d%v)) then errmsg = physics_process(iprc)%linterp("v", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif - if (associated(physics_process(iprc)%tend%q)) then + if (associated(physics_process(iprc)%tend2d%q)) then errmsg = physics_process(iprc)%linterp("q", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) endif ! Using data tendency from "active" scheme(s). - ! DJS2023: This block is very ufs specific. Need to tidy this up. + ! DJS2023: This block is very ufs specific. See Note Above. else - if (physics_process(iprc)%name == "LWRAD") index_of_process = index_of_process_longwave - if (physics_process(iprc)%name == "SWRAD") index_of_process = index_of_process_shortwave - if (physics_process(iprc)%name == "PBL") index_of_process = index_of_process_pbl - if (physics_process(iprc)%name == "GWD") index_of_process = index_of_process_orographic_gwd - if (physics_process(iprc)%name == "SCNV") index_of_process = index_of_process_scnv - if (physics_process(iprc)%name == "DCNV") index_of_process = index_of_process_dcnv - if (physics_process(iprc)%name == "cldMP") index_of_process = index_of_process_mp - ! - idtend = dtidx(index_of_temperature,index_of_process) - if (idtend >= 1) physics_process(iprc)%itend%dT = dtend(iCol,:,idtend)/dtp + idtend = dtidx(index_of_temperature,index_of_active_process) + if (idtend >= 1) physics_process(iprc)%tend1d%T = dtend(iCol,:,idtend)/dtp ! - idtend = dtidx(index_of_x_wind,index_of_process) - if (idtend >= 1) physics_process(iprc)%itend%du = dtend(iCol,:,idtend)/dtp + idtend = dtidx(index_of_x_wind,index_of_active_process) + if (idtend >= 1) physics_process(iprc)%tend1d%u = dtend(iCol,:,idtend)/dtp ! - idtend = dtidx(index_of_y_wind,index_of_process) - if (idtend >= 1) physics_process(iprc)%itend%dv = dtend(iCol,:,idtend)/dtp + idtend = dtidx(index_of_y_wind,index_of_active_process) + if (idtend >= 1) physics_process(iprc)%tend1d%v = dtend(iCol,:,idtend)/dtp ! - idtend = dtidx(100+ntqv,index_of_process) - if (idtend >= 1) physics_process(iprc)%itend%dq = dtend(iCol,:,idtend)/dtp + idtend = dtidx(100+ntqv,index_of_active_process) + if (idtend >= 1) physics_process(iprc)%tend1d%q(:,1) = dtend(iCol,:,idtend)/dtp endif ! Update state now? if (physics_process(iprc)%time_split) then - gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%itend%dT)*dtp - gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%itend%du)*dtp - gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%itend%dv)*dtp - gq1(iCol,:,1) = gq1(iCol,:,1) + (dqdt(iCol,:,1) + physics_process(iprc)%itend%dq)*dtp + gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp + gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp + gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp + gq1(iCol,:,1) = gq1(iCol,:,1) + (dqdt(iCol,:,1) + physics_process(iprc)%tend1d%q(:,1))*dtp dTdt(iCol,:) = 0. dudt(iCol,:) = 0. dvdt(iCol,:) = 0. dqdt(iCol,:,1) = 0. ! Accumulate tendencies, update later? else - dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%itend%dT - dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%itend%du - dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%itend%dv - dqdt(iCol,:,1) = dqdt(iCol,:,1) + physics_process(iprc)%itend%dq + dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T + dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%tend1d%u + dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v + dqdt(iCol,:,1) = dqdt(iCol,:,1) + physics_process(iprc)%tend1d%q(:,1) endif enddo ! @@ -771,13 +250,18 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp gq0(iCol,:,1) = gq1(iCol,:,1) + dqdt(iCol,:,1)*dtp - enddo + + if (iprc == proc_end) then + proc_start = 1 + endif ! end subroutine ccpp_scheme_simulator_run ! #################################################################################### - ! Utility functions/routines + ! Type-bound procedure to compute tendency profile for time-of-day. + ! + ! For use with 1D data (level, time) tendencies with diurnal (24-hr) forcing. ! #################################################################################### function linterp_1D(this, var_name, year, month, day, hour, minute, second) result(err_message) class(base_physics_process), intent(inout) :: this @@ -785,27 +269,92 @@ function linterp_1D(this, var_name, year, month, day, hour, minute, second) resu integer, intent(in) :: year, month, day, hour, minute, second character(len=128) :: err_message integer :: ti(1), tf(1) - real(kind_phys) :: w1, w2, hrofday + real(kind_phys) :: w1, w2 ! Interpolation weights - hrofday = hour*3600. + minute*60. + second - ti = findloc(abs(this%tend%time-hrofday),minval(abs(this%tend%time-hrofday))) - if (hrofday - this%tend%time(ti(1)) .le. 0) ti = ti-1 - tf = ti + 1 - w1 = (this%tend%time(tf(1))-hrofday) / (this%tend%time(tf(1)) - this%tend%time(ti(1))) - w2 = 1 - w1 + call this%cmp_time_wts(year, month, day, hour, minute, second, w1, w2, ti, tf) select case(var_name) case("T") - this%itend%dT = w1*this%tend%T(:,ti(1)) + w2*this%tend%T(:,tf(1)) + this%tend1d%T = w1*this%tend2d%T(:,ti(1)) + w2*this%tend2d%T(:,tf(1)) case("u") - this%itend%du = w1*this%tend%u(:,ti(1)) + w2*this%tend%u(:,tf(1)) + this%tend1d%u = w1*this%tend2d%u(:,ti(1)) + w2*this%tend2d%u(:,tf(1)) case("v") - this%itend%dv = w1*this%tend%v(:,ti(1)) + w2*this%tend%v(:,tf(1)) + this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1)) case("q") - this%itend%dq = w1*this%tend%q(:,ti(1),1) + w2*this%tend%q(:,tf(1),1) + this%tend1d%q(:,1) = w1*this%tend2d%q(:,ti(1),1) + w2*this%tend2d%q(:,tf(1),1) end select end function linterp_1D - + + ! #################################################################################### + ! Type-bound procedure to compute tendency profile for time-of-day. + ! + ! For use with 2D data (location, level, time) tendencies with diurnal (24-hr) forcing. + ! This assumes that the location dimension has a [longitude, latitude] associated with + ! each location. + ! #################################################################################### + function linterp_2D(this, var_name, lon, lat, year, month, day, hour, minute, second) result(err_message) + class(base_physics_process), intent(inout) :: this + character(len=*), intent(in) :: var_name + integer, intent(in) :: year, month, day, hour, minute, second + real(kind_phys), intent(in) :: lon, lat + character(len=128) :: err_message + integer :: ti(1), tf(1), iNearest + real(kind_phys) :: w1, w2 + + ! Interpolation weights (temporal) + call this%cmp_time_wts(year, month, day, hour, minute, second, w1, w2, ti, tf) + + ! Grab data tendency closest to column [lon,lat] + iNearest = this%find_nearest_loc_2d_1d(lon,lat) + + select case(var_name) + case("T") + this%tend1d%T = w1*this%tend3d%T(iNearest,:,ti(1)) + w2*this%tend3d%T(iNearest,:,tf(1)) + case("u") + this%tend1d%u = w1*this%tend3d%u(iNearest,:,ti(1)) + w2*this%tend3d%u(iNearest,:,tf(1)) + case("v") + this%tend1d%v = w1*this%tend3d%v(iNearest,:,ti(1)) + w2*this%tend3d%v(iNearest,:,tf(1)) + case("q") + this%tend1d%q(:,1) = w1*this%tend3d%q(iNearest,:,ti(1),1) + w2*this%tend3d%q(iNearest,:,tf(1),1) + end select + end function linterp_2D + + ! #################################################################################### + ! Type-bound procedure to find nearest location. + ! + ! For use with linterp_2D, NOT YET IMPLEMENTED. + ! #################################################################################### + pure function find_nearest_loc_2d_1d(this, lon, lat) + class(base_physics_process), intent(in) :: this + real(kind_phys), intent(in) :: lon, lat + integer :: find_nearest_loc_2d_1d + + find_nearest_loc_2d_1d = 1 + end function find_nearest_loc_2d_1d + + ! #################################################################################### + ! Type-bound procedure to compute linear interpolation weights for a diurnal (24-hour) + ! forcing. + ! #################################################################################### + subroutine cmp_time_wts(this, year, month, day, hour, minute, second, w1, w2, ti, tf) + ! Inputs + class(base_physics_process), intent(in) :: this + integer, intent(in) :: year, month, day, hour, minute, second + ! Outputs + integer,intent(out) :: ti(1), tf(1) + real(kind_phys),intent(out) :: w1, w2 + ! Locals + real(kind_phys) :: hrofday + + hrofday = hour*3600. + minute*60. + second + ti = findloc(abs(this%tend2d%time-hrofday),minval(abs(this%tend2d%time-hrofday))) + if (hrofday - this%tend2d%time(ti(1)) .le. 0) ti = ti-1 + tf = ti + 1 + w1 = (this%tend2d%time(tf(1))-hrofday) / (this%tend2d%time(tf(1)) - this%tend2d%time(ti(1))) + w2 = 1 - w1 + + end subroutine cmp_time_wts + end module ccpp_scheme_simulator diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index 80f898ed2..02bf17285 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -3,62 +3,6 @@ type = scheme dependencies = machine.F -######################################################################## -[ccpp-arg-table] - name = ccpp_scheme_simulator_init - type = scheme -[mpirank] - standard_name = mpi_rank - long_name = MPI rank of current process - units = index - dimensions = () - type = integer - intent = in -[mpiroot] - standard_name = mpi_root - long_name = MPI rank of master process - units = index - dimensions = () - type = integer - intent = in -[mpicomm] - standard_name = mpi_communicator - long_name = MPI communicator - units = index - dimensions = () - type = integer - intent = in -[nlunit] - standard_name = iounit_of_namelist - long_name = fortran unit number for opening nameliust file - units = none - dimensions = () - type = integer - intent = in -[nml_file] - standard_name = filename_of_namelist - long_name = namelist filename - units = none - dimensions = () - type = character - kind = len=* - intent = in -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - ######################################################################## [ccpp-arg-table] name = ccpp_scheme_simulator_run diff --git a/physics/load_ccpp_scheme_sim.F90 b/physics/load_ccpp_scheme_sim.F90 new file mode 100644 index 000000000..1041e113c --- /dev/null +++ b/physics/load_ccpp_scheme_sim.F90 @@ -0,0 +1,577 @@ +! ######################################################################################## +! +! CCPP scheme to read and load data for ccpp_scheme_simulator +! +! ######################################################################################## +module load_ccpp_scheme_sim + use machine, only: kind_phys + use netcdf + use ccpp_scheme_simulator, only: do_ccpp_scheme_simulator, physics_process, active_name,& + iactive_scheme, proc_start, proc_end, active_time_split_process +#ifdef MPI + use mpi +#endif + implicit none + + ! ######################################################################################## + ! + ! Configuration for CCPP scheme simulator. Set in namelist. Used during initialization to + ! populate "physics_process" type array, defined in ccpp_scheme_simulator.F90 + ! + ! ######################################################################################## + + ! Number of physics process (set in namelist) + integer :: nPhysProcess + + ! For each process there is a corresponding namelist entry, which is constructed as follows: + ! {use_scheme_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} + integer, dimension(3) :: & + proc_LWRAD_config = (/0,0,0/), & + proc_SWRAD_config = (/0,0,0/), & + proc_PBL_config = (/0,0,0/), & + proc_GWD_config = (/0,0,0/), & + proc_SCNV_config = (/0,0,0/), & + proc_DCNV_config = (/0,0,0/), & + proc_cldMP_config = (/0,0,0/) + + ! Activation flag for scheme. + logical :: do_load_ccpp_scheme = .false. + + ! Data driven physics tendencies + integer :: nlev_data, ntime_data + real(kind_phys), allocatable, dimension(:), target :: time_data + real(kind_phys), allocatable, dimension(:,:), target :: dTdt_LWRAD_data, & + dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & + dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & + dTdt_DCNV_data, dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data + real(kind_phys), allocatable, dimension(:,:,:), target :: dqdt_PBL_data, & + dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data + + ! Scheme initialization flag. + logical :: module_initialized = .false. + + public load_ccpp_scheme_sim_init +contains + + ! ###################################################################################### + ! + ! SUBROUTINE load_ccpp_scheme_sim_init + ! + ! ###################################################################################### +!! \section arg_table_load_ccpp_scheme_sim_init +!! \htmlinclude load_ccpp_scheme_sim_init.html +!! + subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file, & + errmsg, errflg) + + ! Inputs + integer, intent (in) :: mpirank, mpiroot, mpicomm, nlunit + character(len=*), intent (in) :: nml_file + + ! Outputs + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc + character(len=256) :: fileIN + logical :: exists + integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality + + ! Switches for input data + logical :: have_dTdt_LWRAD_data = .false., & + have_dTdt_SWRAD_data = .false., & + have_dTdt_PBL_data = .false., & + have_dqdt_PBL_data = .false., & + have_dudt_PBL_data = .false., & + have_dvdt_PBL_data = .false., & + have_dTdt_GWD_data = .false., & + have_dudt_GWD_data = .false., & + have_dvdt_GWD_data = .false., & + have_dTdt_SCNV_data = .false., & + have_dudt_SCNV_data = .false., & + have_dvdt_SCNV_data = .false., & + have_dqdt_SCNV_data = .false., & + have_dTdt_DCNV_data = .false., & + have_dudt_DCNV_data = .false., & + have_dvdt_DCNV_data = .false., & + have_dqdt_DCNV_data = .false., & + have_dTdt_cldMP_data = .false., & + have_dqdt_cldMP_data = .false. + + ! Namelist + namelist / scm_data_nml / fileIN, nPhysProcess, proc_LWRAD_config, proc_SWRAD_config, & + proc_PBL_config, proc_GWD_config, proc_SCNV_config, proc_DCNV_config, & + proc_cldMP_config + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (module_initialized) return + module_initialized = .true. + + ! ###################################################################################### + ! + ! Part A) Read in namelist and data. + ! + ! ###################################################################################### + + ! Read in namelist + inquire (file = trim (nml_file), exist = exists) + if (.not. exists) then + errmsg = 'SCM data tendency :: namelist file: '//trim(nml_file)//' does not exist' + errflg = 1 + return + else + open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) + endif + rewind (nlunit) + read (nlunit, nml = scm_data_nml) + close (nlunit) + + ! Only proceed if scheme simulator requested. + if (proc_SWRAD_config(1) .or. proc_LWRAD_config(1) .or. proc_PBL_config(1) .or. & + proc_GWD_config(1) .or. proc_SCNV_config(1) .or. proc_DCNV_config(1) .or. & + proc_cldMP_config(1)) then + do_ccpp_scheme_simulator = .true. + else + return + endif + + ! Check that input data file exists + inquire (file = trim (fileIN), exist = exists) + if (.not. exists) then + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not exist' + errflg = 1 + return + endif + + ! Read mandatory information from data file... + ! (ONLY master processor(0), if MPI enabled) +#ifdef MPI + if (mpirank .eq. mpiroot) then +#endif + + ! Open file (required) + status = nf90_open(trim(fileIN), NF90_NOWRITE, ncid) + if (status /= nf90_noerr) then + errmsg = 'Error reading in SCM data tendency file: '//trim(fileIN) + errflg = 1 + return + endif + + ! Get dimensions (required) + status = nf90_inq_dimid(ncid, 'time', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [time] dimension' + errflg = 1 + return + endif + ! + status = nf90_inq_dimid(ncid, 'lev', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [lev] dimension' + errflg = 1 + return + endif +#ifdef MPI + endif ! On master processor + + ! Other processors waiting... + call mpi_barrier(mpicomm, mpierr) + + ! Broadcast dimensions... + ! (ALL processors) + call mpi_bcast(ntime_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) + call mpi_bcast(nlev_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) + call mpi_barrier(mpicomm, mpierr) + + if (mpirank .eq. mpiroot) then +#endif + + ! + ! What data fields do we have? + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) have_dTdt_LWRAD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) have_dTdt_SWRAD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) have_dTdt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) have_dqdt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) have_dudt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) have_dvdt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) have_dTdt_GWD_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) have_dudt_GWD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) have_dvdt_GWD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) have_dTdt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) have_dudt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) have_dvdt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) have_dqdt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) have_dTdt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) have_dudt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) have_dvdt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) have_dqdt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) have_dTdt_cldMP_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) have_dqdt_cldMP_data = .true. + +#ifdef MPI + endif ! Master process +#endif + + ! Allocate space for data + allocate(time_data(ntime_data)) + if (have_dTdt_LWRAD_data) allocate(dTdt_LWRAD_data(nlev_data, ntime_data)) + if (have_dTdt_SWRAD_data) allocate(dTdt_SWRAD_data(nlev_data, ntime_data)) + if (have_dTdt_PBL_data) allocate(dTdt_PBL_data( nlev_data, ntime_data)) + if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data, nTrc)) + if (have_dudt_PBL_data) allocate(dudt_PBL_data( nlev_data, ntime_data)) + if (have_dvdt_PBL_data) allocate(dvdt_PBL_data( nlev_data, ntime_data)) + if (have_dTdt_GWD_data) allocate(dTdt_GWD_data( nlev_data, ntime_data)) + if (have_dudt_GWD_data) allocate(dudt_GWD_data( nlev_data, ntime_data)) + if (have_dvdt_GWD_data) allocate(dvdt_GWD_data( nlev_data, ntime_data)) + if (have_dTdt_SCNV_data) allocate(dTdt_SCNV_data( nlev_data, ntime_data)) + if (have_dudt_SCNV_data) allocate(dudt_SCNV_data( nlev_data, ntime_data)) + if (have_dvdt_SCNV_data) allocate(dvdt_SCNV_data( nlev_data, ntime_data)) + if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data, nTrc)) + if (have_dTdt_DCNV_data) allocate(dTdt_DCNV_data( nlev_data, ntime_data)) + if (have_dudt_DCNV_data) allocate(dudt_DCNV_data( nlev_data, ntime_data)) + if (have_dvdt_DCNV_data) allocate(dvdt_DCNV_data( nlev_data, ntime_data)) + if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data, nTrc)) + if (have_dTdt_cldMP_data) allocate(dTdt_cldMP_data(nlev_data, ntime_data)) + if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data, nTrc)) + + ! Read in data ... + ! (ONLY master processor(0), if MPI enabled) +#ifdef MPI + if (mpirank .eq. mpiroot) then +#endif + + ! Temporal info (required) + status = nf90_inq_varid(ncid, 'times', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, time_data) + else + errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' + errflg = 1 + return + endif + + ! Read in physics data tendencies (optional) + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_GWD_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_GWD_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_GWD_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_cldMP_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_cldMP_data) + ! + status = nf90_close(ncid) + +#ifdef MPI + endif ! Master process + + ! Other processors waiting... + call mpi_barrier(mpicomm, mpierr) + + ! Broadcast data... + ! (ALL processors) + if (have_dTdt_LWRAD_data) then + call mpi_bcast(dTdt_LWRAD_data, size(dTdt_LWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_SWRAD_data) then + call mpi_bcast(dTdt_SWRAD_data, size(dTdt_SWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_PBL_data) then + call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_PBL_data) then + call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_PBL_data) then + call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_PBL_data) then + call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_GWD_data) then + call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_GWD_data) then + call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_GWD_data) then + call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_SCNV_data) then + call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_SCNV_data) then + call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_SCNV_data) then + call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_SCNV_data) then + call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_DCNV_data) then + call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_DCNV_data) then + call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_DCNV_data) then + call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_DCNV_data) then + call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_cldMP_data) then + call mpi_bcast(dTdt_cldMP_data, size(dTdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_cldMP_data) then + call mpi_bcast(dqdt_cldMP_data, size(dqdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + ! + call mpi_barrier(mpicomm, mpierr) +#endif + + ! ####################################################################################### + ! + ! Part B) Populate physics_process type. + ! + ! ####################################################################################### + ! Default process extent (no time-split physics processes) + proc_start = 1 + proc_end = nPhysProcess + + ! Allocate + allocate(physics_process(nPhysProcess)) + + ! Metadata + do iprc = 1,nPhysProcess + allocate(physics_process(iprc)%tend1d%T(nlev_data)) + allocate(physics_process(iprc)%tend1d%u(nlev_data)) + allocate(physics_process(iprc)%tend1d%v(nlev_data)) + allocate(physics_process(iprc)%tend1d%q(nlev_data,1)) + if (iprc == proc_SWRAD_config(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "SWRAD" + if (proc_SWRAD_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_SWRAD_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == proc_LWRAD_config(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "LWRAD" + if (proc_LWRAD_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_LWRAD_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == proc_GWD_config(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "GWD" + if (proc_GWD_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_GWD_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == proc_PBL_config(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "PBL" + if (proc_PBL_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_PBL_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == proc_SCNV_config(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "SCNV" + if (proc_SCNV_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_SCNV_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == proc_DCNV_config(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "DCNV" + if (proc_DCNV_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_DCNV_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == proc_cldMP_config(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "cldMP" + if (proc_cldMP_config(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (proc_cldMP_config(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + enddo + + ! Load data + physics_process(proc_LWRAD_config(3))%tend2d%time => time_data + physics_process(proc_SWRAD_config(3))%tend2d%time => time_data + physics_process(proc_PBL_config(3))%tend2d%time => time_data + physics_process(proc_GWD_config(3))%tend2d%time => time_data + physics_process(proc_DCNV_config(3))%tend2d%time => time_data + physics_process(proc_SCNV_config(3))%tend2d%time => time_data + physics_process(proc_cldMP_config(3))%tend2d%time => time_data + if (have_dTdt_LWRAD_data) physics_process(proc_SWRAD_config(3))%tend2d%T => dTdt_LWRAD_data + if (have_dTdt_SWRAD_data) physics_process(proc_LWRAD_config(3))%tend2d%T => dTdt_SWRAD_data + if (have_dTdt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%T => dTdt_PBL_data + if (have_dudt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%u => dudt_PBL_data + if (have_dvdt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%v => dvdt_PBL_data + if (have_dqdt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%q => dqdt_PBL_data + if (have_dTdt_GWD_data) physics_process(proc_GWD_config(3))%tend2d%T => dTdt_GWD_data + if (have_dudt_GWD_data) physics_process(proc_GWD_config(3))%tend2d%u => dudt_GWD_data + if (have_dvdt_GWD_data) physics_process(proc_GWD_config(3))%tend2d%v => dvdt_GWD_data + if (have_dTdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%T => dTdt_SCNV_data + if (have_dudt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%u => dudt_SCNV_data + if (have_dvdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%v => dvdt_SCNV_data + if (have_dqdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%q => dqdt_SCNV_data + if (have_dTdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%T => dTdt_DCNV_data + if (have_dudt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%u => dudt_DCNV_data + if (have_dvdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%v => dvdt_DCNV_data + if (have_dqdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%q => dqdt_DCNV_data + if (have_dTdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend2d%T => dTdt_cldMP_data + if (have_dqdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend2d%q => dqdt_cldMP_data + + ! Which process-scheme is "Active"? Is it a time-split process? + do iprc = 1,nPhysProcess + if (.not. physics_process(iprc)%use_sim) then + iactive_scheme = iprc + active_name = physics_process(iprc)%name + if (physics_process(iprc)%time_split) then + active_time_split_process = .true. + endif + endif + enddo + + ! + if (mpirank .eq. mpiroot) then + print*, "-----------------------------------" + print*, "--- Using CCPP scheme simulator ---" + print*, "-----------------------------------" + do iprc = 1,nPhysProcess + if (physics_process(iprc)%use_sim) then + print*," simulate_scheme: ", trim(physics_process(iprc)%name) + print*," order: ", physics_process(iprc)%order + print*," time_split: ", physics_process(iprc)%time_split + endif + enddo + print*, " active_scheme: ", trim(active_name) + print*, " order: ", physics_process(iactive_scheme)%order + print*, " time_split : ", active_time_split_process + print*, "-----------------------------------" + print*, "-----------------------------------" + endif + + end subroutine load_ccpp_scheme_sim_init + +end module load_ccpp_scheme_sim diff --git a/physics/load_ccpp_scheme_sim.meta b/physics/load_ccpp_scheme_sim.meta new file mode 100644 index 000000000..6e0aea925 --- /dev/null +++ b/physics/load_ccpp_scheme_sim.meta @@ -0,0 +1,60 @@ +[ccpp-table-properties] + name = load_ccpp_scheme_sim + type = scheme + dependencies = machine.F,ccpp_scheme_simulator.F90 + +######################################################################## +[ccpp-arg-table] + name = load_ccpp_scheme_sim_init + type = scheme +[mpirank] + standard_name = mpi_rank + long_name = MPI rank of current process + units = index + dimensions = () + type = integer + intent = in +[mpiroot] + standard_name = mpi_root + long_name = MPI rank of master process + units = index + dimensions = () + type = integer + intent = in +[mpicomm] + standard_name = mpi_communicator + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in +[nlunit] + standard_name = iounit_of_namelist + long_name = fortran unit number for opening nameliust file + units = none + dimensions = () + type = integer + intent = in +[nml_file] + standard_name = filename_of_namelist + long_name = namelist filename + units = none + dimensions = () + type = character + kind = len=* + intent = in +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out From 8bc8ec909ea493714aa9c8325cd5bb93ef204225 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 13 Feb 2023 11:15:06 -0700 Subject: [PATCH 017/249] Small bug fix to nml --- physics/load_ccpp_scheme_sim.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/load_ccpp_scheme_sim.F90 b/physics/load_ccpp_scheme_sim.F90 index 1041e113c..db2181cf3 100644 --- a/physics/load_ccpp_scheme_sim.F90 +++ b/physics/load_ccpp_scheme_sim.F90 @@ -127,7 +127,7 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) endif rewind (nlunit) - read (nlunit, nml = scm_data_nml) + read (nlunit, nml = scm_data_nml, iostat=status) close (nlunit) ! Only proceed if scheme simulator requested. From 6db4af5baeb306f24466bc601b0b42e787f6cb0c Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 13 Feb 2023 16:52:20 -0700 Subject: [PATCH 018/249] Remove dimension for tracer, handle tracers individualy, not with stacked array --- physics/ccpp_scheme_simulator.F90 | 126 +++++++++++++++-------------- physics/ccpp_scheme_simulator.meta | 4 +- physics/load_ccpp_scheme_sim.F90 | 13 +-- 3 files changed, 74 insertions(+), 69 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 3b478844f..4fffc8bb5 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -15,41 +15,41 @@ module ccpp_scheme_simulator ! ######################################################################################## ! Type containing 1D (time) physics tendencies. type phys_tend_1d - real(kind_phys), dimension(:), pointer :: T - real(kind_phys), dimension(:), pointer :: u - real(kind_phys), dimension(:), pointer :: v - real(kind_phys), dimension(:,:), pointer :: q + real(kind_phys), dimension(:), pointer :: T + real(kind_phys), dimension(:), pointer :: u + real(kind_phys), dimension(:), pointer :: v + real(kind_phys), dimension(:), pointer :: q end type phys_tend_1d ! Type containing 2D (lev,time) physics tendencies. type phys_tend_2d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:,:), pointer :: T - real(kind_phys), dimension(:,:), pointer :: u - real(kind_phys), dimension(:,:), pointer :: v - real(kind_phys), dimension(:,:,:), pointer :: q + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:,:), pointer :: T + real(kind_phys), dimension(:,:), pointer :: u + real(kind_phys), dimension(:,:), pointer :: v + real(kind_phys), dimension(:,:), pointer :: q end type phys_tend_2d ! Type containing 3D (loc,lev,time) physics tendencies. type phys_tend_3d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:), pointer :: lon - real(kind_phys), dimension(:), pointer :: lat - real(kind_phys), dimension(:,:,:), pointer :: T - real(kind_phys), dimension(:,:,:), pointer :: u - real(kind_phys), dimension(:,:,:), pointer :: v - real(kind_phys), dimension(:,:,:,:), pointer :: q + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:), pointer :: lon + real(kind_phys), dimension(:), pointer :: lat + real(kind_phys), dimension(:,:,:), pointer :: T + real(kind_phys), dimension(:,:,:), pointer :: u + real(kind_phys), dimension(:,:,:), pointer :: v + real(kind_phys), dimension(:,:,:), pointer :: q end type phys_tend_3d ! Type containing 4D (lon, lat,lev,time) physics tendencies. type phys_tend_4d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:,:), pointer :: lon - real(kind_phys), dimension(:,:), pointer :: lat - real(kind_phys), dimension(:,:,:,:), pointer :: T - real(kind_phys), dimension(:,:,:,:), pointer :: u - real(kind_phys), dimension(:,:,:,:), pointer :: v - real(kind_phys), dimension(:,:,:,:,:), pointer :: q + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:,:), pointer :: lon + real(kind_phys), dimension(:,:), pointer :: lat + real(kind_phys), dimension(:,:,:,:), pointer :: T + real(kind_phys), dimension(:,:,:,:), pointer :: u + real(kind_phys), dimension(:,:,:,:), pointer :: v + real(kind_phys), dimension(:,:,:,:), pointer :: q end type phys_tend_4d ! This type contains the meta information and data for each physics process. @@ -118,16 +118,16 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Outputs real(kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 - real(kind_phys), intent(inout), dimension(:,:,:) :: gq0 + real(kind_phys), intent(inout), dimension(:,:) :: gq0 character(len=*),intent(out) :: errmsg integer, intent(out) :: errflg ! Locals - integer :: iCol, iLay, iTrc, nCol, nLay, nTrc, ti(1), tf(1), idtend, fcst_year, & - fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec, iprc, index_of_active_process + integer :: iCol, iLay, nCol, nLay, idtend, fcst_year, fcst_month, fcst_day, & + fcst_hour, fcst_min, fcst_sec, iprc, index_of_active_process real(kind_phys) :: w1, w2,hrofday - real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1, dTdt, dudt, dvdt - real(kind_phys), dimension(:,:,:), allocatable :: gq1, dqdt + real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1, dTdt, dudt, dvdt + real(kind_phys), dimension(:,:), allocatable :: gq1, dqdt ! Initialize CCPP error handling variables errmsg = '' @@ -144,13 +144,12 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti fcst_sec = jdat(7) ! Dimensions - nCol = size(gq0(:,1,1)) - nLay = size(gq0(1,:,1)) - nTrc = size(gq0(1,1,:)) + nCol = size(gq0(:,1)) + nLay = size(gq0(1,:)) ! Allocate temporaries - allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay,1)) - allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay,1)) + allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay)) + allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay)) ! Get tendency for "active" process. ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional @@ -173,14 +172,14 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (active_name == "cldMP") index_of_active_process = index_of_process_mp ! Set state at beginning of the physics timestep. - gt1(:,:) = tgrs(:,:) - gu1(:,:) = ugrs(:,:) - gv1(:,:) = vgrs(:,:) - gq1(:,:,1) = qgrs(:,:,1) - dTdt(:,:) = 0. - dudt(:,:) = 0. - dvdt(:,:) = 0. - dqdt(:,:,1)= 0. + gt1(:,:) = tgrs(:,:) + gu1(:,:) = ugrs(:,:) + gv1(:,:) = vgrs(:,:) + gq1(:,:) = qgrs(:,:,1) + dTdt(:,:) = 0. + dudt(:,:) = 0. + dvdt(:,:) = 0. + dqdt(:,:) = 0. ! Internal physics timestep evolution. do iprc = proc_start,proc_end @@ -188,13 +187,14 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti proc_start = iactive_scheme exit endif + print*,'Simulating ',iprc,' of ',proc_end do iCol = 1,nCol ! Reset locals physics_process(iprc)%tend1d%T(:) = 0. physics_process(iprc)%tend1d%u(:) = 0. physics_process(iprc)%tend1d%v(:) = 0. - physics_process(iprc)%tend1d%q(:,1) = 0. + physics_process(iprc)%tend1d%q(:) = 0. ! Using scheme simulator (very simple, interpolate data tendency to local time) if (physics_process(iprc)%use_sim) then @@ -224,32 +224,35 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (idtend >= 1) physics_process(iprc)%tend1d%v = dtend(iCol,:,idtend)/dtp ! idtend = dtidx(100+ntqv,index_of_active_process) - if (idtend >= 1) physics_process(iprc)%tend1d%q(:,1) = dtend(iCol,:,idtend)/dtp + if (idtend >= 1) physics_process(iprc)%tend1d%q = dtend(iCol,:,idtend)/dtp endif ! Update state now? if (physics_process(iprc)%time_split) then - gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp - gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp - gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp - gq1(iCol,:,1) = gq1(iCol,:,1) + (dqdt(iCol,:,1) + physics_process(iprc)%tend1d%q(:,1))*dtp - dTdt(iCol,:) = 0. - dudt(iCol,:) = 0. - dvdt(iCol,:) = 0. - dqdt(iCol,:,1) = 0. + gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp + gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp + gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp + gq1(iCol,:) = gq1(iCol,:) + (dqdt(iCol,:) + physics_process(iprc)%tend1d%q)*dtp + dTdt(iCol,:) = 0. + dudt(iCol,:) = 0. + dvdt(iCol,:) = 0. + dqdt(iCol,:) = 0. ! Accumulate tendencies, update later? else - dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T - dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%tend1d%u - dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v - dqdt(iCol,:,1) = dqdt(iCol,:,1) + physics_process(iprc)%tend1d%q(:,1) + dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T + dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%tend1d%u + dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v + dqdt(iCol,:) = dqdt(iCol,:) + physics_process(iprc)%tend1d%q endif enddo ! - gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp - gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp - gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp - gq0(iCol,:,1) = gq1(iCol,:,1) + dqdt(iCol,:,1)*dtp + do iLay=1,nLay + write(*,'(i3,6f13.6)') ilay, gt0(iCol,iLay) , gt1(iCol,iLay) , dTdt(iCol,iLay)*dtp,physics_process(iprc)%tend1d%T(iLay),physics_process(iprc)%tend2d%T(iLay,3),physics_process(iprc)%tend2d%T(iLay,4) + enddo + gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp + gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp + gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp + gq0(iCol,:) = gq1(iCol,:) + dqdt(iCol,:)*dtp enddo if (iprc == proc_end) then @@ -273,6 +276,7 @@ function linterp_1D(this, var_name, year, month, day, hour, minute, second) resu ! Interpolation weights call this%cmp_time_wts(year, month, day, hour, minute, second, w1, w2, ti, tf) + print*,w1,w2,ti,tf select case(var_name) case("T") @@ -282,7 +286,7 @@ function linterp_1D(this, var_name, year, month, day, hour, minute, second) resu case("v") this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1)) case("q") - this%tend1d%q(:,1) = w1*this%tend2d%q(:,ti(1),1) + w2*this%tend2d%q(:,tf(1),1) + this%tend1d%q = w1*this%tend2d%q(:,ti(1)) + w2*this%tend2d%q(:,tf(1)) end select end function linterp_1D @@ -317,7 +321,7 @@ function linterp_2D(this, var_name, lon, lat, year, month, day, hour, minute, se case("v") this%tend1d%v = w1*this%tend3d%v(iNearest,:,ti(1)) + w2*this%tend3d%v(iNearest,:,tf(1)) case("q") - this%tend1d%q(:,1) = w1*this%tend3d%q(iNearest,:,ti(1),1) + w2*this%tend3d%q(iNearest,:,tf(1),1) + this%tend1d%q = w1*this%tend3d%q(iNearest,:,ti(1)) + w2*this%tend3d%q(iNearest,:,tf(1)) end select end function linterp_2D diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index 02bf17285..c0dc2f172 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -178,10 +178,10 @@ kind = kind_phys intent = inout [gq0] - standard_name = tracer_concentration_of_new_state + standard_name = specific_humidity_of_new_state long_name = tracer concentration updated by physics units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) + dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real kind = kind_phys intent = inout diff --git a/physics/load_ccpp_scheme_sim.F90 b/physics/load_ccpp_scheme_sim.F90 index db2181cf3..b23c15839 100644 --- a/physics/load_ccpp_scheme_sim.F90 +++ b/physics/load_ccpp_scheme_sim.F90 @@ -44,7 +44,7 @@ module load_ccpp_scheme_sim dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & dTdt_DCNV_data, dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data - real(kind_phys), allocatable, dimension(:,:,:), target :: dqdt_PBL_data, & + real(kind_phys), allocatable, dimension(:,:), target :: dqdt_PBL_data, & dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data ! Scheme initialization flag. @@ -262,7 +262,7 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file if (have_dTdt_LWRAD_data) allocate(dTdt_LWRAD_data(nlev_data, ntime_data)) if (have_dTdt_SWRAD_data) allocate(dTdt_SWRAD_data(nlev_data, ntime_data)) if (have_dTdt_PBL_data) allocate(dTdt_PBL_data( nlev_data, ntime_data)) - if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data, nTrc)) + if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data)) if (have_dudt_PBL_data) allocate(dudt_PBL_data( nlev_data, ntime_data)) if (have_dvdt_PBL_data) allocate(dvdt_PBL_data( nlev_data, ntime_data)) if (have_dTdt_GWD_data) allocate(dTdt_GWD_data( nlev_data, ntime_data)) @@ -271,13 +271,13 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file if (have_dTdt_SCNV_data) allocate(dTdt_SCNV_data( nlev_data, ntime_data)) if (have_dudt_SCNV_data) allocate(dudt_SCNV_data( nlev_data, ntime_data)) if (have_dvdt_SCNV_data) allocate(dvdt_SCNV_data( nlev_data, ntime_data)) - if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data, nTrc)) + if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data)) if (have_dTdt_DCNV_data) allocate(dTdt_DCNV_data( nlev_data, ntime_data)) if (have_dudt_DCNV_data) allocate(dudt_DCNV_data( nlev_data, ntime_data)) if (have_dvdt_DCNV_data) allocate(dvdt_DCNV_data( nlev_data, ntime_data)) - if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data, nTrc)) + if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data)) if (have_dTdt_cldMP_data) allocate(dTdt_cldMP_data(nlev_data, ntime_data)) - if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data, nTrc)) + if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data)) ! Read in data ... ! (ONLY master processor(0), if MPI enabled) @@ -301,6 +301,7 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file ! status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) + print*,'dTdt_SWRAD_data: ',dTdt_SWRAD_data ! status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_PBL_data) @@ -441,7 +442,7 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file allocate(physics_process(iprc)%tend1d%T(nlev_data)) allocate(physics_process(iprc)%tend1d%u(nlev_data)) allocate(physics_process(iprc)%tend1d%v(nlev_data)) - allocate(physics_process(iprc)%tend1d%q(nlev_data,1)) + allocate(physics_process(iprc)%tend1d%q(nlev_data)) if (iprc == proc_SWRAD_config(3)) then physics_process(iprc)%order = iprc physics_process(iprc)%name = "SWRAD" From 147cbac00de18dbf4d705d235ec90fcde9dd4ba3 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 13 Feb 2023 21:33:15 -0700 Subject: [PATCH 019/249] Fixed bug in interpolation routine. --- physics/ccpp_scheme_simulator.F90 | 57 +++++++++++++++++++++--------- physics/ccpp_scheme_simulator.meta | 16 +++++++++ physics/load_ccpp_scheme_sim.F90 | 5 +-- 3 files changed, 57 insertions(+), 21 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 4fffc8bb5..957a97862 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -82,6 +82,8 @@ module ccpp_scheme_simulator integer :: iactive_scheme integer :: proc_start, proc_end logical :: active_time_split_process=.false. + logical :: in_pre_active = .true. + logical :: in_post_active = .false. ! Set to true in data was loaded into "physics_process" logical :: do_ccpp_scheme_simulator=.false. @@ -103,7 +105,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gt0, gu0, gv0, gq0, & - errmsg, errflg) + dtdq_pbl, dtdq_mp, errmsg, errflg) ! Inputs integer, intent(in) :: kdt, ntqv, index_of_process_dcnv, & @@ -118,7 +120,7 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Outputs real(kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 - real(kind_phys), intent(inout), dimension(:,:) :: gq0 + real(kind_phys), intent(inout), dimension(:,:) :: gq0, dtdq_pbl, dtdq_mp character(len=*),intent(out) :: errmsg integer, intent(out) :: errflg @@ -181,13 +183,22 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dvdt(:,:) = 0. dqdt(:,:) = 0. + if (in_pre_active) then + proc_start = 1 + proc_end = iactive_scheme-1 + endif + if (in_post_active) then + proc_start = iactive_scheme + proc_end = size(physics_process) + endif + ! Internal physics timestep evolution. do iprc = proc_start,proc_end if (iprc == iactive_scheme .and. active_time_split_process) then - proc_start = iactive_scheme - exit + print*,'Reached active process. ', iprc + else + print*,'Simulating ',iprc,' of ',proc_end endif - print*,'Simulating ',iprc,' of ',proc_end do iCol = 1,nCol ! Reset locals @@ -233,10 +244,10 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp gq1(iCol,:) = gq1(iCol,:) + (dqdt(iCol,:) + physics_process(iprc)%tend1d%q)*dtp - dTdt(iCol,:) = 0. - dudt(iCol,:) = 0. - dvdt(iCol,:) = 0. - dqdt(iCol,:) = 0. + !dTdt(iCol,:) = 0. + !dudt(iCol,:) = 0. + !dvdt(iCol,:) = 0. + !dqdt(iCol,:) = 0. ! Accumulate tendencies, update later? else dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T @@ -244,10 +255,17 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v dqdt(iCol,:) = dqdt(iCol,:) + physics_process(iprc)%tend1d%q endif + ! These are needed by samfshalcnv + if (trim(physics_process(iprc)%name) == "PBL") then + dtdq_pbl(iCol,:) = physics_process(iprc)%tend1d%q + endif + if (trim(physics_process(iprc)%name) == "cldMP") then + dtdq_mp(iCol,:) = physics_process(iprc)%tend1d%q + endif enddo ! do iLay=1,nLay - write(*,'(i3,6f13.6)') ilay, gt0(iCol,iLay) , gt1(iCol,iLay) , dTdt(iCol,iLay)*dtp,physics_process(iprc)%tend1d%T(iLay),physics_process(iprc)%tend2d%T(iLay,3),physics_process(iprc)%tend2d%T(iLay,4) + !write(*,'(i3,4f13.6)') ilay, gq0(iCol,iLay) , gq1(iCol,iLay) , dqdt(iCol,iLay)*dtp, physics_process(iprc)%tend1d%q(iLay)*dtp enddo gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp @@ -255,9 +273,16 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti gq0(iCol,:) = gq1(iCol,:) + dqdt(iCol,:)*dtp enddo - if (iprc == proc_end) then - proc_start = 1 + if (in_pre_active) then + in_pre_active = .false. + in_post_active = .true. endif + + if (size(physics_process)+1 == iprc) then + in_pre_active = .true. + in_post_active = .false. + endif + ! end subroutine ccpp_scheme_simulator_run @@ -276,7 +301,6 @@ function linterp_1D(this, var_name, year, month, day, hour, minute, second) resu ! Interpolation weights call this%cmp_time_wts(year, month, day, hour, minute, second, w1, w2, ti, tf) - print*,w1,w2,ti,tf select case(var_name) case("T") @@ -353,10 +377,9 @@ subroutine cmp_time_wts(this, year, month, day, hour, minute, second, w1, w2, ti real(kind_phys) :: hrofday hrofday = hour*3600. + minute*60. + second - ti = findloc(abs(this%tend2d%time-hrofday),minval(abs(this%tend2d%time-hrofday))) - if (hrofday - this%tend2d%time(ti(1)) .le. 0) ti = ti-1 - tf = ti + 1 - w1 = (this%tend2d%time(tf(1))-hrofday) / (this%tend2d%time(tf(1)) - this%tend2d%time(ti(1))) + ti = max(hour,1) + tf = min(ti + 1,24) + w1 = ((hour+1)*3600 - hrofday)/3600 w2 = 1 - w1 end subroutine cmp_time_wts diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index c0dc2f172..888ba2f8d 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -185,6 +185,22 @@ type = real kind = kind_phys intent = inout +[dtdq_pbl] + standard_name = instantaneous_tendency_of_specific_humidity_due_to_PBL + long_name = instantaneous_tendency_of_specific_humidity_due_to_PBL + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[dtdq_mp] + standard_name = instantaneous_tendency_of_specific_humidity_due_to_microphysics + long_name = moisture tendency due to microphysics + units = kg kg-1 s-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/load_ccpp_scheme_sim.F90 b/physics/load_ccpp_scheme_sim.F90 index b23c15839..8f4c7ee57 100644 --- a/physics/load_ccpp_scheme_sim.F90 +++ b/physics/load_ccpp_scheme_sim.F90 @@ -7,7 +7,7 @@ module load_ccpp_scheme_sim use machine, only: kind_phys use netcdf use ccpp_scheme_simulator, only: do_ccpp_scheme_simulator, physics_process, active_name,& - iactive_scheme, proc_start, proc_end, active_time_split_process + iactive_scheme, active_time_split_process #ifdef MPI use mpi #endif @@ -430,9 +430,6 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file ! Part B) Populate physics_process type. ! ! ####################################################################################### - ! Default process extent (no time-split physics processes) - proc_start = 1 - proc_end = nPhysProcess ! Allocate allocate(physics_process(nPhysProcess)) From a29638959bf2202d3132b8e5ae57db7774213f1d Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 16 Feb 2023 21:02:27 -0700 Subject: [PATCH 020/249] Moew changes --- physics/ccpp_scheme_simulator.F90 | 230 +++++++++++++++++++++++------- physics/load_ccpp_scheme_sim.F90 | 31 ++-- 2 files changed, 203 insertions(+), 58 deletions(-) diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 957a97862..f75580fb9 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -74,14 +74,18 @@ module ccpp_scheme_simulator type(base_physics_process), dimension(:), allocatable :: & physics_process + ! Do not change these! ! For time-split physics process we need to call this scheme twice in the SDF, once ! before the "active" scheme is called, and once after. This is because the active ! scheme uses an internal physics state that has been advanced forward by a subsequent ! physics process(es). - character(len=16) :: active_name - integer :: iactive_scheme + integer :: nactive_proc + character(len=16),allocatable,dimension(:) :: active_name + integer,allocatable,dimension(:) :: iactive_scheme + logical,allocatable,dimension(:) :: active_time_split_process + integer :: iactive_scheme_inloop = 1 + integer :: proc_start, proc_end - logical :: active_time_split_process=.false. logical :: in_pre_active = .true. logical :: in_post_active = .false. @@ -125,8 +129,8 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti integer, intent(out) :: errflg ! Locals - integer :: iCol, iLay, nCol, nLay, idtend, fcst_year, fcst_month, fcst_day, & - fcst_hour, fcst_min, fcst_sec, iprc, index_of_active_process + integer :: iCol, iLay, nCol, nLay, idtend, year, month, day, hour, min, sec, iprc, & + index_of_active_process real(kind_phys) :: w1, w2,hrofday real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1, dTdt, dudt, dvdt real(kind_phys), dimension(:,:), allocatable :: gq1, dqdt @@ -138,12 +142,12 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (.not. do_ccpp_scheme_simulator) return ! Current forecast time (Data-format specific) - fcst_year = jdat(1) - fcst_month = jdat(2) - fcst_day = jdat(3) - fcst_hour = jdat(5) - fcst_min = jdat(6) - fcst_sec = jdat(7) + year = jdat(1) + month = jdat(2) + day = jdat(3) + hour = jdat(5) + min = jdat(6) + sec = jdat(7) ! Dimensions nCol = size(gq0(:,1)) @@ -165,13 +169,13 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! In the SCM this is done by adding the following runtime options: ! --n_itt_out 1 --n_itt_diag 1 ! - if (active_name == "LWRAD") index_of_active_process = index_of_process_longwave - if (active_name == "SWRAD") index_of_active_process = index_of_process_shortwave - if (active_name == "PBL") index_of_active_process = index_of_process_pbl - if (active_name == "GWD") index_of_active_process = index_of_process_orographic_gwd - if (active_name == "SCNV") index_of_active_process = index_of_process_scnv - if (active_name == "DCNV") index_of_active_process = index_of_process_dcnv - if (active_name == "cldMP") index_of_active_process = index_of_process_mp + if (active_name(iactive_scheme_inloop) == "LWRAD") index_of_active_process = index_of_process_longwave + if (active_name(iactive_scheme_inloop) == "SWRAD") index_of_active_process = index_of_process_shortwave + if (active_name(iactive_scheme_inloop) == "PBL") index_of_active_process = index_of_process_pbl + if (active_name(iactive_scheme_inloop) == "GWD") index_of_active_process = index_of_process_orographic_gwd + if (active_name(iactive_scheme_inloop) == "SCNV") index_of_active_process = index_of_process_scnv + if (active_name(iactive_scheme_inloop) == "DCNV") index_of_active_process = index_of_process_dcnv + if (active_name(iactive_scheme_inloop) == "cldMP") index_of_active_process = index_of_process_mp ! Set state at beginning of the physics timestep. gt1(:,:) = tgrs(:,:) @@ -185,16 +189,16 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (in_pre_active) then proc_start = 1 - proc_end = iactive_scheme-1 + proc_end = max(1,iactive_scheme(iactive_scheme_inloop)-1) endif if (in_post_active) then - proc_start = iactive_scheme + proc_start = iactive_scheme(iactive_scheme_inloop) proc_end = size(physics_process) endif ! Internal physics timestep evolution. do iprc = proc_start,proc_end - if (iprc == iactive_scheme .and. active_time_split_process) then + if (iprc == iactive_scheme(iactive_scheme_inloop)) then print*,'Reached active process. ', iprc else print*,'Simulating ',iprc,' of ',proc_end @@ -209,17 +213,26 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Using scheme simulator (very simple, interpolate data tendency to local time) if (physics_process(iprc)%use_sim) then - if (associated(physics_process(iprc)%tend2d%T)) then - errmsg = physics_process(iprc)%linterp("T", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) + if (physics_process(iprc)%name == "LWRAD") then + call sim_LWRAD(year, month, day, hour, min, sec, physics_process(iprc)) + endif + if (physics_process(iprc)%name == "SWRAD")then + call sim_SWRAD(year, month, day, hour, min, sec, physics_process(iprc)) + endif + if (physics_process(iprc)%name == "GWD")then + call sim_GWD(year, month, day, hour, min, sec, physics_process(iprc)) + endif + if (physics_process(iprc)%name == "PBL")then + call sim_PBL(year, month, day, hour, min, sec, physics_process(iprc)) endif - if (associated(physics_process(iprc)%tend2d%u)) then - errmsg = physics_process(iprc)%linterp("u", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) + if (physics_process(iprc)%name == "SCNV")then + call sim_SCNV(year, month, day, hour, min, sec, physics_process(iprc)) endif - if (associated(physics_process(iprc)%tend2d%v)) then - errmsg = physics_process(iprc)%linterp("v", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) + if (physics_process(iprc)%name == "DCNV")then + call sim_DCNV(year, month, day, hour, min, sec, physics_process(iprc)) endif - if (associated(physics_process(iprc)%tend2d%q)) then - errmsg = physics_process(iprc)%linterp("q", fcst_year, fcst_month, fcst_day, fcst_hour, fcst_min, fcst_sec) + if (physics_process(iprc)%name == "cldMP")then + call sim_cldMP(year, month, day, hour, min, sec, physics_process(iprc)) endif ! Using data tendency from "active" scheme(s). @@ -240,28 +253,23 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti ! Update state now? if (physics_process(iprc)%time_split) then + print*,' time-split scheme...' gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp gq1(iCol,:) = gq1(iCol,:) + (dqdt(iCol,:) + physics_process(iprc)%tend1d%q)*dtp - !dTdt(iCol,:) = 0. - !dudt(iCol,:) = 0. - !dvdt(iCol,:) = 0. - !dqdt(iCol,:) = 0. + dTdt(iCol,:) = 0. + dudt(iCol,:) = 0. + dvdt(iCol,:) = 0. + dqdt(iCol,:) = 0. ! Accumulate tendencies, update later? else + print*,' process-split scheme...' dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%tend1d%u dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v dqdt(iCol,:) = dqdt(iCol,:) + physics_process(iprc)%tend1d%q endif - ! These are needed by samfshalcnv - if (trim(physics_process(iprc)%name) == "PBL") then - dtdq_pbl(iCol,:) = physics_process(iprc)%tend1d%q - endif - if (trim(physics_process(iprc)%name) == "cldMP") then - dtdq_mp(iCol,:) = physics_process(iprc)%tend1d%q - endif enddo ! do iLay=1,nLay @@ -281,6 +289,11 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti if (size(physics_process)+1 == iprc) then in_pre_active = .true. in_post_active = .false. + iactive_scheme_inloop = 1 + endif + + if (iactive_scheme_inloop < nactive_proc) then + iactive_scheme_inloop = iactive_scheme_inloop + 1 endif ! @@ -291,16 +304,16 @@ end subroutine ccpp_scheme_simulator_run ! ! For use with 1D data (level, time) tendencies with diurnal (24-hr) forcing. ! #################################################################################### - function linterp_1D(this, var_name, year, month, day, hour, minute, second) result(err_message) + function linterp_1D(this, var_name, year, month, day, hour, min, sec) result(err_message) class(base_physics_process), intent(inout) :: this character(len=*), intent(in) :: var_name - integer, intent(in) :: year, month, day, hour, minute, second + integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: err_message integer :: ti(1), tf(1) real(kind_phys) :: w1, w2 ! Interpolation weights - call this%cmp_time_wts(year, month, day, hour, minute, second, w1, w2, ti, tf) + call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) select case(var_name) case("T") @@ -322,17 +335,17 @@ end function linterp_1D ! This assumes that the location dimension has a [longitude, latitude] associated with ! each location. ! #################################################################################### - function linterp_2D(this, var_name, lon, lat, year, month, day, hour, minute, second) result(err_message) + function linterp_2D(this, var_name, lon, lat, year, month, day, hour, min, sec) result(err_message) class(base_physics_process), intent(inout) :: this character(len=*), intent(in) :: var_name - integer, intent(in) :: year, month, day, hour, minute, second + integer, intent(in) :: year, month, day, hour, min, sec real(kind_phys), intent(in) :: lon, lat character(len=128) :: err_message integer :: ti(1), tf(1), iNearest real(kind_phys) :: w1, w2 ! Interpolation weights (temporal) - call this%cmp_time_wts(year, month, day, hour, minute, second, w1, w2, ti, tf) + call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) ! Grab data tendency closest to column [lon,lat] iNearest = this%find_nearest_loc_2d_1d(lon,lat) @@ -366,17 +379,17 @@ end function find_nearest_loc_2d_1d ! Type-bound procedure to compute linear interpolation weights for a diurnal (24-hour) ! forcing. ! #################################################################################### - subroutine cmp_time_wts(this, year, month, day, hour, minute, second, w1, w2, ti, tf) + subroutine cmp_time_wts(this, year, month, day, hour, minute, sec, w1, w2, ti, tf) ! Inputs class(base_physics_process), intent(in) :: this - integer, intent(in) :: year, month, day, hour, minute, second + integer, intent(in) :: year, month, day, hour, minute, sec ! Outputs integer,intent(out) :: ti(1), tf(1) real(kind_phys),intent(out) :: w1, w2 ! Locals real(kind_phys) :: hrofday - hrofday = hour*3600. + minute*60. + second + hrofday = hour*3600. + minute*60. + sec ti = max(hour,1) tf = min(ti + 1,24) w1 = ((hour+1)*3600 - hrofday)/3600 @@ -384,4 +397,123 @@ subroutine cmp_time_wts(this, year, month, day, hour, minute, second, w1, w2, ti end subroutine cmp_time_wts + ! #################################################################################### + subroutine sim_LWRAD( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + + end subroutine sim_LWRAD + + ! #################################################################################### + subroutine sim_SWRAD( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + + end subroutine sim_SWRAD + + ! #################################################################################### + subroutine sim_GWD( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + + end subroutine sim_GWD + + ! #################################################################################### + subroutine sim_PBL( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + + end subroutine sim_PBL + + ! #################################################################################### + subroutine sim_DCNV( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + + end subroutine sim_DCNV + + ! #################################################################################### + subroutine sim_SCNV( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + + end subroutine sim_SCNV + + ! #################################################################################### + subroutine sim_cldMP( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + end subroutine sim_cldMP + end module ccpp_scheme_simulator diff --git a/physics/load_ccpp_scheme_sim.F90 b/physics/load_ccpp_scheme_sim.F90 index 8f4c7ee57..1fb3dc983 100644 --- a/physics/load_ccpp_scheme_sim.F90 +++ b/physics/load_ccpp_scheme_sim.F90 @@ -7,7 +7,7 @@ module load_ccpp_scheme_sim use machine, only: kind_phys use netcdf use ccpp_scheme_simulator, only: do_ccpp_scheme_simulator, physics_process, active_name,& - iactive_scheme, active_time_split_process + iactive_scheme, active_time_split_process, nactive_proc #ifdef MPI use mpi #endif @@ -73,7 +73,7 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file integer, intent(out) :: errflg ! Local variables - integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc + integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc, iactive character(len=256) :: fileIN logical :: exists integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality @@ -540,13 +540,23 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file if (have_dTdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend2d%T => dTdt_cldMP_data if (have_dqdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend2d%q => dqdt_cldMP_data - ! Which process-scheme is "Active"? Is it a time-split process? + ! How many active schemes are there? + nactive_proc = 0 + iactive = 0 + do iprc = 1,nPhysProcess + if (.not. physics_process(iprc)%use_sim) nactive_proc = nactive_proc + 1 + enddo + allocate(iactive_scheme(nactive_proc),active_name(nactive_proc),active_time_split_process(nactive_proc)) + + ! Which process-scheme(s) is(are) "Active"? Are they time-split process? + active_time_split_process(:) = .false. do iprc = 1,nPhysProcess if (.not. physics_process(iprc)%use_sim) then - iactive_scheme = iprc - active_name = physics_process(iprc)%name + iactive = iactive + 1 + iactive_scheme(iactive) = iprc + active_name(iactive) = physics_process(iprc)%name if (physics_process(iprc)%time_split) then - active_time_split_process = .true. + active_time_split_process(iactive) = .true. endif endif enddo @@ -556,16 +566,19 @@ subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file print*, "-----------------------------------" print*, "--- Using CCPP scheme simulator ---" print*, "-----------------------------------" + iactive = 1 do iprc = 1,nPhysProcess if (physics_process(iprc)%use_sim) then print*," simulate_scheme: ", trim(physics_process(iprc)%name) print*," order: ", physics_process(iprc)%order print*," time_split: ", physics_process(iprc)%time_split + else + print*, " active_scheme: ", trim(active_name(iactive)) + print*, " order: ", physics_process(iactive_scheme(iactive))%order + print*, " time_split : ", active_time_split_process(iactive) + iactive = iactive + 1 endif enddo - print*, " active_scheme: ", trim(active_name) - print*, " order: ", physics_process(iactive_scheme)%order - print*, " time_split : ", active_time_split_process print*, "-----------------------------------" print*, "-----------------------------------" endif From 40e092d0d92d0c78848acc47ae83629908375a6c Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Thu, 23 Feb 2023 14:28:26 -0700 Subject: [PATCH 021/249] add runoff and drain to land coupling --- physics/sfc_land.f | 19 +++++++++++++++---- physics/sfc_land.meta | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 4 deletions(-) diff --git a/physics/sfc_land.f b/physics/sfc_land.f index ab0691251..f7aebe171 100644 --- a/physics/sfc_land.f +++ b/physics/sfc_land.f @@ -37,9 +37,10 @@ subroutine sfc_land_run & & ( im, cpllnd, cpllnd2atm, flag_iter, dry, & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & & ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & + & runoff_lnd, drain_lnd, ! --- outputs: & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & - & gflux, & + & gflux, runoff, drain, & & errmsg, errflg, naux2d, aux2d & ) @@ -54,9 +55,10 @@ subroutine sfc_land_run & ! ( im, cpllnd, cpllnd2atm, flag_iter, dry, ! ! sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ! ! ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, ! +! runoff_lnd, drain_lnd, ! ! outputs: ! ! sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, ! -! gflux, ! +! gflux, runoff, drain, ! ! errmsg, errflg) ! ! ! ! ==================== defination of variables ==================== ! @@ -75,6 +77,8 @@ subroutine sfc_land_run & ! t2mmp_lnd - real , 2m temperature ! q2mp_lnd - real , 2m specific humidity ! gflux_lnd - real , soil heat flux over land +! runoff_lnd - real , surface runoff +! drain_lnd - real , subsurface runoff ! outputs: ! sncovr1 - real , snow cover over land ! qsurf - real , specific humidity at sfc @@ -84,6 +88,8 @@ subroutine sfc_land_run & ! t2mmp - real , temperature at 2m ! q2mp - real , specific humidity at 2m ! gflux - real , soil heat flux over land +! runoff - real , surface runoff +! drain - real , subsurface runoff ! ==================== end of description ===================== ! ! ! @@ -98,11 +104,12 @@ subroutine sfc_land_run & real (kind=kind_phys), dimension(:), intent(in) :: & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ep_lnd, & - & t2mmp_lnd, q2mp_lnd, gflux_lnd + & t2mmp_lnd, q2mp_lnd, gflux_lnd, runoff_lnd, drain_lnd ! --- outputs: real (kind=kind_phys), dimension(:), intent(out) :: & - & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, gflux + & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, gflux, & + & runoff, drain ! character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -129,6 +136,8 @@ subroutine sfc_land_run & t2mmp(i) = t2mmp_lnd(i) q2mp(i) = q2mp_lnd(i) gflux(i) = gflux_lnd(i) + drain(i) = drain_lnd(i) + runoff(i) = runoff_lnd(i) enddo aux2d(:,1) = sncovr1(:) @@ -139,6 +148,8 @@ subroutine sfc_land_run & aux2d(:,6) = t2mmp(:) aux2d(:,7) = q2mp(:) aux2d(:,8) = gflux(:) + aux2d(:,9) = drain(:) + aux2d(:,10) = runoff(:) return !----------------------------------- diff --git a/physics/sfc_land.meta b/physics/sfc_land.meta index 50ddecd46..60a853b89 100644 --- a/physics/sfc_land.meta +++ b/physics/sfc_land.meta @@ -106,6 +106,22 @@ type = real kind = kind_phys intent = in +[runoff_lnd] + standard_name = surface_runoff_flux_from_land + long_name = surface runoff flux over land for coupling + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[drain_lnd] + standard_name = subsurface_runoff_flux_from_land + long_name = subsurface runoff flux over land for coupling + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [sncovr1] standard_name = surface_snow_area_fraction_over_land long_name = surface snow area fraction @@ -170,6 +186,22 @@ type = real kind = kind_phys intent = out +[runoff] + standard_name = surface_runoff_flux + long_name = surface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[drain] + standard_name = subsurface_runoff_flux + long_name = subsurface runoff flux + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 64fdd5aa53672132bf1295701a9d7844232f336b Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Tue, 7 Mar 2023 11:00:00 -0700 Subject: [PATCH 022/249] add exchange coefficents --- physics/sfc_land.f | 23 ++++++++++++++++------- physics/sfc_land.meta | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+), 7 deletions(-) diff --git a/physics/sfc_land.f b/physics/sfc_land.f index f7aebe171..0436519a5 100644 --- a/physics/sfc_land.f +++ b/physics/sfc_land.f @@ -37,10 +37,10 @@ subroutine sfc_land_run & & ( im, cpllnd, cpllnd2atm, flag_iter, dry, & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & & ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & - & runoff_lnd, drain_lnd, + & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, ! --- outputs: & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & - & gflux, runoff, drain, & + & gflux, runoff, drain, cmm, chh, & & errmsg, errflg, naux2d, aux2d & ) @@ -55,10 +55,10 @@ subroutine sfc_land_run & ! ( im, cpllnd, cpllnd2atm, flag_iter, dry, ! ! sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ! ! ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, ! -! runoff_lnd, drain_lnd, ! +! runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, ! ! outputs: ! ! sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, ! -! gflux, runoff, drain, ! +! gflux, runoff, drain, cmm, chh, ! ! errmsg, errflg) ! ! ! ! ==================== defination of variables ==================== ! @@ -79,6 +79,8 @@ subroutine sfc_land_run & ! gflux_lnd - real , soil heat flux over land ! runoff_lnd - real , surface runoff ! drain_lnd - real , subsurface runoff +! cmm_lnd - real , surface drag wind speed for momentum +! chh_lnd - real , surface drag mass flux for heat and moisture ! outputs: ! sncovr1 - real , snow cover over land ! qsurf - real , specific humidity at sfc @@ -89,7 +91,9 @@ subroutine sfc_land_run & ! q2mp - real , specific humidity at 2m ! gflux - real , soil heat flux over land ! runoff - real , surface runoff -! drain - real , subsurface runoff +! drain - real , subsurface runoff +! cmm - real , surface drag wind speed for momentum +! chh - real , surface drag mass flux for heat and moisture ! ==================== end of description ===================== ! ! ! @@ -104,12 +108,13 @@ subroutine sfc_land_run & real (kind=kind_phys), dimension(:), intent(in) :: & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ep_lnd, & - & t2mmp_lnd, q2mp_lnd, gflux_lnd, runoff_lnd, drain_lnd + & t2mmp_lnd, q2mp_lnd, gflux_lnd, runoff_lnd, drain_lnd, & + & cmm_lnd, chh_lnd ! --- outputs: real (kind=kind_phys), dimension(:), intent(out) :: & & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, gflux, & - & runoff, drain + & runoff, drain, cmm, chh ! character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -138,6 +143,8 @@ subroutine sfc_land_run & gflux(i) = gflux_lnd(i) drain(i) = drain_lnd(i) runoff(i) = runoff_lnd(i) + cmm(i) = cmm_lnd(i) + chh(i) = chh_lnd(i) enddo aux2d(:,1) = sncovr1(:) @@ -150,6 +157,8 @@ subroutine sfc_land_run & aux2d(:,8) = gflux(:) aux2d(:,9) = drain(:) aux2d(:,10) = runoff(:) + aux2d(:,11) = cmm(:) + aux2d(:,12) = chh(:) return !----------------------------------- diff --git a/physics/sfc_land.meta b/physics/sfc_land.meta index 60a853b89..99a795c65 100644 --- a/physics/sfc_land.meta +++ b/physics/sfc_land.meta @@ -122,6 +122,22 @@ type = real kind = kind_phys intent = in +[cmm_lnd] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land_from_land + long_name = momentum exchange coefficient over land for coupling + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[chh_lnd] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land_from_land + long_name = thermal exchange coefficient over land for coupling + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [sncovr1] standard_name = surface_snow_area_fraction_over_land long_name = surface snow area fraction @@ -202,6 +218,22 @@ type = real kind = kind_phys intent = out +[cmm] + standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land + long_name = momentum exchange coefficient over land + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[chh] + standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land + long_name = thermal exchange coefficient over land + units = kg m-2 s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 91a9b44eac42dfaf047cfc79718fa0332db0979d Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Tue, 7 Mar 2023 22:40:41 -0700 Subject: [PATCH 023/249] add zvfun to land coupling --- physics/sfc_land.f | 15 ++++++++++----- physics/sfc_land.meta | 16 ++++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/physics/sfc_land.f b/physics/sfc_land.f index 0436519a5..44a9b5a06 100644 --- a/physics/sfc_land.f +++ b/physics/sfc_land.f @@ -37,10 +37,10 @@ subroutine sfc_land_run & & ( im, cpllnd, cpllnd2atm, flag_iter, dry, & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & & ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & - & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, + & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & ! --- outputs: & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & - & gflux, runoff, drain, cmm, chh, & + & gflux, runoff, drain, cmm, chh, zvfun, & & errmsg, errflg, naux2d, aux2d & ) @@ -56,9 +56,10 @@ subroutine sfc_land_run & ! sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ! ! ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, ! ! runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, ! +! zvfun_lnd, ! ! outputs: ! ! sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, ! -! gflux, runoff, drain, cmm, chh, ! +! gflux, runoff, drain, cmm, chh, zvfun, ! ! errmsg, errflg) ! ! ! ! ==================== defination of variables ==================== ! @@ -81,6 +82,7 @@ subroutine sfc_land_run & ! drain_lnd - real , subsurface runoff ! cmm_lnd - real , surface drag wind speed for momentum ! chh_lnd - real , surface drag mass flux for heat and moisture +! zvfun_lnd - real , function of surface roughness length and green vegetation fraction ! outputs: ! sncovr1 - real , snow cover over land ! qsurf - real , specific humidity at sfc @@ -94,6 +96,7 @@ subroutine sfc_land_run & ! drain - real , subsurface runoff ! cmm - real , surface drag wind speed for momentum ! chh - real , surface drag mass flux for heat and moisture +! zvfun - real , function of surface roughness length and green vegetation fraction ! ==================== end of description ===================== ! ! ! @@ -109,12 +112,12 @@ subroutine sfc_land_run & real (kind=kind_phys), dimension(:), intent(in) :: & & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ep_lnd, & & t2mmp_lnd, q2mp_lnd, gflux_lnd, runoff_lnd, drain_lnd, & - & cmm_lnd, chh_lnd + & cmm_lnd, chh_lnd, zvfun_lnd ! --- outputs: real (kind=kind_phys), dimension(:), intent(out) :: & & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, gflux, & - & runoff, drain, cmm, chh + & runoff, drain, cmm, chh, zvfun ! character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -145,6 +148,7 @@ subroutine sfc_land_run & runoff(i) = runoff_lnd(i) cmm(i) = cmm_lnd(i) chh(i) = chh_lnd(i) + zvfun(i) = zvfun_lnd(i) enddo aux2d(:,1) = sncovr1(:) @@ -159,6 +163,7 @@ subroutine sfc_land_run & aux2d(:,10) = runoff(:) aux2d(:,11) = cmm(:) aux2d(:,12) = chh(:) + aux2d(:,13) = zvfun(:) return !----------------------------------- diff --git a/physics/sfc_land.meta b/physics/sfc_land.meta index 99a795c65..a146dec3a 100644 --- a/physics/sfc_land.meta +++ b/physics/sfc_land.meta @@ -138,6 +138,14 @@ type = real kind = kind_phys intent = in +[zvfun_lnd] + standard_name = function_of_surface_roughness_length_and_green_vegetation_fraction_from_land + long_name = function of surface roughness length and green vegetation fraction + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [sncovr1] standard_name = surface_snow_area_fraction_over_land long_name = surface snow area fraction @@ -234,6 +242,14 @@ type = real kind = kind_phys intent = out +[zvfun] + standard_name = function_of_surface_roughness_length_and_green_vegetation_fraction + long_name = function of surface roughness length and green vegetation fraction + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 347d74520d1bb8312ad4cceba1ec6c6038b8c650 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Thu, 16 Mar 2023 17:46:04 +0000 Subject: [PATCH 024/249] Use mpi_f08 in rrtmgp_lw_main and rrtmgp_sw_main --- physics/rrtmgp_lw_main.F90 | 4 +++- physics/rrtmgp_lw_main.meta | 4 ++-- physics/rrtmgp_sw_main.F90 | 4 +++- physics/rrtmgp_sw_main.meta | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/physics/rrtmgp_lw_main.F90 b/physics/rrtmgp_lw_main.F90 index c0bc99d35..f3a2f5ba6 100644 --- a/physics/rrtmgp_lw_main.F90 +++ b/physics/rrtmgp_lw_main.F90 @@ -7,6 +7,7 @@ !! ! ########################################################################################### module rrtmgp_lw_main + use mpi_f08 use machine, only: kind_phys, kind_dbl_prec use mo_optical_props, only: ty_optical_props_1scl, ty_optical_props_2str use mo_cloud_optics, only: ty_cloud_optics @@ -68,8 +69,9 @@ subroutine rrtmgp_lw_main_init(rrtmgp_root_dir, rrtmgp_lw_file_gas, rrtmgp_lw_fi doGP_sgs_cnv ! Flag to include sgs convective clouds integer, intent(inout) :: & nrghice ! Number of ice-roughness categories + type(MPI_Comm),intent(in) :: & + mpicomm ! MPI communicator integer,intent(in) :: & - mpicomm, & ! MPI communicator mpirank, & ! Current MPI rank mpiroot, & ! Master MPI rank rrtmgp_phys_blksz, & ! Number of horizontal points to process at once. diff --git a/physics/rrtmgp_lw_main.meta b/physics/rrtmgp_lw_main.meta index fd96eb14b..ebff48750 100644 --- a/physics/rrtmgp_lw_main.meta +++ b/physics/rrtmgp_lw_main.meta @@ -90,7 +90,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [rrtmgp_phys_blksz] standard_name = number_of_columns_per_RRTMGP_LW_block @@ -638,4 +638,4 @@ units = 1 dimensions = () type = integer - intent = out \ No newline at end of file + intent = out diff --git a/physics/rrtmgp_sw_main.F90 b/physics/rrtmgp_sw_main.F90 index b25e093e7..b1a8e7cc4 100644 --- a/physics/rrtmgp_sw_main.F90 +++ b/physics/rrtmgp_sw_main.F90 @@ -1,6 +1,7 @@ ! ########################################################################################### ! ########################################################################################### module rrtmgp_sw_main + use mpi_f08 use machine, only: kind_phys, kind_dbl_prec use mo_optical_props, only: ty_optical_props_2str use mo_cloud_optics, only: ty_cloud_optics @@ -55,8 +56,9 @@ subroutine rrtmgp_sw_main_init(rrtmgp_root_dir, rrtmgp_sw_file_gas, rrtmgp_sw_fi doGP_sgs_cnv ! Flag to include sgs convective clouds integer, intent(inout) :: & nrghice ! Number of ice-roughness categories + type(MPI_Comm),intent(in) :: & + mpicomm ! MPI communicator integer,intent(in) :: & - mpicomm, & ! MPI communicator mpirank, & ! Current MPI rank mpiroot, & ! Master MPI rank rrtmgp_phys_blksz, & ! Number of horizontal points to process at once. diff --git a/physics/rrtmgp_sw_main.meta b/physics/rrtmgp_sw_main.meta index dbb93a5df..c2b6555b5 100644 --- a/physics/rrtmgp_sw_main.meta +++ b/physics/rrtmgp_sw_main.meta @@ -104,7 +104,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [active_gases_array] standard_name = list_of_active_gases_used_by_RRTMGP From 8442a202769b4082d548c4d0d0b5d0c1cb7a80c1 Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Wed, 5 Apr 2023 15:49:56 -0600 Subject: [PATCH 025/249] clean sfc_land --- physics/sfc_land.f | 22 +--------------------- physics/sfc_land.meta | 15 --------------- 2 files changed, 1 insertion(+), 36 deletions(-) diff --git a/physics/sfc_land.f b/physics/sfc_land.f index 44a9b5a06..aec47ff77 100644 --- a/physics/sfc_land.f +++ b/physics/sfc_land.f @@ -27,9 +27,6 @@ module sfc_land !! \section detailed Detailed Algorithm !! @{ - -!! use physcons, only : hvap => con_hvap, cp => con_cp, & -!! & rvrdm1 => con_fvirt, rd => con_rd ! !----------------------------------- subroutine sfc_land_run & @@ -41,7 +38,7 @@ subroutine sfc_land_run & ! --- outputs: & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & & gflux, runoff, drain, cmm, chh, zvfun, & - & errmsg, errflg, naux2d, aux2d + & errmsg, errflg & ) ! ===================================================================== ! @@ -122,9 +119,6 @@ subroutine sfc_land_run & character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg - integer, intent(in) :: naux2d - real(kind_phys), intent(out) :: aux2d(:,:) - ! --- locals: integer :: i @@ -150,20 +144,6 @@ subroutine sfc_land_run & chh(i) = chh_lnd(i) zvfun(i) = zvfun_lnd(i) enddo - - aux2d(:,1) = sncovr1(:) - aux2d(:,2) = qsurf(:) - aux2d(:,3) = hflx(:) - aux2d(:,4) = evap(:) - aux2d(:,5) = ep(:) - aux2d(:,6) = t2mmp(:) - aux2d(:,7) = q2mp(:) - aux2d(:,8) = gflux(:) - aux2d(:,9) = drain(:) - aux2d(:,10) = runoff(:) - aux2d(:,11) = cmm(:) - aux2d(:,12) = chh(:) - aux2d(:,13) = zvfun(:) return !----------------------------------- diff --git a/physics/sfc_land.meta b/physics/sfc_land.meta index a146dec3a..979cca377 100644 --- a/physics/sfc_land.meta +++ b/physics/sfc_land.meta @@ -265,18 +265,3 @@ dimensions = () type = integer intent = out -[naux2d] - standard_name = number_of_xy_dimensioned_auxiliary_arrays - long_name = number of 2d auxiliary arrays to output (for debugging) - units = count - dimensions = () - type = integer - intent = in -[aux2d] - standard_name = auxiliary_2d_arrays - long_name = auxiliary 2d arrays to output (for debugging) - units = none - dimensions = (horizontal_loop_extent,number_of_xy_dimensioned_auxiliary_arrays) - type = real - kind = kind_phys - intent = out From a3933a549c7ced2ae9f9c7b30b42090cfa2134ca Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 4 May 2023 11:20:02 -0600 Subject: [PATCH 026/249] CCPP scheme simulator --- physics/GFS_ccpp_scheme_sim_pre.F90 | 603 ++++++++++++++++++++++ physics/GFS_ccpp_scheme_sim_pre.meta | 295 +++++++++++ physics/ccpp_scheme_simulator.F90 | 450 +++------------- physics/ccpp_scheme_simulator.meta | 187 +++---- physics/module_ccpp_scheme_simulator.F90 | 302 +++++++++++ physics/module_ccpp_scheme_simulator.meta | 24 + 6 files changed, 1382 insertions(+), 479 deletions(-) create mode 100644 physics/GFS_ccpp_scheme_sim_pre.F90 create mode 100644 physics/GFS_ccpp_scheme_sim_pre.meta create mode 100644 physics/module_ccpp_scheme_simulator.F90 create mode 100644 physics/module_ccpp_scheme_simulator.meta diff --git a/physics/GFS_ccpp_scheme_sim_pre.F90 b/physics/GFS_ccpp_scheme_sim_pre.F90 new file mode 100644 index 000000000..acd0c6692 --- /dev/null +++ b/physics/GFS_ccpp_scheme_sim_pre.F90 @@ -0,0 +1,603 @@ +! ######################################################################################## +! +! Interstitial CCPP scheme to couple UFS physics to ccpp_scheme_simulator. +! ) _init: read and load data into type used by ccpp_scheme_simulator +! ) _run: prepare GFS diagnostic physics tendencies for ccpp_scheme_simulator +! +! ######################################################################################## +module GFS_ccpp_scheme_sim_pre + use machine, only: kind_phys + use netcdf + use module_ccpp_scheme_simulator, only: base_physics_process +#ifdef MPI + use mpi +#endif + implicit none + + public GFS_ccpp_scheme_sim_pre_init, GFS_ccpp_scheme_sim_pre_run +contains + + ! ###################################################################################### + ! + ! SUBROUTINE GFS_ccpp_scheme_sim_pre_init + ! + ! ###################################################################################### +!! \section arg_table_GFS_ccpp_scheme_sim_pre_init +!! \htmlinclude GFS_ccpp_scheme_sim_pre_init.html +!! + subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_scheme_sim, & + scheme_sim_data, nprg_active, nprc_sim, prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg,& + prc_GWD_cfg, prc_SCNV_cfg, prc_DCNV_cfg, prc_cldMP_cfg, active_name, & + iactive_scheme, active_time_split_process, physics_process, errmsg, errflg) + + ! Inputs + integer, intent (in) :: mpirank, mpiroot, mpicomm, nprg_active, nprc_sim + logical, intent (in) :: do_ccpp_scheme_sim + character(len=256), intent (in) :: scheme_sim_data + integer, dimension(3), intent (in) :: prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg, & + prc_GWD_cfg, prc_SCNV_cfg, prc_DCNV_cfg, prc_cldMP_cfg + + ! Outputs + type(base_physics_process),intent(inout) :: physics_process(:) + character(len=16),intent(inout) :: active_name(:) + integer, intent(inout) :: iactive_scheme(:) + logical, intent(inout) :: active_time_split_process(:) + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Local variables + integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc, iactive + logical :: exists + + ! Switches for input data + logical :: have_dTdt_LWRAD_data = .false., & + have_dTdt_SWRAD_data = .false., & + have_dTdt_PBL_data = .false., & + have_dqdt_PBL_data = .false., & + have_dudt_PBL_data = .false., & + have_dvdt_PBL_data = .false., & + have_dTdt_GWD_data = .false., & + have_dudt_GWD_data = .false., & + have_dvdt_GWD_data = .false., & + have_dTdt_SCNV_data = .false., & + have_dudt_SCNV_data = .false., & + have_dvdt_SCNV_data = .false., & + have_dqdt_SCNV_data = .false., & + have_dTdt_DCNV_data = .false., & + have_dudt_DCNV_data = .false., & + have_dvdt_DCNV_data = .false., & + have_dqdt_DCNV_data = .false., & + have_dTdt_cldMP_data = .false., & + have_dqdt_cldMP_data = .false. + + ! Data driven physics tendencies + integer :: nlev_data, ntime_data + real(kind_phys), allocatable, dimension(:), target :: time_data + real(kind_phys), allocatable, dimension(:,:), target :: dTdt_LWRAD_data, & + dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & + dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & + dTdt_DCNV_data, dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data + real(kind_phys), allocatable, dimension(:,:), target :: dqdt_PBL_data, & + dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (.not. do_ccpp_scheme_sim) return + + ! ###################################################################################### + ! + ! Part A) Read in data. + ! + ! ###################################################################################### + + ! Check that input data file exists + inquire (file = trim (scheme_sim_data), exist = exists) + if (.not. exists) then + errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not exist' + errflg = 1 + return + endif + + ! Read mandatory information from data file... + ! (ONLY master processor(0), if MPI enabled) +#ifdef MPI + if (mpirank .eq. mpiroot) then +#endif + + ! Open file (required) + status = nf90_open(trim(scheme_sim_data), NF90_NOWRITE, ncid) + if (status /= nf90_noerr) then + errmsg = 'Error reading in SCM data tendency file: '//trim(scheme_sim_data) + errflg = 1 + return + endif + + ! Get dimensions (required) + status = nf90_inq_dimid(ncid, 'time', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) + else + errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not contain [time] dimension' + errflg = 1 + return + endif + ! + status = nf90_inq_dimid(ncid, 'lev', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) + else + errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not contain [lev] dimension' + errflg = 1 + return + endif +#ifdef MPI + endif ! On master processor + + ! Other processors waiting... + call mpi_barrier(mpicomm, mpierr) + + ! Broadcast dimensions... + ! (ALL processors) + call mpi_bcast(ntime_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) + call mpi_bcast(nlev_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) + call mpi_barrier(mpicomm, mpierr) + + if (mpirank .eq. mpiroot) then +#endif + + ! + ! What data fields do we have? + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) have_dTdt_LWRAD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) have_dTdt_SWRAD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) have_dTdt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) have_dqdt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) have_dudt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) have_dvdt_PBL_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) have_dTdt_GWD_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) have_dudt_GWD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) have_dvdt_GWD_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) have_dTdt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) have_dudt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) have_dvdt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) have_dqdt_SCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) have_dTdt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) have_dudt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) have_dvdt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) have_dqdt_DCNV_data = .true. + ! + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) have_dTdt_cldMP_data = .true. + ! + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) have_dqdt_cldMP_data = .true. + +#ifdef MPI + endif ! Master process +#endif + + ! Allocate space for data + allocate(time_data(ntime_data)) + if (have_dTdt_LWRAD_data) allocate(dTdt_LWRAD_data(nlev_data, ntime_data)) + if (have_dTdt_SWRAD_data) allocate(dTdt_SWRAD_data(nlev_data, ntime_data)) + if (have_dTdt_PBL_data) allocate(dTdt_PBL_data( nlev_data, ntime_data)) + if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data)) + if (have_dudt_PBL_data) allocate(dudt_PBL_data( nlev_data, ntime_data)) + if (have_dvdt_PBL_data) allocate(dvdt_PBL_data( nlev_data, ntime_data)) + if (have_dTdt_GWD_data) allocate(dTdt_GWD_data( nlev_data, ntime_data)) + if (have_dudt_GWD_data) allocate(dudt_GWD_data( nlev_data, ntime_data)) + if (have_dvdt_GWD_data) allocate(dvdt_GWD_data( nlev_data, ntime_data)) + if (have_dTdt_SCNV_data) allocate(dTdt_SCNV_data( nlev_data, ntime_data)) + if (have_dudt_SCNV_data) allocate(dudt_SCNV_data( nlev_data, ntime_data)) + if (have_dvdt_SCNV_data) allocate(dvdt_SCNV_data( nlev_data, ntime_data)) + if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data)) + if (have_dTdt_DCNV_data) allocate(dTdt_DCNV_data( nlev_data, ntime_data)) + if (have_dudt_DCNV_data) allocate(dudt_DCNV_data( nlev_data, ntime_data)) + if (have_dvdt_DCNV_data) allocate(dvdt_DCNV_data( nlev_data, ntime_data)) + if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data)) + if (have_dTdt_cldMP_data) allocate(dTdt_cldMP_data(nlev_data, ntime_data)) + if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data)) + + ! Read in data ... + ! (ONLY master processor(0), if MPI enabled) +#ifdef MPI + if (mpirank .eq. mpiroot) then +#endif + + ! Temporal info (required) + status = nf90_inq_varid(ncid, 'times', varID) + if (status == nf90_noerr) then + status = nf90_get_var( ncid, varID, time_data) + else + errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not contain times variable' + errflg = 1 + return + endif + + ! Read in physics data tendencies (optional) + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_PBL_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_GWD_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_GWD_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_GWD_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_SCNV_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_DCNV_data) + ! + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_cldMP_data) + ! + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_cldMP_data) + ! + status = nf90_close(ncid) + +#ifdef MPI + endif ! Master process + + ! Other processors waiting... + call mpi_barrier(mpicomm, mpierr) + + ! Broadcast data... + ! (ALL processors) + if (have_dTdt_LWRAD_data) then + call mpi_bcast(dTdt_LWRAD_data, size(dTdt_LWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_SWRAD_data) then + call mpi_bcast(dTdt_SWRAD_data, size(dTdt_SWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_PBL_data) then + call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_PBL_data) then + call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_PBL_data) then + call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_PBL_data) then + call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_GWD_data) then + call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_GWD_data) then + call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_GWD_data) then + call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_SCNV_data) then + call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_SCNV_data) then + call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_SCNV_data) then + call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_SCNV_data) then + call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_DCNV_data) then + call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dudt_DCNV_data) then + call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dvdt_DCNV_data) then + call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_DCNV_data) then + call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dTdt_cldMP_data) then + call mpi_bcast(dTdt_cldMP_data, size(dTdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + if (have_dqdt_cldMP_data) then + call mpi_bcast(dqdt_cldMP_data, size(dqdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) + endif + ! + call mpi_barrier(mpicomm, mpierr) +#endif + + ! ####################################################################################### + ! + ! Part B) Populate physics_process type. + ! + ! ####################################################################################### + + ! Metadata + do iprc = 1,nprc_sim + if (iprc == prc_SWRAD_cfg(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "SWRAD" + if (prc_SWRAD_cfg(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (prc_SWRAD_cfg(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == prc_LWRAD_cfg(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "LWRAD" + if (prc_LWRAD_cfg(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (prc_LWRAD_cfg(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == prc_GWD_cfg(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "GWD" + if (prc_GWD_cfg(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (prc_GWD_cfg(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == prc_PBL_cfg(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "PBL" + if (prc_PBL_cfg(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (prc_PBL_cfg(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == prc_SCNV_cfg(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "SCNV" + if (prc_SCNV_cfg(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (prc_SCNV_cfg(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == prc_DCNV_cfg(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "DCNV" + if (prc_DCNV_cfg(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (prc_DCNV_cfg(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + if (iprc == prc_cldMP_cfg(3)) then + physics_process(iprc)%order = iprc + physics_process(iprc)%name = "cldMP" + if (prc_cldMP_cfg(1) == 1) then + physics_process(iprc)%use_sim = .true. + endif + if (prc_cldMP_cfg(2) == 1) then + physics_process(iprc)%time_split = .true. + endif + endif + enddo + + ! Load data + physics_process(prc_LWRAD_cfg(3))%tend2d%time => time_data + physics_process(prc_SWRAD_cfg(3))%tend2d%time => time_data + physics_process(prc_PBL_cfg(3))%tend2d%time => time_data + physics_process(prc_GWD_cfg(3))%tend2d%time => time_data + physics_process(prc_DCNV_cfg(3))%tend2d%time => time_data + physics_process(prc_SCNV_cfg(3))%tend2d%time => time_data + physics_process(prc_cldMP_cfg(3))%tend2d%time => time_data + if (have_dTdt_LWRAD_data) physics_process(prc_SWRAD_cfg(3))%tend2d%T => dTdt_LWRAD_data + if (have_dTdt_SWRAD_data) physics_process(prc_LWRAD_cfg(3))%tend2d%T => dTdt_SWRAD_data + if (have_dTdt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%T => dTdt_PBL_data + if (have_dudt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%u => dudt_PBL_data + if (have_dvdt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%v => dvdt_PBL_data + if (have_dqdt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%q => dqdt_PBL_data + if (have_dTdt_GWD_data) physics_process(prc_GWD_cfg(3))%tend2d%T => dTdt_GWD_data + if (have_dudt_GWD_data) physics_process(prc_GWD_cfg(3))%tend2d%u => dudt_GWD_data + if (have_dvdt_GWD_data) physics_process(prc_GWD_cfg(3))%tend2d%v => dvdt_GWD_data + if (have_dTdt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%T => dTdt_SCNV_data + if (have_dudt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%u => dudt_SCNV_data + if (have_dvdt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%v => dvdt_SCNV_data + if (have_dqdt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%q => dqdt_SCNV_data + if (have_dTdt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%T => dTdt_DCNV_data + if (have_dudt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%u => dudt_DCNV_data + if (have_dvdt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%v => dvdt_DCNV_data + if (have_dqdt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%q => dqdt_DCNV_data + if (have_dTdt_cldMP_data) physics_process(prc_cldMP_cfg(3))%tend2d%T => dTdt_cldMP_data + if (have_dqdt_cldMP_data) physics_process(prc_cldMP_cfg(3))%tend2d%q => dqdt_cldMP_data + + ! Which process-scheme(s) is(are) "Active"? Are they time-split process? + iactive = 0 + active_time_split_process(:) = .false. + do iprc = 1,nprc_sim + if (.not. physics_process(iprc)%use_sim) then + iactive = iactive + 1 + iactive_scheme(iactive) = iprc + active_name(iactive) = physics_process(iprc)%name + if (physics_process(iprc)%time_split) then + active_time_split_process(iactive) = .true. + endif + endif + enddo + + ! + if (mpirank .eq. mpiroot) then + print*, "-----------------------------------" + print*, "--- Using CCPP scheme simulator ---" + print*, "-----------------------------------" + iactive = 1 + do iprc = 1,nprc_sim + if (physics_process(iprc)%use_sim) then + print*," simulate_scheme: ", trim(physics_process(iprc)%name) + print*," order: ", physics_process(iprc)%order + print*," time_split: ", physics_process(iprc)%time_split + else + print*, " active_scheme: ", trim(active_name(iactive)) + print*, " order: ", physics_process(iactive_scheme(iactive))%order + print*, " time_split : ", active_time_split_process(iactive) + iactive = iactive + 1 + endif + enddo + print*, "-----------------------------------" + print*, "-----------------------------------" + endif + + end subroutine GFS_ccpp_scheme_sim_pre_init + + ! ###################################################################################### + ! + ! SUBROUTINE GFS_ccpp_scheme_sim_pre_run + ! + ! ###################################################################################### +!! \section arg_table_GFS_ccpp_scheme_sim_pre_run +!! \htmlinclude GFS_ccpp_scheme_sim_pre_run.html +!! + subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process_dcnv, & + index_of_process_longwave, index_of_process_shortwave, index_of_process_scnv, & + index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & + index_of_temperature, index_of_x_wind, index_of_y_wind, & + active_name, iactive_scheme_inloop, active_phys_tend, errmsg, errflg) + + ! Inputs + integer, intent(in) :: ntqv, index_of_process_dcnv, index_of_process_longwave, & + index_of_process_shortwave, index_of_process_scnv, & + index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & + index_of_temperature, index_of_x_wind, index_of_y_wind, iactive_scheme_inloop + integer, intent(in), dimension(:,:) :: dtidx + real(kind_phys), intent(in) :: dtp + real(kind_phys), intent(in), dimension(:,:,:) :: dtend + character(len=16),intent(in), dimension(:) :: active_name + + ! Outputs + real(kind_phys), intent(out) :: active_phys_tend(:,:,:) + character(len=*),intent(out) :: errmsg + integer, intent(out) :: errflg + + ! Locals + integer :: idtend, iactive + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Get tendency for "active" process. + + ! ###################################################################################### + ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional + ! array, CCPP standard_name = cumulative_change_of_state_variables. + ! These are not the instantaneous physics tendencies that are applied to the state by + ! the physics schemes. Not all schemes output physics tendencies... + ! Rather these are intended for diagnostic puposes and are accumulated over some + ! interval. + ! In the UFS/SCM this is controlled by the diagnostic bucket interval, namelist option + ! "fhzero". For this to work, you need to clear the diagnostic buckets after each + ! physics timestep when running in the UFS/SCM. + ! + ! In the SCM this is done by adding the following runtime options: + ! --n_itt_out 1 --n_itt_diag 1 + ! + ! ###################################################################################### + if (active_name(iactive_scheme_inloop) == "LWRAD") iactive = index_of_process_longwave + if (active_name(iactive_scheme_inloop) == "SWRAD") iactive = index_of_process_shortwave + if (active_name(iactive_scheme_inloop) == "PBL") iactive = index_of_process_pbl + if (active_name(iactive_scheme_inloop) == "GWD") iactive = index_of_process_orographic_gwd + if (active_name(iactive_scheme_inloop) == "SCNV") iactive = index_of_process_scnv + if (active_name(iactive_scheme_inloop) == "DCNV") iactive = index_of_process_dcnv + if (active_name(iactive_scheme_inloop) == "cldMP") iactive = index_of_process_mp + + ! Heat + idtend = dtidx(index_of_temperature,iactive) + if (idtend >= 1) active_phys_tend(:,:,1) = dtend(:,:,idtend)/dtp + ! u-wind + idtend = dtidx(index_of_x_wind,iactive) + if (idtend >= 1) active_phys_tend(:,:,2) = dtend(:,:,idtend)/dtp + ! v-wind + idtend = dtidx(index_of_y_wind,iactive) + if (idtend >= 1) active_phys_tend(:,:,3) = dtend(:,:,idtend)/dtp + ! Moisture + idtend = dtidx(100+ntqv,iactive) + if (idtend >= 1) active_phys_tend(:,:,4) = dtend(:,:,idtend)/dtp + + + end subroutine GFS_ccpp_scheme_sim_pre_run + +end module GFS_ccpp_scheme_sim_pre diff --git a/physics/GFS_ccpp_scheme_sim_pre.meta b/physics/GFS_ccpp_scheme_sim_pre.meta new file mode 100644 index 000000000..cf7678fe6 --- /dev/null +++ b/physics/GFS_ccpp_scheme_sim_pre.meta @@ -0,0 +1,295 @@ +[ccpp-table-properties] + name = GFS_ccpp_scheme_sim_pre + type = scheme + dependencies = machine.F,module_ccpp_scheme_simulator.F90 + +######################################################################## +[ccpp-arg-table] + name = GFS_ccpp_scheme_sim_pre_init + type = scheme +[mpirank] + standard_name = mpi_rank + long_name = MPI rank of current process + units = index + dimensions = () + type = integer + intent = in +[mpiroot] + standard_name = mpi_root + long_name = MPI rank of master process + units = index + dimensions = () + type = integer + intent = in +[mpicomm] + standard_name = mpi_communicator + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in +[prc_LWRAD_cfg] + standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_LWRAD + long_name = configuration for physics process in CCPP scheme simulator LWRAD + units = flag + dimensions = (3) + type = integer + intent = in +[prc_SWRAD_cfg] + standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_SWRAD + long_name = configuration for physics process in CCPP scheme simulator SWRAD + units = flag + dimensions = (3) + type = integer + intent = in +[prc_PBL_cfg] + standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_PBL + long_name = configuration for physics process in CCPP scheme simulator PBL + units = flag + dimensions = (3) + type = integer + intent = in +[prc_GWD_cfg] + standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_GWD + long_name = configuration for physics process in CCPP scheme simulator GWD + units = flag + dimensions = (3) + type = integer + intent = in +[prc_SCNV_cfg] + standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_SCNV + long_name = configuration for physics process in CCPP scheme simulator SCNV + units = flag + dimensions = (3) + type = integer + intent = in +[prc_DCNV_cfg] + standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_DCNV + long_name = configuration for physics process in CCPP scheme simulator DCNV + units = flag + dimensions = (3) + type = integer + intent = in +[prc_cldMP_cfg] + standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_cldMP + long_name = configuration for physics process in CCPP scheme simulator cldMP + units = flag + dimensions = (3) + type = integer + intent = in +[nprg_active] + standard_name = number_of_prognostics_varaibles_in_CCPP_scheme_simulator + long_name = number of prognostic variables used in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[do_ccpp_scheme_sim] + standard_name = flag_for_ccpp_scheme_simulator + long_name = flag for ccpp scheme simulator + units = flag + dimensions = () + type = logical + intent = in +[scheme_sim_data] + standard_name = filename_for_ccpp_scheme_simulator_data_file + long_name = filename for cccpp scheme simulator data file + units = none + dimensions = () + type = character + kind = len=256 + intent = in +[nprc_sim] + standard_name = number_of_physics_process_in_CCPP_scheme_simulator + long_name = number of physics process in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[active_name] + standard_name = name_of_active_physics_schemes_in_CCPP_scheme_simulator + long_name = name of active physics schemes in CCPP scheme simulator + units = + dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) + type = character + kind = len=16 + intent = inout +[iactive_scheme] + standard_name = index_of_active_physics_schemes_in_CCPP_scheme_simulator + long_name = index of active physics schemes in CCPP scheme simulator + units = count + dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) + type = integer + intent = inout +[active_time_split_process] + standard_name = flag_to_indicate_process_type_in_CCPP_scheme_simulator + long_name = flag to indicate if active physics schemes are time-split process + units = flag + dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) + type = logical + intent = inout +[physics_process] + standard_name = physics_process_type_for_CCPP_scheme_simulator + long_name = physics process type for CCPP scheme simulator + units = mixed + dimensions = (number_of_physics_process_in_CCPP_scheme_simulator) + type = base_physics_process + intent = inout +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out + +######################################################################## +[ccpp-arg-table] + name = GFS_ccpp_scheme_sim_pre_run + type = scheme +[iactive_scheme_inloop] + standard_name = count_for_active_scheme_in_CCPP_scheme_simulator + long_name = count for active physics scheme in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[active_name] + standard_name = name_of_active_physics_schemes_in_CCPP_scheme_simulator + long_name = name of active physics schemes in CCPP scheme simulator + units = + dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) + type = character + kind = len=16 + intent = in +[dtend] + standard_name = cumulative_change_of_state_variables + long_name = diagnostic tendencies for state variables + units = mixed + dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) + type = real + kind = kind_phys + intent = in +[dtidx] + standard_name = cumulative_change_of_state_variables_outer_index + long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index + units = index + dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) + type = integer + intent = in +[dtp] + standard_name = timestep_for_physics + long_name = physics timestep + units = s + dimensions = () + type = real + kind = kind_phys + intent = in +[index_of_process_dcnv] + standard_name = index_of_deep_convection_process_process_in_cumulative_change_index + long_name = index of deep convection process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_longwave] + standard_name = index_of_longwave_heating_process_in_cumulative_change_index + long_name = index of longwave heating process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_shortwave] + standard_name = index_of_shortwave_heating_process_in_cumulative_change_index + long_name = index of shortwave heating process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_orographic_gwd] + standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index + long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_scnv] + standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index + long_name = index of shallow convection process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_pbl] + standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index + long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_process_mp] + standard_name = index_of_microphysics_process_process_in_cumulative_change_index + long_name = index of microphysics transport process in second dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_temperature] + standard_name = index_of_temperature_in_cumulative_change_index + long_name = index of temperature in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_x_wind] + standard_name = index_of_x_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[index_of_y_wind] + standard_name = index_of_y_wind_in_cumulative_change_index + long_name = index of x-wind in first dimension of array cumulative change index + units = index + dimensions = () + type = integer + intent = in +[ntqv] + standard_name = index_of_specific_humidity_in_tracer_concentration_array + long_name = tracer index for water vapor (specific humidity) + units = index + dimensions = () + type = integer + intent = in +[active_phys_tend] + standard_name = tendencies_for_active_process_in_ccpp_scheme_simulator + long_name = tendencies for active physics process in ccpp scheme simulator + units = mixed + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_scheme_simulator) + type = real + kind = kind_phys + intent = out +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out \ No newline at end of file diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index f75580fb9..21f7bfde9 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -7,93 +7,10 @@ ! ######################################################################################## module ccpp_scheme_simulator use machine, only: kind_phys - + use module_ccpp_scheme_simulator, only: base_physics_process, sim_LWRAD, sim_SWRAD, & + sim_PBL, sim_GWD, sim_DCNV, sim_SCNV, sim_cldMP implicit none - - ! ######################################################################################## - ! Types used by the scheme simulator - ! ######################################################################################## - ! Type containing 1D (time) physics tendencies. - type phys_tend_1d - real(kind_phys), dimension(:), pointer :: T - real(kind_phys), dimension(:), pointer :: u - real(kind_phys), dimension(:), pointer :: v - real(kind_phys), dimension(:), pointer :: q - end type phys_tend_1d - - ! Type containing 2D (lev,time) physics tendencies. - type phys_tend_2d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:,:), pointer :: T - real(kind_phys), dimension(:,:), pointer :: u - real(kind_phys), dimension(:,:), pointer :: v - real(kind_phys), dimension(:,:), pointer :: q - end type phys_tend_2d - - ! Type containing 3D (loc,lev,time) physics tendencies. - type phys_tend_3d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:), pointer :: lon - real(kind_phys), dimension(:), pointer :: lat - real(kind_phys), dimension(:,:,:), pointer :: T - real(kind_phys), dimension(:,:,:), pointer :: u - real(kind_phys), dimension(:,:,:), pointer :: v - real(kind_phys), dimension(:,:,:), pointer :: q - end type phys_tend_3d - - ! Type containing 4D (lon, lat,lev,time) physics tendencies. - type phys_tend_4d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:,:), pointer :: lon - real(kind_phys), dimension(:,:), pointer :: lat - real(kind_phys), dimension(:,:,:,:), pointer :: T - real(kind_phys), dimension(:,:,:,:), pointer :: u - real(kind_phys), dimension(:,:,:,:), pointer :: v - real(kind_phys), dimension(:,:,:,:), pointer :: q - end type phys_tend_4d - - ! This type contains the meta information and data for each physics process. - type base_physics_process - character(len=16) :: name - logical :: time_split = .false. - logical :: use_sim = .false. - integer :: order - type(phys_tend_1d) :: tend1d - type(phys_tend_2d) :: tend2d - type(phys_tend_3d) :: tend3d - type(phys_tend_4d) :: tend4d - contains - generic, public :: linterp => linterp_1D, linterp_2D - procedure, private :: linterp_1D - procedure, private :: linterp_2D - procedure, public :: find_nearest_loc_2d_1d - procedure, public :: cmp_time_wts - end type base_physics_process - - ! This array contains the governing information on how to advance the physics timestep. - type(base_physics_process), dimension(:), allocatable :: & - physics_process - - ! Do not change these! - ! For time-split physics process we need to call this scheme twice in the SDF, once - ! before the "active" scheme is called, and once after. This is because the active - ! scheme uses an internal physics state that has been advanced forward by a subsequent - ! physics process(es). - integer :: nactive_proc - character(len=16),allocatable,dimension(:) :: active_name - integer,allocatable,dimension(:) :: iactive_scheme - logical,allocatable,dimension(:) :: active_time_split_process - integer :: iactive_scheme_inloop = 1 - - integer :: proc_start, proc_end - logical :: in_pre_active = .true. - logical :: in_post_active = .false. - - ! Set to true in data was loaded into "physics_process" - logical :: do_ccpp_scheme_simulator=.false. - public ccpp_scheme_simulator_run - contains ! ###################################################################################### @@ -104,42 +21,38 @@ module ccpp_scheme_simulator !! \section arg_table_ccpp_scheme_simulator_run !! \htmlinclude ccpp_scheme_simulator_run.html !! - subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dtidx, & - dtend, index_of_process_dcnv, index_of_process_longwave, & - index_of_process_shortwave, index_of_process_scnv, & - index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind, ntqv, gt0, gu0, gv0, gq0, & - dtdq_pbl, dtdq_mp, errmsg, errflg) + subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, jdat, & + nactive_proc, proc_start, proc_end, active_name, iactive_scheme, physics_process, & + active_time_split_process, iactive_scheme_inloop, in_pre_active, in_post_active, & + tgrs, ugrs, vgrs, qgrs, active_phys_tend, gt0, gu0, gv0, gq0, dtdq_pbl, dtdq_mp, & + errmsg, errflg) ! Inputs - integer, intent(in) :: kdt, ntqv, index_of_process_dcnv, & - index_of_process_longwave, index_of_process_shortwave, index_of_process_scnv, & - index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind - integer, intent(in), dimension(8) :: jdat - integer, intent(in), dimension(:,:) :: dtidx - real(kind_phys), intent(in) :: dtp - real(kind_phys), intent(in), dimension(:,:) :: tgrs, ugrs, vgrs - real(kind_phys), intent(in), dimension(:,:,:) :: qgrs, dtend + logical, intent(in) :: do_ccpp_scheme_sim, active_time_split_process(:) + integer, intent(in) :: kdt, nCol, nLay, nactive_proc, jdat(8), & + iactive_scheme(:) + real(kind_phys), intent(in) :: dtp, tgrs(:,:), ugrs(:,:), vgrs(:,:), qgrs(:,:,:), & + active_phys_tend(:,:,:) + character(len=16), intent(in) :: active_name(:) ! Outputs - real(kind_phys), intent(inout), dimension(:,:) :: gt0, gu0, gv0 - real(kind_phys), intent(inout), dimension(:,:) :: gq0, dtdq_pbl, dtdq_mp - character(len=*),intent(out) :: errmsg - integer, intent(out) :: errflg + type(base_physics_process),intent(inout) :: physics_process(:) + real(kind_phys), intent(inout) :: gt0(:,:), gu0(:,:), gv0(:,:), gq0(:,:), & + dtdq_pbl(:,:), dtdq_mp(:,:) + character(len=*),intent(out) :: errmsg + integer, intent(out) :: errflg + integer, intent(inout) :: proc_start, proc_end, iactive_scheme_inloop + logical, intent(inout) :: in_pre_active, in_post_active ! Locals - integer :: iCol, iLay, nCol, nLay, idtend, year, month, day, hour, min, sec, iprc, & - index_of_active_process - real(kind_phys) :: w1, w2,hrofday - real(kind_phys), dimension(:,:), allocatable :: gt1, gu1, gv1, dTdt, dudt, dvdt - real(kind_phys), dimension(:,:), allocatable :: gq1, dqdt + integer :: iCol, year, month, day, hour, min, sec, iprc + real(kind_phys), dimension(nCol,nLay) :: gt1, gu1, gv1, dTdt, dudt, dvdt, gq1, dqdt ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - if (.not. do_ccpp_scheme_simulator) return + if (.not. do_ccpp_scheme_sim) return ! Current forecast time (Data-format specific) year = jdat(1) @@ -149,34 +62,6 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti min = jdat(6) sec = jdat(7) - ! Dimensions - nCol = size(gq0(:,1)) - nLay = size(gq0(1,:)) - - ! Allocate temporaries - allocate(gt1(nCol,nLay), gu1(nCol,nLay), gv1(nCol,nLay), gq1(nCol,nLay)) - allocate(dTdt(nCol,nLay), dudt(nCol,nLay), dvdt(nCol,nLay), dqdt(nCol,nLay)) - - ! Get tendency for "active" process. - ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional - ! array, CCPP standard_name = cumulative_change_of_state_variables. - ! These are not the instantaneous physics tendencies that are applied to the state by the - ! physics schemes. Not all schemes output physics tendencies... - ! Rather these are intended for diagnostic puposes and are accumulated over some interval. - ! In the UFS/SCM this is controlled by the diagnostic bucket interval, namelist option "fhzero". - ! For this to work, you need to clear the diagnostic buckets after each physics timestep when - ! running in the UFS/SCM. - ! In the SCM this is done by adding the following runtime options: - ! --n_itt_out 1 --n_itt_diag 1 - ! - if (active_name(iactive_scheme_inloop) == "LWRAD") index_of_active_process = index_of_process_longwave - if (active_name(iactive_scheme_inloop) == "SWRAD") index_of_active_process = index_of_process_shortwave - if (active_name(iactive_scheme_inloop) == "PBL") index_of_active_process = index_of_process_pbl - if (active_name(iactive_scheme_inloop) == "GWD") index_of_active_process = index_of_process_orographic_gwd - if (active_name(iactive_scheme_inloop) == "SCNV") index_of_active_process = index_of_process_scnv - if (active_name(iactive_scheme_inloop) == "DCNV") index_of_active_process = index_of_process_dcnv - if (active_name(iactive_scheme_inloop) == "cldMP") index_of_active_process = index_of_process_mp - ! Set state at beginning of the physics timestep. gt1(:,:) = tgrs(:,:) gu1(:,:) = ugrs(:,:) @@ -187,6 +72,9 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dvdt(:,:) = 0. dqdt(:,:) = 0. + ! + ! Set bookeeping indices + ! if (in_pre_active) then proc_start = 1 proc_end = max(1,iactive_scheme(iactive_scheme_inloop)-1) @@ -196,22 +84,27 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti proc_end = size(physics_process) endif - ! Internal physics timestep evolution. + ! + ! Simulate internal physics timestep evolution. + ! do iprc = proc_start,proc_end - if (iprc == iactive_scheme(iactive_scheme_inloop)) then - print*,'Reached active process. ', iprc - else - print*,'Simulating ',iprc,' of ',proc_end - endif - do iCol = 1,nCol + ! Reset locals physics_process(iprc)%tend1d%T(:) = 0. physics_process(iprc)%tend1d%u(:) = 0. physics_process(iprc)%tend1d%v(:) = 0. physics_process(iprc)%tend1d%q(:) = 0. - ! Using scheme simulator (very simple, interpolate data tendency to local time) + ! Using scheme simulator + ! Very simple... + ! Interpolate 2D data (time,level) tendency to local time. + ! Here the data is already on the SCM vertical coordinate. + ! + ! In theory the data can be of any dimensionality and the onus falls on the + ! developer to extend the type "base_physics_process" to work with for their + ! application. + ! if (physics_process(iprc)%use_sim) then if (physics_process(iprc)%name == "LWRAD") then call sim_LWRAD(year, month, day, hour, min, sec, physics_process(iprc)) @@ -236,24 +129,15 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti endif ! Using data tendency from "active" scheme(s). - ! DJS2023: This block is very ufs specific. See Note Above. else - idtend = dtidx(index_of_temperature,index_of_active_process) - if (idtend >= 1) physics_process(iprc)%tend1d%T = dtend(iCol,:,idtend)/dtp - ! - idtend = dtidx(index_of_x_wind,index_of_active_process) - if (idtend >= 1) physics_process(iprc)%tend1d%u = dtend(iCol,:,idtend)/dtp - ! - idtend = dtidx(index_of_y_wind,index_of_active_process) - if (idtend >= 1) physics_process(iprc)%tend1d%v = dtend(iCol,:,idtend)/dtp - ! - idtend = dtidx(100+ntqv,index_of_active_process) - if (idtend >= 1) physics_process(iprc)%tend1d%q = dtend(iCol,:,idtend)/dtp + physics_process(iprc)%tend1d%T = active_phys_tend(iCol,:,1) + physics_process(iprc)%tend1d%u = active_phys_tend(iCol,:,2) + physics_process(iprc)%tend1d%v = active_phys_tend(iCol,:,3) + physics_process(iprc)%tend1d%q = active_phys_tend(iCol,:,4) endif - ! Update state now? + ! Update state now? (time-split scheme) if (physics_process(iprc)%time_split) then - print*,' time-split scheme...' gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp @@ -262,25 +146,31 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti dudt(iCol,:) = 0. dvdt(iCol,:) = 0. dqdt(iCol,:) = 0. - ! Accumulate tendencies, update later? + ! Accumulate tendencies, update later? (process-split scheme) else - print*,' process-split scheme...' dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%tend1d%u dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v dqdt(iCol,:) = dqdt(iCol,:) + physics_process(iprc)%tend1d%q endif + enddo ! END: Loop over columns + enddo ! END: Loop over physics processes + + ! + ! Update state with accumulated tendencies (process-split only) + ! + if (.not. physics_process(iprc)%time_split) then + do iCol = 1,nCol + gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp + gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp + gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp + gq0(iCol,:) = gq1(iCol,:) + dqdt(iCol,:)*dtp enddo - ! - do iLay=1,nLay - !write(*,'(i3,4f13.6)') ilay, gq0(iCol,iLay) , gq1(iCol,iLay) , dqdt(iCol,iLay)*dtp, physics_process(iprc)%tend1d%q(iLay)*dtp - enddo - gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp - gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp - gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp - gq0(iCol,:) = gq1(iCol,:) + dqdt(iCol,:)*dtp - enddo + endif + ! + ! Update bookeeping indices + ! if (in_pre_active) then in_pre_active = .false. in_post_active = .true. @@ -296,224 +186,6 @@ subroutine ccpp_scheme_simulator_run(kdt, dtp, jdat, tgrs, ugrs, vgrs, qgrs, dti iactive_scheme_inloop = iactive_scheme_inloop + 1 endif - ! end subroutine ccpp_scheme_simulator_run - ! #################################################################################### - ! Type-bound procedure to compute tendency profile for time-of-day. - ! - ! For use with 1D data (level, time) tendencies with diurnal (24-hr) forcing. - ! #################################################################################### - function linterp_1D(this, var_name, year, month, day, hour, min, sec) result(err_message) - class(base_physics_process), intent(inout) :: this - character(len=*), intent(in) :: var_name - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: err_message - integer :: ti(1), tf(1) - real(kind_phys) :: w1, w2 - - ! Interpolation weights - call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) - - select case(var_name) - case("T") - this%tend1d%T = w1*this%tend2d%T(:,ti(1)) + w2*this%tend2d%T(:,tf(1)) - case("u") - this%tend1d%u = w1*this%tend2d%u(:,ti(1)) + w2*this%tend2d%u(:,tf(1)) - case("v") - this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1)) - case("q") - this%tend1d%q = w1*this%tend2d%q(:,ti(1)) + w2*this%tend2d%q(:,tf(1)) - end select - - end function linterp_1D - - ! #################################################################################### - ! Type-bound procedure to compute tendency profile for time-of-day. - ! - ! For use with 2D data (location, level, time) tendencies with diurnal (24-hr) forcing. - ! This assumes that the location dimension has a [longitude, latitude] associated with - ! each location. - ! #################################################################################### - function linterp_2D(this, var_name, lon, lat, year, month, day, hour, min, sec) result(err_message) - class(base_physics_process), intent(inout) :: this - character(len=*), intent(in) :: var_name - integer, intent(in) :: year, month, day, hour, min, sec - real(kind_phys), intent(in) :: lon, lat - character(len=128) :: err_message - integer :: ti(1), tf(1), iNearest - real(kind_phys) :: w1, w2 - - ! Interpolation weights (temporal) - call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) - - ! Grab data tendency closest to column [lon,lat] - iNearest = this%find_nearest_loc_2d_1d(lon,lat) - - select case(var_name) - case("T") - this%tend1d%T = w1*this%tend3d%T(iNearest,:,ti(1)) + w2*this%tend3d%T(iNearest,:,tf(1)) - case("u") - this%tend1d%u = w1*this%tend3d%u(iNearest,:,ti(1)) + w2*this%tend3d%u(iNearest,:,tf(1)) - case("v") - this%tend1d%v = w1*this%tend3d%v(iNearest,:,ti(1)) + w2*this%tend3d%v(iNearest,:,tf(1)) - case("q") - this%tend1d%q = w1*this%tend3d%q(iNearest,:,ti(1)) + w2*this%tend3d%q(iNearest,:,tf(1)) - end select - end function linterp_2D - - ! #################################################################################### - ! Type-bound procedure to find nearest location. - ! - ! For use with linterp_2D, NOT YET IMPLEMENTED. - ! #################################################################################### - pure function find_nearest_loc_2d_1d(this, lon, lat) - class(base_physics_process), intent(in) :: this - real(kind_phys), intent(in) :: lon, lat - integer :: find_nearest_loc_2d_1d - - find_nearest_loc_2d_1d = 1 - end function find_nearest_loc_2d_1d - - ! #################################################################################### - ! Type-bound procedure to compute linear interpolation weights for a diurnal (24-hour) - ! forcing. - ! #################################################################################### - subroutine cmp_time_wts(this, year, month, day, hour, minute, sec, w1, w2, ti, tf) - ! Inputs - class(base_physics_process), intent(in) :: this - integer, intent(in) :: year, month, day, hour, minute, sec - ! Outputs - integer,intent(out) :: ti(1), tf(1) - real(kind_phys),intent(out) :: w1, w2 - ! Locals - real(kind_phys) :: hrofday - - hrofday = hour*3600. + minute*60. + sec - ti = max(hour,1) - tf = min(ti + 1,24) - w1 = ((hour+1)*3600 - hrofday)/3600 - w2 = 1 - w1 - - end subroutine cmp_time_wts - - ! #################################################################################### - subroutine sim_LWRAD( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (associated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - - end subroutine sim_LWRAD - - ! #################################################################################### - subroutine sim_SWRAD( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (associated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - - end subroutine sim_SWRAD - - ! #################################################################################### - subroutine sim_GWD( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (associated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - - end subroutine sim_GWD - - ! #################################################################################### - subroutine sim_PBL( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (associated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - - end subroutine sim_PBL - - ! #################################################################################### - subroutine sim_DCNV( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (associated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - - end subroutine sim_DCNV - - ! #################################################################################### - subroutine sim_SCNV( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (associated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - - end subroutine sim_SCNV - - ! #################################################################################### - subroutine sim_cldMP( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (associated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (associated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - end subroutine sim_cldMP - end module ccpp_scheme_simulator diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index 888ba2f8d..777d2248e 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -1,12 +1,18 @@ [ccpp-table-properties] name = ccpp_scheme_simulator type = scheme - dependencies = machine.F + dependencies = machine.F,module_ccpp_scheme_simulator.F90 -######################################################################## [ccpp-arg-table] name = ccpp_scheme_simulator_run type = scheme +[do_ccpp_scheme_sim] + standard_name = flag_for_ccpp_scheme_simulator + long_name = flag for ccpp scheme simulator + units = flag + dimensions = () + type = logical + intent = in [kdt] standard_name = index_of_timestep long_name = current forecast iteration @@ -14,6 +20,20 @@ dimensions = () type = integer intent = in +[nCol] + standard_name = horizontal_loop_extent + long_name = horizontal dimension + units = count + dimensions = () + type = integer + intent = in +[nLay] + standard_name = vertical_layer_dimension + long_name = number of vertical levels + units = count + dimensions = () + type = integer + intent = in [dtp] standard_name = timestep_for_physics long_name = physics timestep @@ -29,6 +49,70 @@ dimensions = (8) type = integer intent = in +[nactive_proc] + standard_name = number_of_active_physics_process_in_CCPP_scheme_simulator + long_name = number of active physics process in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[proc_start] + standard_name = index_for_first_physics_process_in_CCPP_scheme_simulator + long_name = index for first physics process in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = inout +[proc_end] + standard_name = index_for_last_physics_process_in_CCPP_scheme_simulator + long_name = index for last physics process in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = inout +[iactive_scheme_inloop] + standard_name = count_for_active_scheme_in_CCPP_scheme_simulator + long_name = count for active physics scheme in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = inout +[in_pre_active] + standard_name = flag_to_indicate_location_in_physics_process_loop_before_active_scheme + long_name = flag to indicate location in physics process loop before active scheme + units = flag + dimensions = () + type = logical + intent = inout +[in_post_active] + standard_name = flag_to_indicate_location_in_physics_process_loop_after_active_scheme + long_name = flag to indicate location in physics process loop after active scheme + units = flag + dimensions = () + type = logical + intent = inout +[active_name] + standard_name = name_of_active_physics_schemes_in_CCPP_scheme_simulator + long_name = name of active physics schemes in CCPP scheme simulator + units = + dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) + type = character + kind = len=16 + intent = in +[iactive_scheme] + standard_name = index_of_active_physics_schemes_in_CCPP_scheme_simulator + long_name = index of active physics schemes in CCPP scheme simulator + units = count + dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) + type = integer + intent = in +[active_time_split_process] + standard_name = flag_to_indicate_process_type_in_CCPP_scheme_simulator + long_name = flag to indicate if active physics schemes are time-split process + units = flag + dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) + type = logical + intent = in [tgrs] standard_name = air_temperature long_name = model layer mean temperature @@ -61,98 +145,14 @@ type = real kind = kind_phys intent = in -[dtend] - standard_name = cumulative_change_of_state_variables - long_name = diagnostic tendencies for state variables +[active_phys_tend] + standard_name = tendencies_for_active_process_in_ccpp_scheme_simulator + long_name = tendencies for active physics process in ccpp scheme simulator units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_scheme_simulator) type = real kind = kind_phys intent = in -[dtidx] - standard_name = cumulative_change_of_state_variables_outer_index - long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index - units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) - type = integer - intent = in -[index_of_process_dcnv] - standard_name = index_of_deep_convection_process_process_in_cumulative_change_index - long_name = index of deep convection process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_longwave] - standard_name = index_of_longwave_heating_process_in_cumulative_change_index - long_name = index of longwave heating process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_shortwave] - standard_name = index_of_shortwave_heating_process_in_cumulative_change_index - long_name = index of shortwave heating process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_orographic_gwd] - standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index - long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_scnv] - standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index - long_name = index of shallow convection process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_pbl] - standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index - long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_mp] - standard_name = index_of_microphysics_process_process_in_cumulative_change_index - long_name = index of microphysics transport process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_temperature] - standard_name = index_of_temperature_in_cumulative_change_index - long_name = index of temperature in first dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_x_wind] - standard_name = index_of_x_wind_in_cumulative_change_index - long_name = index of x-wind in first dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_y_wind] - standard_name = index_of_y_wind_in_cumulative_change_index - long_name = index of x-wind in first dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[ntqv] - standard_name = index_of_specific_humidity_in_tracer_concentration_array - long_name = tracer index for water vapor (specific humidity) - units = index - dimensions = () - type = integer - intent = in [gt0] standard_name = air_temperature_of_new_state long_name = temperature updated by physics @@ -201,6 +201,13 @@ type = real kind = kind_phys intent = inout +[physics_process] + standard_name = physics_process_type_for_CCPP_scheme_simulator + long_name = physics process type for CCPP scheme simulator + units = mixed + dimensions = (number_of_physics_process_in_CCPP_scheme_simulator) + type = base_physics_process + intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_ccpp_scheme_simulator.F90 b/physics/module_ccpp_scheme_simulator.F90 new file mode 100644 index 000000000..a0756ab61 --- /dev/null +++ b/physics/module_ccpp_scheme_simulator.F90 @@ -0,0 +1,302 @@ +! ######################################################################################## +! +! This module contains the type, base_physics_process, and supporting subroutines needed +! by the ccpp scheme simulator. +! +! ######################################################################################## +module module_ccpp_scheme_simulator +!> \section arg_table_module_ccpp_scheme_simulator Argument table +!! \htmlinclude module_ccpp_scheme_simulator.html +!! + use machine, only : kind_phys + implicit none + + public base_physics_process + + ! Type containing 1D (time) physics tendencies. + type phys_tend_1d + real(kind_phys), dimension(:), pointer :: T + real(kind_phys), dimension(:), pointer :: u + real(kind_phys), dimension(:), pointer :: v + real(kind_phys), dimension(:), pointer :: q + end type phys_tend_1d + + ! Type containing 2D (lev,time) physics tendencies. + type phys_tend_2d + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:,:), pointer :: T + real(kind_phys), dimension(:,:), pointer :: u + real(kind_phys), dimension(:,:), pointer :: v + real(kind_phys), dimension(:,:), pointer :: q + end type phys_tend_2d + + ! Type containing 3D (loc,lev,time) physics tendencies. + type phys_tend_3d + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:), pointer :: lon + real(kind_phys), dimension(:), pointer :: lat + real(kind_phys), dimension(:,:,:), pointer :: T + real(kind_phys), dimension(:,:,:), pointer :: u + real(kind_phys), dimension(:,:,:), pointer :: v + real(kind_phys), dimension(:,:,:), pointer :: q + end type phys_tend_3d + + ! Type containing 4D (lon, lat,lev,time) physics tendencies. + type phys_tend_4d + real(kind_phys), dimension(:), pointer :: time + real(kind_phys), dimension(:,:), pointer :: lon + real(kind_phys), dimension(:,:), pointer :: lat + real(kind_phys), dimension(:,:,:,:), pointer :: T + real(kind_phys), dimension(:,:,:,:), pointer :: u + real(kind_phys), dimension(:,:,:,:), pointer :: v + real(kind_phys), dimension(:,:,:,:), pointer :: q + end type phys_tend_4d + +! This type contains the meta information and data for each physics process. + +!> \section arg_table_base_physics_process Argument Table +!! \htmlinclude base_physics_process.html +!! + type base_physics_process + character(len=16) :: name + logical :: time_split = .false. + logical :: use_sim = .false. + integer :: order + type(phys_tend_1d) :: tend1d + type(phys_tend_2d) :: tend2d + type(phys_tend_3d) :: tend3d + type(phys_tend_4d) :: tend4d + contains + generic, public :: linterp => linterp_1D, linterp_2D + procedure, private :: linterp_1D + procedure, private :: linterp_2D + procedure, public :: find_nearest_loc_2d_1d + procedure, public :: cmp_time_wts + end type base_physics_process + +contains + + ! #################################################################################### + ! Type-bound procedure to compute tendency profile for time-of-day. + ! + ! For use with 1D data (level, time) tendencies with diurnal (24-hr) forcing. + ! #################################################################################### + function linterp_1D(this, var_name, year, month, day, hour, min, sec) result(err_message) + class(base_physics_process), intent(inout) :: this + character(len=*), intent(in) :: var_name + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: err_message + integer :: ti(1), tf(1) + real(kind_phys) :: w1, w2 + + ! Interpolation weights + call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) + + select case(var_name) + case("T") + this%tend1d%T = w1*this%tend2d%T(:,ti(1)) + w2*this%tend2d%T(:,tf(1)) + case("u") + this%tend1d%u = w1*this%tend2d%u(:,ti(1)) + w2*this%tend2d%u(:,tf(1)) + case("v") + this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1)) + case("q") + this%tend1d%q = w1*this%tend2d%q(:,ti(1)) + w2*this%tend2d%q(:,tf(1)) + end select + + end function linterp_1D + + ! #################################################################################### + ! Type-bound procedure to compute tendency profile for time-of-day. + ! + ! For use with 2D data (location, level, time) tendencies with diurnal (24-hr) forcing. + ! This assumes that the location dimension has a [longitude, latitude] associated with + ! each location. + ! #################################################################################### + function linterp_2D(this, var_name, lon, lat, year, month, day, hour, min, sec) result(err_message) + class(base_physics_process), intent(inout) :: this + character(len=*), intent(in) :: var_name + integer, intent(in) :: year, month, day, hour, min, sec + real(kind_phys), intent(in) :: lon, lat + character(len=128) :: err_message + integer :: ti(1), tf(1), iNearest + real(kind_phys) :: w1, w2 + + ! Interpolation weights (temporal) + call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) + + ! Grab data tendency closest to column [lon,lat] + iNearest = this%find_nearest_loc_2d_1d(lon,lat) + + select case(var_name) + case("T") + this%tend1d%T = w1*this%tend3d%T(iNearest,:,ti(1)) + w2*this%tend3d%T(iNearest,:,tf(1)) + case("u") + this%tend1d%u = w1*this%tend3d%u(iNearest,:,ti(1)) + w2*this%tend3d%u(iNearest,:,tf(1)) + case("v") + this%tend1d%v = w1*this%tend3d%v(iNearest,:,ti(1)) + w2*this%tend3d%v(iNearest,:,tf(1)) + case("q") + this%tend1d%q = w1*this%tend3d%q(iNearest,:,ti(1)) + w2*this%tend3d%q(iNearest,:,tf(1)) + end select + end function linterp_2D + + ! #################################################################################### + ! Type-bound procedure to find nearest location. + ! For use with linterp_2D, NOT YET IMPLEMENTED. + ! #################################################################################### + pure function find_nearest_loc_2d_1d(this, lon, lat) + class(base_physics_process), intent(in) :: this + real(kind_phys), intent(in) :: lon, lat + integer :: find_nearest_loc_2d_1d + + find_nearest_loc_2d_1d = 1 + end function find_nearest_loc_2d_1d + + ! #################################################################################### + ! Type-bound procedure to compute linear interpolation weights for a diurnal (24-hour) + ! forcing. + ! #################################################################################### + subroutine cmp_time_wts(this, year, month, day, hour, minute, sec, w1, w2, ti, tf) + ! Inputs + class(base_physics_process), intent(in) :: this + integer, intent(in) :: year, month, day, hour, minute, sec + ! Outputs + integer,intent(out) :: ti(1), tf(1) + real(kind_phys),intent(out) :: w1, w2 + ! Locals + real(kind_phys) :: hrofday + + hrofday = hour*3600. + minute*60. + sec + ti = max(hour,1) + tf = min(ti + 1,24) + w1 = ((hour+1)*3600 - hrofday)/3600 + w2 = 1 - w1 + + end subroutine cmp_time_wts + + ! #################################################################################### + ! #################################################################################### + subroutine sim_LWRAD( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + + end subroutine sim_LWRAD + + ! #################################################################################### + ! #################################################################################### + subroutine sim_SWRAD( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + + end subroutine sim_SWRAD + + ! #################################################################################### + ! #################################################################################### + subroutine sim_GWD( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + + end subroutine sim_GWD + + ! #################################################################################### + ! #################################################################################### + subroutine sim_PBL( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + + end subroutine sim_PBL + + ! #################################################################################### + ! #################################################################################### + subroutine sim_DCNV( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + + end subroutine sim_DCNV + + ! #################################################################################### + ! #################################################################################### + subroutine sim_SCNV( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%u)) then + errmsg = process%linterp("u", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%v)) then + errmsg = process%linterp("v", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + + end subroutine sim_SCNV + + ! #################################################################################### + ! #################################################################################### + subroutine sim_cldMP( year, month, day, hour, min, sec, process) + type(base_physics_process), intent(inout) :: process + integer, intent(in) :: year, month, day, hour, min, sec + character(len=128) :: errmsg + + if (associated(process%tend2d%T)) then + errmsg = process%linterp("T", year,month,day,hour,min,sec) + endif + if (associated(process%tend2d%q)) then + errmsg = process%linterp("q", year,month,day,hour,min,sec) + endif + end subroutine sim_cldMP + +end module module_ccpp_scheme_simulator diff --git a/physics/module_ccpp_scheme_simulator.meta b/physics/module_ccpp_scheme_simulator.meta new file mode 100644 index 000000000..8eefb228c --- /dev/null +++ b/physics/module_ccpp_scheme_simulator.meta @@ -0,0 +1,24 @@ +[ccpp-table-properties] + name = base_physics_process + type = ddt + dependencies = + +[ccpp-arg-table] + name = base_physics_process + type = ddt + +######################################################################## +[ccpp-table-properties] + name = module_ccpp_scheme_simulator + type = module + dependencies = machine.F + +[ccpp-arg-table] + name = module_ccpp_scheme_simulator + type = module +[base_physics_process] + standard_name = base_physics_process + long_name = definition of type base_physics_process + units = DDT + dimensions = () + type = base_physics_process From 5d49f7942f4863441cc2678844a7b744952c9006 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 1 Jun 2023 13:48:56 -0600 Subject: [PATCH 027/249] Reorganization of scheme simulator. Now stateless. --- physics/GFS_ccpp_scheme_sim_pre.F90 | 745 ++++++++--------------- physics/GFS_ccpp_scheme_sim_pre.meta | 158 +---- physics/ccpp_scheme_simulator.F90 | 26 +- physics/ccpp_scheme_simulator.meta | 52 -- physics/load_ccpp_scheme_sim.F90 | 588 ------------------ physics/load_ccpp_scheme_sim.meta | 60 -- physics/module_ccpp_scheme_simulator.F90 | 111 ++-- 7 files changed, 334 insertions(+), 1406 deletions(-) delete mode 100644 physics/load_ccpp_scheme_sim.F90 delete mode 100644 physics/load_ccpp_scheme_sim.meta diff --git a/physics/GFS_ccpp_scheme_sim_pre.F90 b/physics/GFS_ccpp_scheme_sim_pre.F90 index acd0c6692..31bafff01 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.F90 +++ b/physics/GFS_ccpp_scheme_sim_pre.F90 @@ -1,391 +1,222 @@ ! ######################################################################################## ! ! Interstitial CCPP scheme to couple UFS physics to ccpp_scheme_simulator. -! ) _init: read and load data into type used by ccpp_scheme_simulator -! ) _run: prepare GFS diagnostic physics tendencies for ccpp_scheme_simulator +! ) load: read and load data into type used by ccpp_scheme_simulator +! ) _run: prepare GFS diagnostic physics tendencies for ccpp_scheme_simulator ! ! ######################################################################################## module GFS_ccpp_scheme_sim_pre use machine, only: kind_phys - use netcdf use module_ccpp_scheme_simulator, only: base_physics_process -#ifdef MPI - use mpi -#endif + use netcdf implicit none - - public GFS_ccpp_scheme_sim_pre_init, GFS_ccpp_scheme_sim_pre_run + public GFS_ccpp_scheme_sim_pre_run, load_ccpp_scheme_sim contains ! ###################################################################################### ! - ! SUBROUTINE GFS_ccpp_scheme_sim_pre_init + ! SUBROUTINE GFS_ccpp_scheme_sim_pre_run ! ! ###################################################################################### -!! \section arg_table_GFS_ccpp_scheme_sim_pre_init -!! \htmlinclude GFS_ccpp_scheme_sim_pre_init.html -!! - subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_scheme_sim, & - scheme_sim_data, nprg_active, nprc_sim, prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg,& - prc_GWD_cfg, prc_SCNV_cfg, prc_DCNV_cfg, prc_cldMP_cfg, active_name, & - iactive_scheme, active_time_split_process, physics_process, errmsg, errflg) +!! \section arg_table_GFS_ccpp_scheme_sim_pre_run +!! \htmlinclude GFS_ccpp_scheme_sim_pre_run.html +!! + subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process_dcnv, & + index_of_process_longwave, index_of_process_shortwave, index_of_process_scnv, & + index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & + index_of_temperature, index_of_x_wind, index_of_y_wind, & + physics_process, active_phys_tend, errmsg, errflg) ! Inputs - integer, intent (in) :: mpirank, mpiroot, mpicomm, nprg_active, nprc_sim - logical, intent (in) :: do_ccpp_scheme_sim - character(len=256), intent (in) :: scheme_sim_data - integer, dimension(3), intent (in) :: prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg, & - prc_GWD_cfg, prc_SCNV_cfg, prc_DCNV_cfg, prc_cldMP_cfg + integer, intent(in) :: ntqv, index_of_process_dcnv, index_of_process_longwave, & + index_of_process_shortwave, index_of_process_scnv, & + index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & + index_of_temperature, index_of_x_wind, index_of_y_wind + integer, intent(in), dimension(:,:) :: dtidx + real(kind_phys), intent(in) :: dtp + real(kind_phys), intent(in), dimension(:,:,:) :: dtend + type(base_physics_process),intent(in) :: physics_process(:) ! Outputs - type(base_physics_process),intent(inout) :: physics_process(:) - character(len=16),intent(inout) :: active_name(:) - integer, intent(inout) :: iactive_scheme(:) - logical, intent(inout) :: active_time_split_process(:) - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg + real(kind_phys), intent(out) :: active_phys_tend(:,:,:) + character(len=*),intent(out) :: errmsg + integer, intent(out) :: errflg - ! Local variables - integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc, iactive - logical :: exists - - ! Switches for input data - logical :: have_dTdt_LWRAD_data = .false., & - have_dTdt_SWRAD_data = .false., & - have_dTdt_PBL_data = .false., & - have_dqdt_PBL_data = .false., & - have_dudt_PBL_data = .false., & - have_dvdt_PBL_data = .false., & - have_dTdt_GWD_data = .false., & - have_dudt_GWD_data = .false., & - have_dvdt_GWD_data = .false., & - have_dTdt_SCNV_data = .false., & - have_dudt_SCNV_data = .false., & - have_dvdt_SCNV_data = .false., & - have_dqdt_SCNV_data = .false., & - have_dTdt_DCNV_data = .false., & - have_dudt_DCNV_data = .false., & - have_dvdt_DCNV_data = .false., & - have_dqdt_DCNV_data = .false., & - have_dTdt_cldMP_data = .false., & - have_dqdt_cldMP_data = .false. - - ! Data driven physics tendencies - integer :: nlev_data, ntime_data - real(kind_phys), allocatable, dimension(:), target :: time_data - real(kind_phys), allocatable, dimension(:,:), target :: dTdt_LWRAD_data, & - dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & - dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & - dTdt_DCNV_data, dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data - real(kind_phys), allocatable, dimension(:,:), target :: dqdt_PBL_data, & - dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data + ! Locals + integer :: idtend, iactive ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - if (.not. do_ccpp_scheme_sim) return - + ! Get tendency for "active" process. + ! ###################################################################################### + ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional + ! array, CCPP standard_name = cumulative_change_of_state_variables. + ! These are not the instantaneous physics tendencies that are applied to the state by + ! the physics schemes. Not all schemes output physics tendencies... + ! Rather these are intended for diagnostic puposes and are accumulated over some + ! interval. + ! In the UFS/SCM this is controlled by the diagnostic bucket interval, namelist option + ! "fhzero". For this to work, you need to clear the diagnostic buckets after each + ! physics timestep when running in the UFS/SCM. ! - ! Part A) Read in data. + ! In the SCM this is done by adding the following runtime options: + ! --n_itt_out 1 --n_itt_diag 1 ! ! ###################################################################################### - - ! Check that input data file exists - inquire (file = trim (scheme_sim_data), exist = exists) + if (physics_process(1)%active_name == "LWRAD") iactive = index_of_process_longwave + if (physics_process(1)%active_name == "SWRAD") iactive = index_of_process_shortwave + if (physics_process(1)%active_name == "PBL") iactive = index_of_process_pbl + if (physics_process(1)%active_name == "GWD") iactive = index_of_process_orographic_gwd + if (physics_process(1)%active_name == "SCNV") iactive = index_of_process_scnv + if (physics_process(1)%active_name == "DCNV") iactive = index_of_process_dcnv + if (physics_process(1)%active_name == "cldMP") iactive = index_of_process_mp + + ! Heat + idtend = dtidx(index_of_temperature,iactive) + if (idtend >= 1) active_phys_tend(:,:,1) = dtend(:,:,idtend)/dtp + ! u-wind + idtend = dtidx(index_of_x_wind,iactive) + if (idtend >= 1) active_phys_tend(:,:,2) = dtend(:,:,idtend)/dtp + ! v-wind + idtend = dtidx(index_of_y_wind,iactive) + if (idtend >= 1) active_phys_tend(:,:,3) = dtend(:,:,idtend)/dtp + ! Moisture + idtend = dtidx(100+ntqv,iactive) + if (idtend >= 1) active_phys_tend(:,:,4) = dtend(:,:,idtend)/dtp + + + end subroutine GFS_ccpp_scheme_sim_pre_run + + ! ###################################################################################### + subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, & + errmsg, errflg) + + ! Inputs + integer, intent (in) :: nlunit + character(len=*), intent (in) :: nml_file + + ! Outputs + type(base_physics_process),intent(inout),allocatable :: physics_process(:) + integer, intent(out) :: nprg_active + integer, intent(out) :: errflg + character(len=256), intent(out) :: errmsg + + ! Local variables + integer :: ncid, dimID, varID, status, ios, iprc, nlev_data, ntime_data + character(len=256) :: scheme_sim_file + logical :: exists, do_ccpp_scheme_sim + integer :: nprc_sim + + ! For each process there is a corresponding namelist entry, which is constructed as follows: + ! {use_scheme_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} + integer, dimension(3) :: & + prc_LWRAD_cfg = (/0,0,0/), & + prc_SWRAD_cfg = (/0,0,0/), & + prc_PBL_cfg = (/0,0,0/), & + prc_GWD_cfg = (/0,0,0/), & + prc_SCNV_cfg = (/0,0,0/), & + prc_DCNV_cfg = (/0,0,0/), & + prc_cldMP_cfg = (/0,0,0/) + + ! Namelist + namelist / ccpp_scheme_sim_nml / do_ccpp_scheme_sim, scheme_sim_file, nprc_sim, & + prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg, prc_GWD_cfg, prc_SCNV_cfg, & + prc_DCNV_cfg, prc_cldMP_cfg + + errmsg = '' + errflg = 0 + + ! Read in namelist + inquire (file = trim (nml_file), exist = exists) if (.not. exists) then - errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not exist' + errmsg = 'CCPP scheme simulator namelist file: '//trim(nml_file)//' does not exist.' + errflg = 1 + return + else + open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) + endif + rewind (nlunit) + read (nlunit, nml = ccpp_scheme_sim_nml, iostat=status) + close (nlunit) + + ! Only proceed if scheme simulator requested. + if (prc_SWRAD_cfg(1) .or. prc_LWRAD_cfg(1) .or. prc_PBL_cfg(1) .or. & + prc_GWD_cfg(1) .or. prc_SCNV_cfg(1) .or. prc_DCNV_cfg(1) .or. & + prc_cldMP_cfg(1)) then + else + return + endif + + ! Check that input data file exists. + inquire (file = trim (scheme_sim_file), exist = exists) + if (.not. exists) then + errmsg = 'CCPP scheme simulator file: '//trim(scheme_sim_file)//' does not exist' errflg = 1 return endif - ! Read mandatory information from data file... - ! (ONLY master processor(0), if MPI enabled) -#ifdef MPI - if (mpirank .eq. mpiroot) then -#endif + ! + ! Read data file... + ! - ! Open file (required) - status = nf90_open(trim(scheme_sim_data), NF90_NOWRITE, ncid) - if (status /= nf90_noerr) then - errmsg = 'Error reading in SCM data tendency file: '//trim(scheme_sim_data) - errflg = 1 - return - endif - - ! Get dimensions (required) - status = nf90_inq_dimid(ncid, 'time', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) - else - errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not contain [time] dimension' - errflg = 1 - return - endif - ! - status = nf90_inq_dimid(ncid, 'lev', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) - else - errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not contain [lev] dimension' - errflg = 1 - return - endif -#ifdef MPI - endif ! On master processor - - ! Other processors waiting... - call mpi_barrier(mpicomm, mpierr) - - ! Broadcast dimensions... - ! (ALL processors) - call mpi_bcast(ntime_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) - call mpi_bcast(nlev_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) - call mpi_barrier(mpicomm, mpierr) - - if (mpirank .eq. mpiroot) then -#endif - - ! - ! What data fields do we have? - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) have_dTdt_LWRAD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) have_dTdt_SWRAD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) have_dTdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) have_dqdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) have_dudt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) have_dvdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) have_dTdt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) have_dudt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) have_dvdt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) have_dTdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) have_dudt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) have_dvdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) have_dqdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) have_dTdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) have_dudt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) have_dvdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) have_dqdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) have_dTdt_cldMP_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) have_dqdt_cldMP_data = .true. - -#ifdef MPI - endif ! Master process -#endif - - ! Allocate space for data - allocate(time_data(ntime_data)) - if (have_dTdt_LWRAD_data) allocate(dTdt_LWRAD_data(nlev_data, ntime_data)) - if (have_dTdt_SWRAD_data) allocate(dTdt_SWRAD_data(nlev_data, ntime_data)) - if (have_dTdt_PBL_data) allocate(dTdt_PBL_data( nlev_data, ntime_data)) - if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data)) - if (have_dudt_PBL_data) allocate(dudt_PBL_data( nlev_data, ntime_data)) - if (have_dvdt_PBL_data) allocate(dvdt_PBL_data( nlev_data, ntime_data)) - if (have_dTdt_GWD_data) allocate(dTdt_GWD_data( nlev_data, ntime_data)) - if (have_dudt_GWD_data) allocate(dudt_GWD_data( nlev_data, ntime_data)) - if (have_dvdt_GWD_data) allocate(dvdt_GWD_data( nlev_data, ntime_data)) - if (have_dTdt_SCNV_data) allocate(dTdt_SCNV_data( nlev_data, ntime_data)) - if (have_dudt_SCNV_data) allocate(dudt_SCNV_data( nlev_data, ntime_data)) - if (have_dvdt_SCNV_data) allocate(dvdt_SCNV_data( nlev_data, ntime_data)) - if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data)) - if (have_dTdt_DCNV_data) allocate(dTdt_DCNV_data( nlev_data, ntime_data)) - if (have_dudt_DCNV_data) allocate(dudt_DCNV_data( nlev_data, ntime_data)) - if (have_dvdt_DCNV_data) allocate(dvdt_DCNV_data( nlev_data, ntime_data)) - if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data)) - if (have_dTdt_cldMP_data) allocate(dTdt_cldMP_data(nlev_data, ntime_data)) - if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data)) - - ! Read in data ... - ! (ONLY master processor(0), if MPI enabled) -#ifdef MPI - if (mpirank .eq. mpiroot) then -#endif - - ! Temporal info (required) + ! Open file + status = nf90_open(trim(scheme_sim_file), NF90_NOWRITE, ncid) + if (status /= nf90_noerr) then + errmsg = 'Error reading in CCPP scheme simulator file: '//trim(scheme_sim_file) + errflg = 1 + return + endif + + ! Metadata (dimensions) + status = nf90_inq_dimid(ncid, 'time', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) + else + errmsg = 'CCPP scheme simulator file: '//trim(scheme_sim_file)//' does not contain [time] dimension' + errflg = 1 + return + endif + + status = nf90_inq_dimid(ncid, 'lev', dimid) + if (status == nf90_noerr) then + status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) + else + errmsg = 'CCPP scheme simulator file: '//trim(scheme_sim_file)//' does not contain [lev] dimension' + errflg = 1 + return + endif + + ! Allocate space and read in data + allocate(physics_process(nprc_sim)) + physics_process(1)%active_name = '' + physics_process(1)%iactive_scheme = 0 + physics_process(1)%active_tsp = .false. + do iprc = 1,nprc_sim + allocate(physics_process(iprc)%tend1d%T( nlev_data )) + allocate(physics_process(iprc)%tend1d%u( nlev_data )) + allocate(physics_process(iprc)%tend1d%v( nlev_data )) + allocate(physics_process(iprc)%tend1d%q( nlev_data )) + allocate(physics_process(iprc)%tend2d%time( ntime_data)) + allocate(physics_process(iprc)%tend2d%T( nlev_data, ntime_data)) + allocate(physics_process(iprc)%tend2d%u( nlev_data, ntime_data)) + allocate(physics_process(iprc)%tend2d%v( nlev_data, ntime_data)) + allocate(physics_process(iprc)%tend2d%q( nlev_data, ntime_data)) + + ! Temporal info status = nf90_inq_varid(ncid, 'times', varID) if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, time_data) + status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%time) else - errmsg = 'SCM data tendency file: '//trim(scheme_sim_data)//' does not contain times variable' + errmsg = 'SCM data tendency file: '//trim(scheme_sim_file)//' does not contain times variable' errflg = 1 return endif - - ! Read in physics data tendencies (optional) - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_cldMP_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_cldMP_data) - ! - status = nf90_close(ncid) - -#ifdef MPI - endif ! Master process - - ! Other processors waiting... - call mpi_barrier(mpicomm, mpierr) - - ! Broadcast data... - ! (ALL processors) - if (have_dTdt_LWRAD_data) then - call mpi_bcast(dTdt_LWRAD_data, size(dTdt_LWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_SWRAD_data) then - call mpi_bcast(dTdt_SWRAD_data, size(dTdt_SWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_PBL_data) then - call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_PBL_data) then - call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_PBL_data) then - call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_PBL_data) then - call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_GWD_data) then - call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_GWD_data) then - call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_GWD_data) then - call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_SCNV_data) then - call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_SCNV_data) then - call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_SCNV_data) then - call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_SCNV_data) then - call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_DCNV_data) then - call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_DCNV_data) then - call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_DCNV_data) then - call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_DCNV_data) then - call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_cldMP_data) then - call mpi_bcast(dTdt_cldMP_data, size(dTdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_cldMP_data) then - call mpi_bcast(dqdt_cldMP_data, size(dqdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - ! - call mpi_barrier(mpicomm, mpierr) -#endif - - ! ####################################################################################### - ! - ! Part B) Populate physics_process type. - ! - ! ####################################################################################### - ! Metadata - do iprc = 1,nprc_sim if (iprc == prc_SWRAD_cfg(3)) then + ! Metadata physics_process(iprc)%order = iprc physics_process(iprc)%name = "SWRAD" if (prc_SWRAD_cfg(1) == 1) then @@ -394,8 +225,14 @@ subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_schem if (prc_SWRAD_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data + status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) + nprg_active = 1 endif + if (iprc == prc_LWRAD_cfg(3)) then + ! Metadata physics_process(iprc)%order = iprc physics_process(iprc)%name = "LWRAD" if (prc_LWRAD_cfg(1) == 1) then @@ -404,8 +241,14 @@ subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_schem if (prc_LWRAD_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data + status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) + nprg_active =1 endif + if (iprc == prc_GWD_cfg(3)) then + ! Metadata physics_process(iprc)%order = iprc physics_process(iprc)%name = "GWD" if (prc_GWD_cfg(1) == 1) then @@ -414,8 +257,18 @@ subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_schem if (prc_GWD_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data + status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) + status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) + status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) + nprg_active = 3 endif + if (iprc == prc_PBL_cfg(3)) then + ! Metadata physics_process(iprc)%order = iprc physics_process(iprc)%name = "PBL" if (prc_PBL_cfg(1) == 1) then @@ -424,8 +277,20 @@ subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_schem if (prc_PBL_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data + status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) + status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) + status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) + status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) + nprg_active = 4 endif + if (iprc == prc_SCNV_cfg(3)) then + ! Metadata physics_process(iprc)%order = iprc physics_process(iprc)%name = "SCNV" if (prc_SCNV_cfg(1) == 1) then @@ -434,8 +299,20 @@ subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_schem if (prc_SCNV_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data + status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) + status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) + status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) + status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) + nprg_active = 4 endif + if (iprc == prc_DCNV_cfg(3)) then + ! Metadata physics_process(iprc)%order = iprc physics_process(iprc)%name = "DCNV" if (prc_DCNV_cfg(1) == 1) then @@ -444,8 +321,20 @@ subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_schem if (prc_DCNV_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data + status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) + status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) + status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) + status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) + nprg_active = 4 endif + if (iprc == prc_cldMP_cfg(3)) then + ! Metadata physics_process(iprc)%order = iprc physics_process(iprc)%name = "cldMP" if (prc_cldMP_cfg(1) == 1) then @@ -454,150 +343,48 @@ subroutine GFS_ccpp_scheme_sim_pre_init(mpirank, mpiroot, mpicomm, do_ccpp_schem if (prc_cldMP_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data + status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) + status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) + if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) + nprg_active = 2 endif - enddo - ! Load data - physics_process(prc_LWRAD_cfg(3))%tend2d%time => time_data - physics_process(prc_SWRAD_cfg(3))%tend2d%time => time_data - physics_process(prc_PBL_cfg(3))%tend2d%time => time_data - physics_process(prc_GWD_cfg(3))%tend2d%time => time_data - physics_process(prc_DCNV_cfg(3))%tend2d%time => time_data - physics_process(prc_SCNV_cfg(3))%tend2d%time => time_data - physics_process(prc_cldMP_cfg(3))%tend2d%time => time_data - if (have_dTdt_LWRAD_data) physics_process(prc_SWRAD_cfg(3))%tend2d%T => dTdt_LWRAD_data - if (have_dTdt_SWRAD_data) physics_process(prc_LWRAD_cfg(3))%tend2d%T => dTdt_SWRAD_data - if (have_dTdt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%T => dTdt_PBL_data - if (have_dudt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%u => dudt_PBL_data - if (have_dvdt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%v => dvdt_PBL_data - if (have_dqdt_PBL_data) physics_process(prc_PBL_cfg(3))%tend2d%q => dqdt_PBL_data - if (have_dTdt_GWD_data) physics_process(prc_GWD_cfg(3))%tend2d%T => dTdt_GWD_data - if (have_dudt_GWD_data) physics_process(prc_GWD_cfg(3))%tend2d%u => dudt_GWD_data - if (have_dvdt_GWD_data) physics_process(prc_GWD_cfg(3))%tend2d%v => dvdt_GWD_data - if (have_dTdt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%T => dTdt_SCNV_data - if (have_dudt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%u => dudt_SCNV_data - if (have_dvdt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%v => dvdt_SCNV_data - if (have_dqdt_SCNV_data) physics_process(prc_SCNV_cfg(3))%tend2d%q => dqdt_SCNV_data - if (have_dTdt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%T => dTdt_DCNV_data - if (have_dudt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%u => dudt_DCNV_data - if (have_dvdt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%v => dvdt_DCNV_data - if (have_dqdt_DCNV_data) physics_process(prc_DCNV_cfg(3))%tend2d%q => dqdt_DCNV_data - if (have_dTdt_cldMP_data) physics_process(prc_cldMP_cfg(3))%tend2d%T => dTdt_cldMP_data - if (have_dqdt_cldMP_data) physics_process(prc_cldMP_cfg(3))%tend2d%q => dqdt_cldMP_data - - ! Which process-scheme(s) is(are) "Active"? Are they time-split process? - iactive = 0 - active_time_split_process(:) = .false. - do iprc = 1,nprc_sim + ! Which process-scheme is "active"? Is process time-split? if (.not. physics_process(iprc)%use_sim) then - iactive = iactive + 1 - iactive_scheme(iactive) = iprc - active_name(iactive) = physics_process(iprc)%name + physics_process(1)%iactive_scheme = iprc + physics_process(1)%active_name = physics_process(iprc)%name if (physics_process(iprc)%time_split) then - active_time_split_process(iactive) = .true. + physics_process(1)%active_tsp = .true. endif endif + enddo - ! - if (mpirank .eq. mpiroot) then - print*, "-----------------------------------" - print*, "--- Using CCPP scheme simulator ---" - print*, "-----------------------------------" - iactive = 1 - do iprc = 1,nprc_sim - if (physics_process(iprc)%use_sim) then - print*," simulate_scheme: ", trim(physics_process(iprc)%name) - print*," order: ", physics_process(iprc)%order - print*," time_split: ", physics_process(iprc)%time_split - else - print*, " active_scheme: ", trim(active_name(iactive)) - print*, " order: ", physics_process(iactive_scheme(iactive))%order - print*, " time_split : ", active_time_split_process(iactive) - iactive = iactive + 1 - endif - enddo - print*, "-----------------------------------" - print*, "-----------------------------------" + if (physics_process(1)%iactive_scheme == 0) then + errflg = 1 + errmsg = "ERROR: No active scheme set for CCPP scheme simulator" + return endif - end subroutine GFS_ccpp_scheme_sim_pre_init - - ! ###################################################################################### - ! - ! SUBROUTINE GFS_ccpp_scheme_sim_pre_run - ! - ! ###################################################################################### -!! \section arg_table_GFS_ccpp_scheme_sim_pre_run -!! \htmlinclude GFS_ccpp_scheme_sim_pre_run.html -!! - subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process_dcnv, & - index_of_process_longwave, index_of_process_shortwave, index_of_process_scnv, & - index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind, & - active_name, iactive_scheme_inloop, active_phys_tend, errmsg, errflg) - - ! Inputs - integer, intent(in) :: ntqv, index_of_process_dcnv, index_of_process_longwave, & - index_of_process_shortwave, index_of_process_scnv, & - index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind, iactive_scheme_inloop - integer, intent(in), dimension(:,:) :: dtidx - real(kind_phys), intent(in) :: dtp - real(kind_phys), intent(in), dimension(:,:,:) :: dtend - character(len=16),intent(in), dimension(:) :: active_name - - ! Outputs - real(kind_phys), intent(out) :: active_phys_tend(:,:,:) - character(len=*),intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Locals - integer :: idtend, iactive - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - ! Get tendency for "active" process. - - ! ###################################################################################### - ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional - ! array, CCPP standard_name = cumulative_change_of_state_variables. - ! These are not the instantaneous physics tendencies that are applied to the state by - ! the physics schemes. Not all schemes output physics tendencies... - ! Rather these are intended for diagnostic puposes and are accumulated over some - ! interval. - ! In the UFS/SCM this is controlled by the diagnostic bucket interval, namelist option - ! "fhzero". For this to work, you need to clear the diagnostic buckets after each - ! physics timestep when running in the UFS/SCM. - ! - ! In the SCM this is done by adding the following runtime options: - ! --n_itt_out 1 --n_itt_diag 1 - ! - ! ###################################################################################### - if (active_name(iactive_scheme_inloop) == "LWRAD") iactive = index_of_process_longwave - if (active_name(iactive_scheme_inloop) == "SWRAD") iactive = index_of_process_shortwave - if (active_name(iactive_scheme_inloop) == "PBL") iactive = index_of_process_pbl - if (active_name(iactive_scheme_inloop) == "GWD") iactive = index_of_process_orographic_gwd - if (active_name(iactive_scheme_inloop) == "SCNV") iactive = index_of_process_scnv - if (active_name(iactive_scheme_inloop) == "DCNV") iactive = index_of_process_dcnv - if (active_name(iactive_scheme_inloop) == "cldMP") iactive = index_of_process_mp - - ! Heat - idtend = dtidx(index_of_temperature,iactive) - if (idtend >= 1) active_phys_tend(:,:,1) = dtend(:,:,idtend)/dtp - ! u-wind - idtend = dtidx(index_of_x_wind,iactive) - if (idtend >= 1) active_phys_tend(:,:,2) = dtend(:,:,idtend)/dtp - ! v-wind - idtend = dtidx(index_of_y_wind,iactive) - if (idtend >= 1) active_phys_tend(:,:,3) = dtend(:,:,idtend)/dtp - ! Moisture - idtend = dtidx(100+ntqv,iactive) - if (idtend >= 1) active_phys_tend(:,:,4) = dtend(:,:,idtend)/dtp - + print*, "-----------------------------------" + print*, "--- Using CCPP scheme simulator ---" + print*, "-----------------------------------" + do iprc = 1,nprc_sim + if (physics_process(iprc)%use_sim) then + print*," simulate_scheme: ", trim(physics_process(iprc)%name) + print*," order: ", physics_process(iprc)%order + print*," time_split: ", physics_process(iprc)%time_split + else + print*, " active_scheme: ", trim(physics_process(1)%active_name) + print*, " order: ", physics_process(physics_process(1)%iactive_scheme)%order + print*, " time_split : ", physics_process(1)%active_tsp + endif + enddo + print*, "-----------------------------------" + print*, "-----------------------------------" - end subroutine GFS_ccpp_scheme_sim_pre_run + end subroutine load_ccpp_scheme_sim end module GFS_ccpp_scheme_sim_pre diff --git a/physics/GFS_ccpp_scheme_sim_pre.meta b/physics/GFS_ccpp_scheme_sim_pre.meta index cf7678fe6..e101e4650 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.meta +++ b/physics/GFS_ccpp_scheme_sim_pre.meta @@ -5,170 +5,14 @@ ######################################################################## [ccpp-arg-table] - name = GFS_ccpp_scheme_sim_pre_init + name = GFS_ccpp_scheme_sim_pre_run type = scheme -[mpirank] - standard_name = mpi_rank - long_name = MPI rank of current process - units = index - dimensions = () - type = integer - intent = in -[mpiroot] - standard_name = mpi_root - long_name = MPI rank of master process - units = index - dimensions = () - type = integer - intent = in -[mpicomm] - standard_name = mpi_communicator - long_name = MPI communicator - units = index - dimensions = () - type = integer - intent = in -[prc_LWRAD_cfg] - standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_LWRAD - long_name = configuration for physics process in CCPP scheme simulator LWRAD - units = flag - dimensions = (3) - type = integer - intent = in -[prc_SWRAD_cfg] - standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_SWRAD - long_name = configuration for physics process in CCPP scheme simulator SWRAD - units = flag - dimensions = (3) - type = integer - intent = in -[prc_PBL_cfg] - standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_PBL - long_name = configuration for physics process in CCPP scheme simulator PBL - units = flag - dimensions = (3) - type = integer - intent = in -[prc_GWD_cfg] - standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_GWD - long_name = configuration for physics process in CCPP scheme simulator GWD - units = flag - dimensions = (3) - type = integer - intent = in -[prc_SCNV_cfg] - standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_SCNV - long_name = configuration for physics process in CCPP scheme simulator SCNV - units = flag - dimensions = (3) - type = integer - intent = in -[prc_DCNV_cfg] - standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_DCNV - long_name = configuration for physics process in CCPP scheme simulator DCNV - units = flag - dimensions = (3) - type = integer - intent = in -[prc_cldMP_cfg] - standard_name = configuration_for_physics_process_in_CCPP_scheme_simulator_cldMP - long_name = configuration for physics process in CCPP scheme simulator cldMP - units = flag - dimensions = (3) - type = integer - intent = in -[nprg_active] - standard_name = number_of_prognostics_varaibles_in_CCPP_scheme_simulator - long_name = number of prognostic variables used in CCPP scheme simulator - units = count - dimensions = () - type = integer - intent = in -[do_ccpp_scheme_sim] - standard_name = flag_for_ccpp_scheme_simulator - long_name = flag for ccpp scheme simulator - units = flag - dimensions = () - type = logical - intent = in -[scheme_sim_data] - standard_name = filename_for_ccpp_scheme_simulator_data_file - long_name = filename for cccpp scheme simulator data file - units = none - dimensions = () - type = character - kind = len=256 - intent = in -[nprc_sim] - standard_name = number_of_physics_process_in_CCPP_scheme_simulator - long_name = number of physics process in CCPP scheme simulator - units = count - dimensions = () - type = integer - intent = in -[active_name] - standard_name = name_of_active_physics_schemes_in_CCPP_scheme_simulator - long_name = name of active physics schemes in CCPP scheme simulator - units = - dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) - type = character - kind = len=16 - intent = inout -[iactive_scheme] - standard_name = index_of_active_physics_schemes_in_CCPP_scheme_simulator - long_name = index of active physics schemes in CCPP scheme simulator - units = count - dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) - type = integer - intent = inout -[active_time_split_process] - standard_name = flag_to_indicate_process_type_in_CCPP_scheme_simulator - long_name = flag to indicate if active physics schemes are time-split process - units = flag - dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) - type = logical - intent = inout [physics_process] standard_name = physics_process_type_for_CCPP_scheme_simulator long_name = physics process type for CCPP scheme simulator units = mixed dimensions = (number_of_physics_process_in_CCPP_scheme_simulator) type = base_physics_process - intent = inout -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out - -######################################################################## -[ccpp-arg-table] - name = GFS_ccpp_scheme_sim_pre_run - type = scheme -[iactive_scheme_inloop] - standard_name = count_for_active_scheme_in_CCPP_scheme_simulator - long_name = count for active physics scheme in CCPP scheme simulator - units = count - dimensions = () - type = integer - intent = in -[active_name] - standard_name = name_of_active_physics_schemes_in_CCPP_scheme_simulator - long_name = name of active physics schemes in CCPP scheme simulator - units = - dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) - type = character - kind = len=16 intent = in [dtend] standard_name = cumulative_change_of_state_variables diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index 21f7bfde9..e4348599f 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -22,26 +22,21 @@ module ccpp_scheme_simulator !! \htmlinclude ccpp_scheme_simulator_run.html !! subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, jdat, & - nactive_proc, proc_start, proc_end, active_name, iactive_scheme, physics_process, & - active_time_split_process, iactive_scheme_inloop, in_pre_active, in_post_active, & - tgrs, ugrs, vgrs, qgrs, active_phys_tend, gt0, gu0, gv0, gq0, dtdq_pbl, dtdq_mp, & - errmsg, errflg) + proc_start, proc_end, physics_process, in_pre_active, in_post_active, tgrs, ugrs, & + vgrs, qgrs, active_phys_tend, gt0, gu0, gv0, gq0, errmsg, errflg) ! Inputs - logical, intent(in) :: do_ccpp_scheme_sim, active_time_split_process(:) - integer, intent(in) :: kdt, nCol, nLay, nactive_proc, jdat(8), & - iactive_scheme(:) + logical, intent(in) :: do_ccpp_scheme_sim + integer, intent(in) :: kdt, nCol, nLay, jdat(8) real(kind_phys), intent(in) :: dtp, tgrs(:,:), ugrs(:,:), vgrs(:,:), qgrs(:,:,:), & active_phys_tend(:,:,:) - character(len=16), intent(in) :: active_name(:) ! Outputs type(base_physics_process),intent(inout) :: physics_process(:) - real(kind_phys), intent(inout) :: gt0(:,:), gu0(:,:), gv0(:,:), gq0(:,:), & - dtdq_pbl(:,:), dtdq_mp(:,:) + real(kind_phys), intent(inout) :: gt0(:,:), gu0(:,:), gv0(:,:), gq0(:,:) character(len=*),intent(out) :: errmsg integer, intent(out) :: errflg - integer, intent(inout) :: proc_start, proc_end, iactive_scheme_inloop + integer, intent(inout) :: proc_start, proc_end logical, intent(inout) :: in_pre_active, in_post_active ! Locals @@ -77,10 +72,10 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j ! if (in_pre_active) then proc_start = 1 - proc_end = max(1,iactive_scheme(iactive_scheme_inloop)-1) + proc_end = max(1,physics_process(1)%iactive_scheme-1) endif if (in_post_active) then - proc_start = iactive_scheme(iactive_scheme_inloop) + proc_start = physics_process(1)%iactive_scheme proc_end = size(physics_process) endif @@ -179,11 +174,6 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j if (size(physics_process)+1 == iprc) then in_pre_active = .true. in_post_active = .false. - iactive_scheme_inloop = 1 - endif - - if (iactive_scheme_inloop < nactive_proc) then - iactive_scheme_inloop = iactive_scheme_inloop + 1 endif end subroutine ccpp_scheme_simulator_run diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index 777d2248e..8b2618317 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -49,13 +49,6 @@ dimensions = (8) type = integer intent = in -[nactive_proc] - standard_name = number_of_active_physics_process_in_CCPP_scheme_simulator - long_name = number of active physics process in CCPP scheme simulator - units = count - dimensions = () - type = integer - intent = in [proc_start] standard_name = index_for_first_physics_process_in_CCPP_scheme_simulator long_name = index for first physics process in CCPP scheme simulator @@ -70,13 +63,6 @@ dimensions = () type = integer intent = inout -[iactive_scheme_inloop] - standard_name = count_for_active_scheme_in_CCPP_scheme_simulator - long_name = count for active physics scheme in CCPP scheme simulator - units = count - dimensions = () - type = integer - intent = inout [in_pre_active] standard_name = flag_to_indicate_location_in_physics_process_loop_before_active_scheme long_name = flag to indicate location in physics process loop before active scheme @@ -91,28 +77,6 @@ dimensions = () type = logical intent = inout -[active_name] - standard_name = name_of_active_physics_schemes_in_CCPP_scheme_simulator - long_name = name of active physics schemes in CCPP scheme simulator - units = - dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) - type = character - kind = len=16 - intent = in -[iactive_scheme] - standard_name = index_of_active_physics_schemes_in_CCPP_scheme_simulator - long_name = index of active physics schemes in CCPP scheme simulator - units = count - dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) - type = integer - intent = in -[active_time_split_process] - standard_name = flag_to_indicate_process_type_in_CCPP_scheme_simulator - long_name = flag to indicate if active physics schemes are time-split process - units = flag - dimensions = (number_of_active_physics_process_in_CCPP_scheme_simulator) - type = logical - intent = in [tgrs] standard_name = air_temperature long_name = model layer mean temperature @@ -185,22 +149,6 @@ type = real kind = kind_phys intent = inout -[dtdq_pbl] - standard_name = instantaneous_tendency_of_specific_humidity_due_to_PBL - long_name = instantaneous_tendency_of_specific_humidity_due_to_PBL - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[dtdq_mp] - standard_name = instantaneous_tendency_of_specific_humidity_due_to_microphysics - long_name = moisture tendency due to microphysics - units = kg kg-1 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout [physics_process] standard_name = physics_process_type_for_CCPP_scheme_simulator long_name = physics process type for CCPP scheme simulator diff --git a/physics/load_ccpp_scheme_sim.F90 b/physics/load_ccpp_scheme_sim.F90 deleted file mode 100644 index 1fb3dc983..000000000 --- a/physics/load_ccpp_scheme_sim.F90 +++ /dev/null @@ -1,588 +0,0 @@ -! ######################################################################################## -! -! CCPP scheme to read and load data for ccpp_scheme_simulator -! -! ######################################################################################## -module load_ccpp_scheme_sim - use machine, only: kind_phys - use netcdf - use ccpp_scheme_simulator, only: do_ccpp_scheme_simulator, physics_process, active_name,& - iactive_scheme, active_time_split_process, nactive_proc -#ifdef MPI - use mpi -#endif - implicit none - - ! ######################################################################################## - ! - ! Configuration for CCPP scheme simulator. Set in namelist. Used during initialization to - ! populate "physics_process" type array, defined in ccpp_scheme_simulator.F90 - ! - ! ######################################################################################## - - ! Number of physics process (set in namelist) - integer :: nPhysProcess - - ! For each process there is a corresponding namelist entry, which is constructed as follows: - ! {use_scheme_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} - integer, dimension(3) :: & - proc_LWRAD_config = (/0,0,0/), & - proc_SWRAD_config = (/0,0,0/), & - proc_PBL_config = (/0,0,0/), & - proc_GWD_config = (/0,0,0/), & - proc_SCNV_config = (/0,0,0/), & - proc_DCNV_config = (/0,0,0/), & - proc_cldMP_config = (/0,0,0/) - - ! Activation flag for scheme. - logical :: do_load_ccpp_scheme = .false. - - ! Data driven physics tendencies - integer :: nlev_data, ntime_data - real(kind_phys), allocatable, dimension(:), target :: time_data - real(kind_phys), allocatable, dimension(:,:), target :: dTdt_LWRAD_data, & - dTdt_SWRAD_data, dTdt_PBL_data, dudt_PBL_data, dvdt_PBL_data, dTdt_GWD_data, & - dudt_GWD_data, dvdt_GWD_data, dTdt_SCNV_data, dudt_SCNV_data, dvdt_SCNV_data, & - dTdt_DCNV_data, dudt_DCNV_data, dvdt_DCNV_data, dTdt_cldMP_data - real(kind_phys), allocatable, dimension(:,:), target :: dqdt_PBL_data, & - dqdt_SCNV_data, dqdt_DCNV_data, dqdt_cldMP_data - - ! Scheme initialization flag. - logical :: module_initialized = .false. - - public load_ccpp_scheme_sim_init -contains - - ! ###################################################################################### - ! - ! SUBROUTINE load_ccpp_scheme_sim_init - ! - ! ###################################################################################### -!! \section arg_table_load_ccpp_scheme_sim_init -!! \htmlinclude load_ccpp_scheme_sim_init.html -!! - subroutine load_ccpp_scheme_sim_init(mpirank, mpiroot, mpicomm, nlunit, nml_file, & - errmsg, errflg) - - ! Inputs - integer, intent (in) :: mpirank, mpiroot, mpicomm, nlunit - character(len=*), intent (in) :: nml_file - - ! Outputs - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Local variables - integer :: ncid, dimID, varID, status, nlon, nlat, ios, iprc, iactive - character(len=256) :: fileIN - logical :: exists - integer,parameter :: nTrc = 1 ! Only specific humodty for now, but preserve 3 dimensionality - - ! Switches for input data - logical :: have_dTdt_LWRAD_data = .false., & - have_dTdt_SWRAD_data = .false., & - have_dTdt_PBL_data = .false., & - have_dqdt_PBL_data = .false., & - have_dudt_PBL_data = .false., & - have_dvdt_PBL_data = .false., & - have_dTdt_GWD_data = .false., & - have_dudt_GWD_data = .false., & - have_dvdt_GWD_data = .false., & - have_dTdt_SCNV_data = .false., & - have_dudt_SCNV_data = .false., & - have_dvdt_SCNV_data = .false., & - have_dqdt_SCNV_data = .false., & - have_dTdt_DCNV_data = .false., & - have_dudt_DCNV_data = .false., & - have_dvdt_DCNV_data = .false., & - have_dqdt_DCNV_data = .false., & - have_dTdt_cldMP_data = .false., & - have_dqdt_cldMP_data = .false. - - ! Namelist - namelist / scm_data_nml / fileIN, nPhysProcess, proc_LWRAD_config, proc_SWRAD_config, & - proc_PBL_config, proc_GWD_config, proc_SCNV_config, proc_DCNV_config, & - proc_cldMP_config - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (module_initialized) return - module_initialized = .true. - - ! ###################################################################################### - ! - ! Part A) Read in namelist and data. - ! - ! ###################################################################################### - - ! Read in namelist - inquire (file = trim (nml_file), exist = exists) - if (.not. exists) then - errmsg = 'SCM data tendency :: namelist file: '//trim(nml_file)//' does not exist' - errflg = 1 - return - else - open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) - endif - rewind (nlunit) - read (nlunit, nml = scm_data_nml, iostat=status) - close (nlunit) - - ! Only proceed if scheme simulator requested. - if (proc_SWRAD_config(1) .or. proc_LWRAD_config(1) .or. proc_PBL_config(1) .or. & - proc_GWD_config(1) .or. proc_SCNV_config(1) .or. proc_DCNV_config(1) .or. & - proc_cldMP_config(1)) then - do_ccpp_scheme_simulator = .true. - else - return - endif - - ! Check that input data file exists - inquire (file = trim (fileIN), exist = exists) - if (.not. exists) then - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not exist' - errflg = 1 - return - endif - - ! Read mandatory information from data file... - ! (ONLY master processor(0), if MPI enabled) -#ifdef MPI - if (mpirank .eq. mpiroot) then -#endif - - ! Open file (required) - status = nf90_open(trim(fileIN), NF90_NOWRITE, ncid) - if (status /= nf90_noerr) then - errmsg = 'Error reading in SCM data tendency file: '//trim(fileIN) - errflg = 1 - return - endif - - ! Get dimensions (required) - status = nf90_inq_dimid(ncid, 'time', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [time] dimension' - errflg = 1 - return - endif - ! - status = nf90_inq_dimid(ncid, 'lev', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain [lev] dimension' - errflg = 1 - return - endif -#ifdef MPI - endif ! On master processor - - ! Other processors waiting... - call mpi_barrier(mpicomm, mpierr) - - ! Broadcast dimensions... - ! (ALL processors) - call mpi_bcast(ntime_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) - call mpi_bcast(nlev_data, 1, MPI_INTEGER, mpiroot, mpicomm, mpierr) - call mpi_barrier(mpicomm, mpierr) - - if (mpirank .eq. mpiroot) then -#endif - - ! - ! What data fields do we have? - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) have_dTdt_LWRAD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) have_dTdt_SWRAD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) have_dTdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) have_dqdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) have_dudt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) have_dvdt_PBL_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) have_dTdt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) have_dudt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) have_dvdt_GWD_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) have_dTdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) have_dudt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) have_dvdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) have_dqdt_SCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) have_dTdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) have_dudt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) have_dvdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) have_dqdt_DCNV_data = .true. - ! - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) have_dTdt_cldMP_data = .true. - ! - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) have_dqdt_cldMP_data = .true. - -#ifdef MPI - endif ! Master process -#endif - - ! Allocate space for data - allocate(time_data(ntime_data)) - if (have_dTdt_LWRAD_data) allocate(dTdt_LWRAD_data(nlev_data, ntime_data)) - if (have_dTdt_SWRAD_data) allocate(dTdt_SWRAD_data(nlev_data, ntime_data)) - if (have_dTdt_PBL_data) allocate(dTdt_PBL_data( nlev_data, ntime_data)) - if (have_dqdt_PBL_data) allocate(dqdt_PBL_data( nlev_data, ntime_data)) - if (have_dudt_PBL_data) allocate(dudt_PBL_data( nlev_data, ntime_data)) - if (have_dvdt_PBL_data) allocate(dvdt_PBL_data( nlev_data, ntime_data)) - if (have_dTdt_GWD_data) allocate(dTdt_GWD_data( nlev_data, ntime_data)) - if (have_dudt_GWD_data) allocate(dudt_GWD_data( nlev_data, ntime_data)) - if (have_dvdt_GWD_data) allocate(dvdt_GWD_data( nlev_data, ntime_data)) - if (have_dTdt_SCNV_data) allocate(dTdt_SCNV_data( nlev_data, ntime_data)) - if (have_dudt_SCNV_data) allocate(dudt_SCNV_data( nlev_data, ntime_data)) - if (have_dvdt_SCNV_data) allocate(dvdt_SCNV_data( nlev_data, ntime_data)) - if (have_dqdt_SCNV_data) allocate(dqdt_SCNV_data( nlev_data, ntime_data)) - if (have_dTdt_DCNV_data) allocate(dTdt_DCNV_data( nlev_data, ntime_data)) - if (have_dudt_DCNV_data) allocate(dudt_DCNV_data( nlev_data, ntime_data)) - if (have_dvdt_DCNV_data) allocate(dvdt_DCNV_data( nlev_data, ntime_data)) - if (have_dqdt_DCNV_data) allocate(dqdt_DCNV_data( nlev_data, ntime_data)) - if (have_dTdt_cldMP_data) allocate(dTdt_cldMP_data(nlev_data, ntime_data)) - if (have_dqdt_cldMP_data) allocate(dqdt_cldMP_data(nlev_data, ntime_data)) - - ! Read in data ... - ! (ONLY master processor(0), if MPI enabled) -#ifdef MPI - if (mpirank .eq. mpiroot) then -#endif - - ! Temporal info (required) - status = nf90_inq_varid(ncid, 'times', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, time_data) - else - errmsg = 'SCM data tendency file: '//trim(fileIN)//' does not contain times variable' - errflg = 1 - return - endif - - ! Read in physics data tendencies (optional) - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_LWRAD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SWRAD_data) - print*,'dTdt_SWRAD_data: ',dTdt_SWRAD_data - ! - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_PBL_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_GWD_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_SCNV_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dudt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dvdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_DCNV_data) - ! - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dTdt_cldMP_data) - ! - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, dqdt_cldMP_data) - ! - status = nf90_close(ncid) - -#ifdef MPI - endif ! Master process - - ! Other processors waiting... - call mpi_barrier(mpicomm, mpierr) - - ! Broadcast data... - ! (ALL processors) - if (have_dTdt_LWRAD_data) then - call mpi_bcast(dTdt_LWRAD_data, size(dTdt_LWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_SWRAD_data) then - call mpi_bcast(dTdt_SWRAD_data, size(dTdt_SWRAD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_PBL_data) then - call mpi_bcast(dTdt_PBL_data, size(dTdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_PBL_data) then - call mpi_bcast(dqdt_PBL_data, size(dqdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_PBL_data) then - call mpi_bcast(dudt_PBL_data, size(dudt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_PBL_data) then - call mpi_bcast(dvdt_PBL_data, size(dvdt_PBL_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_GWD_data) then - call mpi_bcast(dTdt_GWD_data, size(dTdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_GWD_data) then - call mpi_bcast(dudt_GWD_data, size(dudt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_GWD_data) then - call mpi_bcast(dvdt_GWD_data, size(dvdt_GWD_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_SCNV_data) then - call mpi_bcast(dTdt_SCNV_data, size(dTdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_SCNV_data) then - call mpi_bcast(dudt_SCNV_data, size(dudt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_SCNV_data) then - call mpi_bcast(dvdt_SCNV_data, size(dvdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_SCNV_data) then - call mpi_bcast(dqdt_SCNV_data, size(dqdt_SCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_DCNV_data) then - call mpi_bcast(dTdt_DCNV_data, size(dTdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dudt_DCNV_data) then - call mpi_bcast(dudt_DCNV_data, size(dudt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dvdt_DCNV_data) then - call mpi_bcast(dvdt_DCNV_data, size(dvdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_DCNV_data) then - call mpi_bcast(dqdt_DCNV_data, size(dqdt_DCNV_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dTdt_cldMP_data) then - call mpi_bcast(dTdt_cldMP_data, size(dTdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - if (have_dqdt_cldMP_data) then - call mpi_bcast(dqdt_cldMP_data, size(dqdt_cldMP_data), MPI_DOUBLE_PRECISION, mpiroot, mpicomm, mpierr) - endif - ! - call mpi_barrier(mpicomm, mpierr) -#endif - - ! ####################################################################################### - ! - ! Part B) Populate physics_process type. - ! - ! ####################################################################################### - - ! Allocate - allocate(physics_process(nPhysProcess)) - - ! Metadata - do iprc = 1,nPhysProcess - allocate(physics_process(iprc)%tend1d%T(nlev_data)) - allocate(physics_process(iprc)%tend1d%u(nlev_data)) - allocate(physics_process(iprc)%tend1d%v(nlev_data)) - allocate(physics_process(iprc)%tend1d%q(nlev_data)) - if (iprc == proc_SWRAD_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "SWRAD" - if (proc_SWRAD_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_SWRAD_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_LWRAD_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "LWRAD" - if (proc_LWRAD_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_LWRAD_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_GWD_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "GWD" - if (proc_GWD_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_GWD_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_PBL_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "PBL" - if (proc_PBL_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_PBL_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_SCNV_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "SCNV" - if (proc_SCNV_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_SCNV_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_DCNV_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "DCNV" - if (proc_DCNV_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_DCNV_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - if (iprc == proc_cldMP_config(3)) then - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "cldMP" - if (proc_cldMP_config(1) == 1) then - physics_process(iprc)%use_sim = .true. - endif - if (proc_cldMP_config(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - endif - enddo - - ! Load data - physics_process(proc_LWRAD_config(3))%tend2d%time => time_data - physics_process(proc_SWRAD_config(3))%tend2d%time => time_data - physics_process(proc_PBL_config(3))%tend2d%time => time_data - physics_process(proc_GWD_config(3))%tend2d%time => time_data - physics_process(proc_DCNV_config(3))%tend2d%time => time_data - physics_process(proc_SCNV_config(3))%tend2d%time => time_data - physics_process(proc_cldMP_config(3))%tend2d%time => time_data - if (have_dTdt_LWRAD_data) physics_process(proc_SWRAD_config(3))%tend2d%T => dTdt_LWRAD_data - if (have_dTdt_SWRAD_data) physics_process(proc_LWRAD_config(3))%tend2d%T => dTdt_SWRAD_data - if (have_dTdt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%T => dTdt_PBL_data - if (have_dudt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%u => dudt_PBL_data - if (have_dvdt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%v => dvdt_PBL_data - if (have_dqdt_PBL_data) physics_process(proc_PBL_config(3))%tend2d%q => dqdt_PBL_data - if (have_dTdt_GWD_data) physics_process(proc_GWD_config(3))%tend2d%T => dTdt_GWD_data - if (have_dudt_GWD_data) physics_process(proc_GWD_config(3))%tend2d%u => dudt_GWD_data - if (have_dvdt_GWD_data) physics_process(proc_GWD_config(3))%tend2d%v => dvdt_GWD_data - if (have_dTdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%T => dTdt_SCNV_data - if (have_dudt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%u => dudt_SCNV_data - if (have_dvdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%v => dvdt_SCNV_data - if (have_dqdt_SCNV_data) physics_process(proc_SCNV_config(3))%tend2d%q => dqdt_SCNV_data - if (have_dTdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%T => dTdt_DCNV_data - if (have_dudt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%u => dudt_DCNV_data - if (have_dvdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%v => dvdt_DCNV_data - if (have_dqdt_DCNV_data) physics_process(proc_DCNV_config(3))%tend2d%q => dqdt_DCNV_data - if (have_dTdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend2d%T => dTdt_cldMP_data - if (have_dqdt_cldMP_data) physics_process(proc_cldMP_config(3))%tend2d%q => dqdt_cldMP_data - - ! How many active schemes are there? - nactive_proc = 0 - iactive = 0 - do iprc = 1,nPhysProcess - if (.not. physics_process(iprc)%use_sim) nactive_proc = nactive_proc + 1 - enddo - allocate(iactive_scheme(nactive_proc),active_name(nactive_proc),active_time_split_process(nactive_proc)) - - ! Which process-scheme(s) is(are) "Active"? Are they time-split process? - active_time_split_process(:) = .false. - do iprc = 1,nPhysProcess - if (.not. physics_process(iprc)%use_sim) then - iactive = iactive + 1 - iactive_scheme(iactive) = iprc - active_name(iactive) = physics_process(iprc)%name - if (physics_process(iprc)%time_split) then - active_time_split_process(iactive) = .true. - endif - endif - enddo - - ! - if (mpirank .eq. mpiroot) then - print*, "-----------------------------------" - print*, "--- Using CCPP scheme simulator ---" - print*, "-----------------------------------" - iactive = 1 - do iprc = 1,nPhysProcess - if (physics_process(iprc)%use_sim) then - print*," simulate_scheme: ", trim(physics_process(iprc)%name) - print*," order: ", physics_process(iprc)%order - print*," time_split: ", physics_process(iprc)%time_split - else - print*, " active_scheme: ", trim(active_name(iactive)) - print*, " order: ", physics_process(iactive_scheme(iactive))%order - print*, " time_split : ", active_time_split_process(iactive) - iactive = iactive + 1 - endif - enddo - print*, "-----------------------------------" - print*, "-----------------------------------" - endif - - end subroutine load_ccpp_scheme_sim_init - -end module load_ccpp_scheme_sim diff --git a/physics/load_ccpp_scheme_sim.meta b/physics/load_ccpp_scheme_sim.meta deleted file mode 100644 index 6e0aea925..000000000 --- a/physics/load_ccpp_scheme_sim.meta +++ /dev/null @@ -1,60 +0,0 @@ -[ccpp-table-properties] - name = load_ccpp_scheme_sim - type = scheme - dependencies = machine.F,ccpp_scheme_simulator.F90 - -######################################################################## -[ccpp-arg-table] - name = load_ccpp_scheme_sim_init - type = scheme -[mpirank] - standard_name = mpi_rank - long_name = MPI rank of current process - units = index - dimensions = () - type = integer - intent = in -[mpiroot] - standard_name = mpi_root - long_name = MPI rank of master process - units = index - dimensions = () - type = integer - intent = in -[mpicomm] - standard_name = mpi_communicator - long_name = MPI communicator - units = index - dimensions = () - type = integer - intent = in -[nlunit] - standard_name = iounit_of_namelist - long_name = fortran unit number for opening nameliust file - units = none - dimensions = () - type = integer - intent = in -[nml_file] - standard_name = filename_of_namelist - long_name = namelist filename - units = none - dimensions = () - type = character - kind = len=* - intent = in -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out diff --git a/physics/module_ccpp_scheme_simulator.F90 b/physics/module_ccpp_scheme_simulator.F90 index a0756ab61..695a2bb03 100644 --- a/physics/module_ccpp_scheme_simulator.F90 +++ b/physics/module_ccpp_scheme_simulator.F90 @@ -15,41 +15,45 @@ module module_ccpp_scheme_simulator ! Type containing 1D (time) physics tendencies. type phys_tend_1d - real(kind_phys), dimension(:), pointer :: T - real(kind_phys), dimension(:), pointer :: u - real(kind_phys), dimension(:), pointer :: v - real(kind_phys), dimension(:), pointer :: q + real(kind_phys), dimension(:), allocatable :: T + real(kind_phys), dimension(:), allocatable :: u + real(kind_phys), dimension(:), allocatable :: v + real(kind_phys), dimension(:), allocatable :: q + real(kind_phys), dimension(:), allocatable :: p + real(kind_phys), dimension(:), allocatable :: z end type phys_tend_1d ! Type containing 2D (lev,time) physics tendencies. type phys_tend_2d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:,:), pointer :: T - real(kind_phys), dimension(:,:), pointer :: u - real(kind_phys), dimension(:,:), pointer :: v - real(kind_phys), dimension(:,:), pointer :: q + real(kind_phys), dimension(:), allocatable :: time + real(kind_phys), dimension(:,:), allocatable :: T + real(kind_phys), dimension(:,:), allocatable :: u + real(kind_phys), dimension(:,:), allocatable :: v + real(kind_phys), dimension(:,:), allocatable :: q + real(kind_phys), dimension(:,:), allocatable :: p + real(kind_phys), dimension(:,:), allocatable :: z end type phys_tend_2d ! Type containing 3D (loc,lev,time) physics tendencies. type phys_tend_3d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:), pointer :: lon - real(kind_phys), dimension(:), pointer :: lat - real(kind_phys), dimension(:,:,:), pointer :: T - real(kind_phys), dimension(:,:,:), pointer :: u - real(kind_phys), dimension(:,:,:), pointer :: v - real(kind_phys), dimension(:,:,:), pointer :: q + real(kind_phys), dimension(:), allocatable :: time + real(kind_phys), dimension(:), allocatable :: lon + real(kind_phys), dimension(:), allocatable :: lat + real(kind_phys), dimension(:,:,:), allocatable :: T + real(kind_phys), dimension(:,:,:), allocatable :: u + real(kind_phys), dimension(:,:,:), allocatable :: v + real(kind_phys), dimension(:,:,:), allocatable :: q end type phys_tend_3d - ! Type containing 4D (lon, lat,lev,time) physics tendencies. + ! Type containing 4D (lon,lat,lev,time) physics tendencies. type phys_tend_4d - real(kind_phys), dimension(:), pointer :: time - real(kind_phys), dimension(:,:), pointer :: lon - real(kind_phys), dimension(:,:), pointer :: lat - real(kind_phys), dimension(:,:,:,:), pointer :: T - real(kind_phys), dimension(:,:,:,:), pointer :: u - real(kind_phys), dimension(:,:,:,:), pointer :: v - real(kind_phys), dimension(:,:,:,:), pointer :: q + real(kind_phys), dimension(:), allocatable :: time + real(kind_phys), dimension(:,:), allocatable :: lon + real(kind_phys), dimension(:,:), allocatable :: lat + real(kind_phys), dimension(:,:,:,:), allocatable :: T + real(kind_phys), dimension(:,:,:,:), allocatable :: u + real(kind_phys), dimension(:,:,:,:), allocatable :: v + real(kind_phys), dimension(:,:,:,:), allocatable :: q end type phys_tend_4d ! This type contains the meta information and data for each physics process. @@ -58,14 +62,17 @@ module module_ccpp_scheme_simulator !! \htmlinclude base_physics_process.html !! type base_physics_process - character(len=16) :: name - logical :: time_split = .false. - logical :: use_sim = .false. - integer :: order - type(phys_tend_1d) :: tend1d - type(phys_tend_2d) :: tend2d - type(phys_tend_3d) :: tend3d - type(phys_tend_4d) :: tend4d + character(len=16) :: name ! Physics process name + logical :: time_split = .false. ! Is process time-split? + logical :: use_sim = .false. ! Is process "active"? + integer :: order ! Order of process in process-loop + type(phys_tend_1d) :: tend1d ! Instantaneous data + type(phys_tend_2d) :: tend2d ! 2-dimensional data + type(phys_tend_3d) :: tend3d ! Not used. Placeholder for 3-dimensional spatial data. + type(phys_tend_4d) :: tend4d ! Not used. Placeholder for 4-dimensional spatio-tempo data. + character(len=16) :: active_name ! "Active" scheme: Physics process name + integer :: iactive_scheme ! "Active" scheme: Order of process in process-loop + logical :: active_tsp ! "Active" scheme: Is process time-split? contains generic, public :: linterp => linterp_1D, linterp_2D procedure, private :: linterp_1D @@ -109,7 +116,7 @@ end function linterp_1D ! Type-bound procedure to compute tendency profile for time-of-day. ! ! For use with 2D data (location, level, time) tendencies with diurnal (24-hr) forcing. - ! This assumes that the location dimension has a [longitude, latitude] associated with + ! This assumes that the location dimension has a [longitude, latitude] allocated with ! each location. ! #################################################################################### function linterp_2D(this, var_name, lon, lat, year, month, day, hour, min, sec) result(err_message) @@ -180,7 +187,7 @@ subroutine sim_LWRAD( year, month, day, hour, min, sec, process) integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: errmsg - if (associated(process%tend2d%T)) then + if (allocated(process%tend2d%T)) then errmsg = process%linterp("T", year,month,day,hour,min,sec) endif @@ -193,7 +200,7 @@ subroutine sim_SWRAD( year, month, day, hour, min, sec, process) integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: errmsg - if (associated(process%tend2d%T)) then + if (allocated(process%tend2d%T)) then errmsg = process%linterp("T", year,month,day,hour,min,sec) endif @@ -206,13 +213,13 @@ subroutine sim_GWD( year, month, day, hour, min, sec, process) integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: errmsg - if (associated(process%tend2d%T)) then + if (allocated(process%tend2d%T)) then errmsg = process%linterp("T", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%u)) then + if (allocated(process%tend2d%u)) then errmsg = process%linterp("u", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%v)) then + if (allocated(process%tend2d%v)) then errmsg = process%linterp("v", year,month,day,hour,min,sec) endif @@ -225,16 +232,16 @@ subroutine sim_PBL( year, month, day, hour, min, sec, process) integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: errmsg - if (associated(process%tend2d%T)) then + if (allocated(process%tend2d%T)) then errmsg = process%linterp("T", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%u)) then + if (allocated(process%tend2d%u)) then errmsg = process%linterp("u", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%v)) then + if (allocated(process%tend2d%v)) then errmsg = process%linterp("v", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%q)) then + if (allocated(process%tend2d%q)) then errmsg = process%linterp("q", year,month,day,hour,min,sec) endif @@ -247,16 +254,16 @@ subroutine sim_DCNV( year, month, day, hour, min, sec, process) integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: errmsg - if (associated(process%tend2d%T)) then + if (allocated(process%tend2d%T)) then errmsg = process%linterp("T", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%u)) then + if (allocated(process%tend2d%u)) then errmsg = process%linterp("u", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%v)) then + if (allocated(process%tend2d%v)) then errmsg = process%linterp("v", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%q)) then + if (allocated(process%tend2d%q)) then errmsg = process%linterp("q", year,month,day,hour,min,sec) endif @@ -269,16 +276,16 @@ subroutine sim_SCNV( year, month, day, hour, min, sec, process) integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: errmsg - if (associated(process%tend2d%T)) then + if (allocated(process%tend2d%T)) then errmsg = process%linterp("T", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%u)) then + if (allocated(process%tend2d%u)) then errmsg = process%linterp("u", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%v)) then + if (allocated(process%tend2d%v)) then errmsg = process%linterp("v", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%q)) then + if (allocated(process%tend2d%q)) then errmsg = process%linterp("q", year,month,day,hour,min,sec) endif @@ -291,10 +298,10 @@ subroutine sim_cldMP( year, month, day, hour, min, sec, process) integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: errmsg - if (associated(process%tend2d%T)) then + if (allocated(process%tend2d%T)) then errmsg = process%linterp("T", year,month,day,hour,min,sec) endif - if (associated(process%tend2d%q)) then + if (allocated(process%tend2d%q)) then errmsg = process%linterp("q", year,month,day,hour,min,sec) endif end subroutine sim_cldMP From 4d691081e46d17d5b77b6aa7714ba2a369088ae4 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 14 Jun 2023 14:25:38 -0400 Subject: [PATCH 028/249] fix bug in scm_sfc_flux_spec.F90 --- physics/scm_sfc_flux_spec.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/scm_sfc_flux_spec.F90 b/physics/scm_sfc_flux_spec.F90 index 835b468ff..e835b77ff 100644 --- a/physics/scm_sfc_flux_spec.F90 +++ b/physics/scm_sfc_flux_spec.F90 @@ -58,9 +58,9 @@ subroutine scm_sfc_flux_spec_run (im, u1, v1, z1, t1, q1, p1, roughness_length, use machine, only: kind_phys integer, intent(in) :: im, lkm - integer, intent(inout) :: islmsk(:) + integer, intent(inout) :: islmsk(:), use_lake_model(:) logical, intent(in) :: cplflx, cplice - logical, intent(inout) :: dry(:), icy(:), flag_cice(:), wet(:), use_lake_model(:) + logical, intent(inout) :: dry(:), icy(:), flag_cice(:), wet(:) real(kind=kind_phys), intent(in) :: cp, grav, hvap, rd, fvirt, vonKarman, min_seaice, tgice, min_lakeice real(kind=kind_phys), intent(in) :: u1(:), v1(:), z1(:), t1(:), q1(:), p1(:), roughness_length(:), & spec_sh_flux(:), spec_lh_flux(:), exner_inverse(:), T_surf(:), oceanfrac(:), lakefrac(:), lakedepth(:) From 12d4fc22128d7267fb6a8563a94bb579d27d2127 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Fri, 7 Jul 2023 12:16:54 -0600 Subject: [PATCH 029/249] Working as expected! --- physics/GFS_ccpp_scheme_sim_pre.F90 | 77 ++++++++++++++++++------ physics/GFS_ccpp_scheme_sim_pre.meta | 28 +++++++++ physics/ccpp_scheme_simulator.F90 | 47 ++++++++++----- physics/ccpp_scheme_simulator.meta | 28 +++++++++ physics/module_ccpp_scheme_simulator.F90 | 1 + 5 files changed, 150 insertions(+), 31 deletions(-) diff --git a/physics/GFS_ccpp_scheme_sim_pre.F90 b/physics/GFS_ccpp_scheme_sim_pre.F90 index 31bafff01..a5f6f0cfa 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.F90 +++ b/physics/GFS_ccpp_scheme_sim_pre.F90 @@ -24,8 +24,8 @@ module GFS_ccpp_scheme_sim_pre subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process_dcnv, & index_of_process_longwave, index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind, & - physics_process, active_phys_tend, errmsg, errflg) + index_of_temperature, index_of_x_wind, index_of_y_wind, physics_process, & + iactive_T, iactive_u, iactive_v, iactive_q, active_phys_tend, errmsg, errflg) ! Inputs integer, intent(in) :: ntqv, index_of_process_dcnv, index_of_process_longwave, & @@ -36,6 +36,7 @@ subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process real(kind_phys), intent(in) :: dtp real(kind_phys), intent(in), dimension(:,:,:) :: dtend type(base_physics_process),intent(in) :: physics_process(:) + integer, intent(in) :: iactive_T, iactive_u, iactive_v, iactive_q ! Outputs real(kind_phys), intent(out) :: active_phys_tend(:,:,:) @@ -76,23 +77,33 @@ subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process ! Heat idtend = dtidx(index_of_temperature,iactive) - if (idtend >= 1) active_phys_tend(:,:,1) = dtend(:,:,idtend)/dtp + if (idtend >= 1) then + active_phys_tend(:,:,iactive_T) = dtend(:,:,idtend)/dtp + endif + ! u-wind idtend = dtidx(index_of_x_wind,iactive) - if (idtend >= 1) active_phys_tend(:,:,2) = dtend(:,:,idtend)/dtp + if (idtend >= 1) then + active_phys_tend(:,:,iactive_u) = dtend(:,:,idtend)/dtp + endif + ! v-wind idtend = dtidx(index_of_y_wind,iactive) - if (idtend >= 1) active_phys_tend(:,:,3) = dtend(:,:,idtend)/dtp + if (idtend >= 1) then + active_phys_tend(:,:,iactive_v) = dtend(:,:,idtend)/dtp + endif + ! Moisture idtend = dtidx(100+ntqv,iactive) - if (idtend >= 1) active_phys_tend(:,:,4) = dtend(:,:,idtend)/dtp - + if (idtend >= 1) then + active_phys_tend(:,:,iactive_q) = dtend(:,:,idtend)/dtp + endif end subroutine GFS_ccpp_scheme_sim_pre_run ! ###################################################################################### - subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, & - errmsg, errflg) + subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, & + iactive_T, iactive_u, iactive_v, iactive_q, errmsg, errflg) ! Inputs integer, intent (in) :: nlunit @@ -100,7 +111,7 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, ! Outputs type(base_physics_process),intent(inout),allocatable :: physics_process(:) - integer, intent(out) :: nprg_active + integer, intent(inout) :: iactive_T, iactive_u, iactive_v, iactive_q integer, intent(out) :: errflg character(len=256), intent(out) :: errmsg @@ -221,14 +232,17 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, physics_process(iprc)%name = "SWRAD" if (prc_SWRAD_cfg(1) == 1) then physics_process(iprc)%use_sim = .true. + else + physics_process(1)%nprg_active = 1 + iactive_T = 1 endif if (prc_SWRAD_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - nprg_active = 1 endif if (iprc == prc_LWRAD_cfg(3)) then @@ -237,14 +251,17 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, physics_process(iprc)%name = "LWRAD" if (prc_LWRAD_cfg(1) == 1) then physics_process(iprc)%use_sim = .true. + else + physics_process(1)%nprg_active = 1 + iactive_T = 1 endif if (prc_LWRAD_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - nprg_active =1 endif if (iprc == prc_GWD_cfg(3)) then @@ -253,10 +270,16 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, physics_process(iprc)%name = "GWD" if (prc_GWD_cfg(1) == 1) then physics_process(iprc)%use_sim = .true. + else + physics_process(1)%nprg_active = 3 + iactive_T = 1 + iactive_u = 2 + iactive_v = 3 endif if (prc_GWD_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) @@ -264,7 +287,6 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) - nprg_active = 3 endif if (iprc == prc_PBL_cfg(3)) then @@ -273,10 +295,17 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, physics_process(iprc)%name = "PBL" if (prc_PBL_cfg(1) == 1) then physics_process(iprc)%use_sim = .true. + else + physics_process(1)%nprg_active = 4 + iactive_T = 1 + iactive_u = 2 + iactive_v = 3 + iactive_q = 4 endif if (prc_PBL_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) @@ -286,7 +315,6 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) - nprg_active = 4 endif if (iprc == prc_SCNV_cfg(3)) then @@ -295,10 +323,17 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, physics_process(iprc)%name = "SCNV" if (prc_SCNV_cfg(1) == 1) then physics_process(iprc)%use_sim = .true. + else + physics_process(1)%nprg_active = 4 + iactive_T = 1 + iactive_u = 2 + iactive_v = 3 + iactive_q = 4 endif if (prc_SCNV_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) @@ -308,7 +343,6 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) - nprg_active = 4 endif if (iprc == prc_DCNV_cfg(3)) then @@ -317,6 +351,12 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, physics_process(iprc)%name = "DCNV" if (prc_DCNV_cfg(1) == 1) then physics_process(iprc)%use_sim = .true. + else + physics_process(1)%nprg_active = 4 + iactive_T = 1 + iactive_u = 2 + iactive_v = 3 + iactive_q = 4 endif if (prc_DCNV_cfg(2) == 1) then physics_process(iprc)%time_split = .true. @@ -330,7 +370,6 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) - nprg_active = 4 endif if (iprc == prc_cldMP_cfg(3)) then @@ -339,16 +378,20 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, nprg_active, physics_process(iprc)%name = "cldMP" if (prc_cldMP_cfg(1) == 1) then physics_process(iprc)%use_sim = .true. + else + physics_process(1)%nprg_active = 2 + iactive_T = 1 + iactive_q = 2 endif if (prc_cldMP_cfg(2) == 1) then physics_process(iprc)%time_split = .true. endif + ! Data status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) - nprg_active = 2 endif ! Which process-scheme is "active"? Is process time-split? diff --git a/physics/GFS_ccpp_scheme_sim_pre.meta b/physics/GFS_ccpp_scheme_sim_pre.meta index e101e4650..682b4baf8 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.meta +++ b/physics/GFS_ccpp_scheme_sim_pre.meta @@ -122,6 +122,34 @@ type = real kind = kind_phys intent = out +[iactive_T] + standard_name = index_for_active_T_in_CCPP_scheme_simulator + long_name = index into active process tracer array for temperature in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[iactive_u] + standard_name = index_for_active_u_in_CCPP_scheme_simulator + long_name = index into active process tracer array for zonal wind in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[iactive_v] + standard_name = index_for_active_v_in_CCPP_scheme_simulator + long_name = index into active process tracer array for meridional wind in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[iactive_q] + standard_name = index_for_active_q_in_CCPP_scheme_simulator + long_name = index into active process tracer array for moisture in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index e4348599f..b825b8403 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -7,7 +7,7 @@ ! ######################################################################################## module ccpp_scheme_simulator use machine, only: kind_phys - use module_ccpp_scheme_simulator, only: base_physics_process, sim_LWRAD, sim_SWRAD, & + use module_ccpp_scheme_simulator, only: base_physics_process, sim_LWRAD, sim_SWRAD, & sim_PBL, sim_GWD, sim_DCNV, sim_SCNV, sim_cldMP implicit none public ccpp_scheme_simulator_run @@ -22,15 +22,16 @@ module ccpp_scheme_simulator !! \htmlinclude ccpp_scheme_simulator_run.html !! subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, jdat, & - proc_start, proc_end, physics_process, in_pre_active, in_post_active, tgrs, ugrs, & - vgrs, qgrs, active_phys_tend, gt0, gu0, gv0, gq0, errmsg, errflg) + iactive_T, iactive_u, iactive_v, iactive_q, proc_start, proc_end, physics_process,& + in_pre_active, in_post_active, tgrs, ugrs, vgrs, qgrs, active_phys_tend, gt0, gu0,& + gv0, gq0, errmsg, errflg) ! Inputs logical, intent(in) :: do_ccpp_scheme_sim - integer, intent(in) :: kdt, nCol, nLay, jdat(8) + integer, intent(in) :: kdt, nCol, nLay, jdat(8), iactive_T, iactive_u, & + iactive_v, iactive_q real(kind_phys), intent(in) :: dtp, tgrs(:,:), ugrs(:,:), vgrs(:,:), qgrs(:,:,:), & active_phys_tend(:,:,:) - ! Outputs type(base_physics_process),intent(inout) :: physics_process(:) real(kind_phys), intent(inout) :: gt0(:,:), gu0(:,:), gv0(:,:), gq0(:,:) @@ -125,18 +126,18 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j ! Using data tendency from "active" scheme(s). else - physics_process(iprc)%tend1d%T = active_phys_tend(iCol,:,1) - physics_process(iprc)%tend1d%u = active_phys_tend(iCol,:,2) - physics_process(iprc)%tend1d%v = active_phys_tend(iCol,:,3) - physics_process(iprc)%tend1d%q = active_phys_tend(iCol,:,4) + if (iactive_T > 0) physics_process(iprc)%tend1d%T = active_phys_tend(iCol,:,iactive_T) + if (iactive_u > 0) physics_process(iprc)%tend1d%u = active_phys_tend(iCol,:,iactive_u) + if (iactive_v > 0) physics_process(iprc)%tend1d%v = active_phys_tend(iCol,:,iactive_v) + if (iactive_q > 0) physics_process(iprc)%tend1d%q = active_phys_tend(iCol,:,iactive_q) endif ! Update state now? (time-split scheme) if (physics_process(iprc)%time_split) then - gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp - gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp - gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp - gq1(iCol,:) = gq1(iCol,:) + (dqdt(iCol,:) + physics_process(iprc)%tend1d%q)*dtp + gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp + gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp + gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp + gq1(iCol,:) = gq1(iCol,:) + (dqdt(iCol,:) + physics_process(iprc)%tend1d%q)*dtp dTdt(iCol,:) = 0. dudt(iCol,:) = 0. dvdt(iCol,:) = 0. @@ -149,11 +150,29 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j dqdt(iCol,:) = dqdt(iCol,:) + physics_process(iprc)%tend1d%q endif enddo ! END: Loop over columns + + ! Print diagnostics + if (physics_process(iprc)%use_sim) then + if (physics_process(iprc)%time_split) then + write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'time split scheme (simulated)' + else + write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'process split scheme (simulated)' + endif + else + if (physics_process(iprc)%time_split) then + write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,' time split scheme (active)' + else + write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,' process split scheme (active)' + endif + write(*,'(a25,i2)') ' # prog. vars.: ',physics_process(1)%nprg_active + endif enddo ! END: Loop over physics processes ! ! Update state with accumulated tendencies (process-split only) + ! (Suites where active scheme is last physical process) ! + iprc = minval([iprc,proc_end]) if (.not. physics_process(iprc)%time_split) then do iCol = 1,nCol gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp @@ -171,7 +190,7 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j in_post_active = .true. endif - if (size(physics_process)+1 == iprc) then + if (size(physics_process) == proc_end) then in_pre_active = .true. in_post_active = .false. endif diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_scheme_simulator.meta index 8b2618317..c60cd9a38 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_scheme_simulator.meta @@ -117,6 +117,34 @@ type = real kind = kind_phys intent = in +[iactive_T] + standard_name = index_for_active_T_in_CCPP_scheme_simulator + long_name = index into active process tracer array for temperature in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[iactive_u] + standard_name = index_for_active_u_in_CCPP_scheme_simulator + long_name = index into active process tracer array for zonal wind in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[iactive_v] + standard_name = index_for_active_v_in_CCPP_scheme_simulator + long_name = index into active process tracer array for meridional wind in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in +[iactive_q] + standard_name = index_for_active_q_in_CCPP_scheme_simulator + long_name = index into active process tracer array for moisture in CCPP scheme simulator + units = count + dimensions = () + type = integer + intent = in [gt0] standard_name = air_temperature_of_new_state long_name = temperature updated by physics diff --git a/physics/module_ccpp_scheme_simulator.F90 b/physics/module_ccpp_scheme_simulator.F90 index 695a2bb03..a122563d9 100644 --- a/physics/module_ccpp_scheme_simulator.F90 +++ b/physics/module_ccpp_scheme_simulator.F90 @@ -73,6 +73,7 @@ module module_ccpp_scheme_simulator character(len=16) :: active_name ! "Active" scheme: Physics process name integer :: iactive_scheme ! "Active" scheme: Order of process in process-loop logical :: active_tsp ! "Active" scheme: Is process time-split? + integer :: nprg_active ! "Active" scheme: Number of prognostic variables contains generic, public :: linterp => linterp_1D, linterp_2D procedure, private :: linterp_1D From 9465b6f1a63606cf3ae4c0d48feab0507f338be4 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Tue, 11 Jul 2023 14:48:26 -0600 Subject: [PATCH 030/249] Housekeeping --- physics/GFS_ccpp_scheme_sim_pre.F90 | 21 +++++++++++++-------- physics/ccpp_scheme_simulator.F90 | 22 +++++++++++++++++----- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/physics/GFS_ccpp_scheme_sim_pre.F90 b/physics/GFS_ccpp_scheme_sim_pre.F90 index a5f6f0cfa..61ab573a3 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.F90 +++ b/physics/GFS_ccpp_scheme_sim_pre.F90 @@ -1,8 +1,12 @@ ! ######################################################################################## ! -! Interstitial CCPP scheme to couple UFS physics to ccpp_scheme_simulator. -! ) load: read and load data into type used by ccpp_scheme_simulator -! ) _run: prepare GFS diagnostic physics tendencies for ccpp_scheme_simulator +! Description: Interstitial CCPP scheme to couple UFS physics to ccpp_scheme_simulator. +! +! Contains: +! - load_ccpp_scheme_sim(): read and load data into type used by ccpp_scheme_simulator. +! called once during model initialization +! - GFS_ccpp_scheme_sim_pre_run(): prepare GFS diagnostic physics tendencies for +! ccpp_scheme_simulator. ! ! ######################################################################################## module GFS_ccpp_scheme_sim_pre @@ -102,8 +106,8 @@ subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process end subroutine GFS_ccpp_scheme_sim_pre_run ! ###################################################################################### - subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, & - iactive_T, iactive_u, iactive_v, iactive_q, errmsg, errflg) + subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, & + iactive_u, iactive_v, iactive_q, errmsg, errflg) ! Inputs integer, intent (in) :: nlunit @@ -121,7 +125,8 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, & logical :: exists, do_ccpp_scheme_sim integer :: nprc_sim - ! For each process there is a corresponding namelist entry, which is constructed as follows: + ! For each process there is a corresponding namelist entry, which is constructed as + ! follows: ! {use_scheme_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} integer, dimension(3) :: & prc_LWRAD_cfg = (/0,0,0/), & @@ -133,8 +138,8 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, & prc_cldMP_cfg = (/0,0,0/) ! Namelist - namelist / ccpp_scheme_sim_nml / do_ccpp_scheme_sim, scheme_sim_file, nprc_sim, & - prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg, prc_GWD_cfg, prc_SCNV_cfg, & + namelist / ccpp_scheme_sim_nml / do_ccpp_scheme_sim, scheme_sim_file, nprc_sim, & + prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg, prc_GWD_cfg, prc_SCNV_cfg, & prc_DCNV_cfg, prc_cldMP_cfg errmsg = '' diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_scheme_simulator.F90 index b825b8403..f3a6372ac 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_scheme_simulator.F90 @@ -1,8 +1,20 @@ ! ######################################################################################## -! -! CCPP scheme to replace physics schemes with simulated data tendencies. ! -! Description: +! Description: This scheme simulates the evolution of the internal physics state +! represented by a CCPP Suite Definition File (SDF). +! +! To activate this scheme it must be a) embedded within the SDF and b) activated through +! the physics namelist. +! The derived-data type "base_physics_process" contains the metadata needed to reconstruct +! the temporal evolution of the state. An array of base_physics_process, physics_process, +! is populated by the host during initialization and passed to the physics. Additionally, +! this type holds any data, or type-bound procedures, required by the scheme simulator(s). +! +! For this initial demonstration we are using 2-dimensional (height, time) forcing data, +! which is on the same native vertical grid as the SCM. The dataset has a temporal +! resolution of 1-hour, created by averaging all local times from a Tropical Warm Pool +! International Cloud Experiment (TWPICE) case. This was to create a dataset with a +! (constant) diurnal cycle. ! ! ######################################################################################## module ccpp_scheme_simulator @@ -160,9 +172,9 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j endif else if (physics_process(iprc)%time_split) then - write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,' time split scheme (active)' + write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'time split scheme (active)' else - write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,' process split scheme (active)' + write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'process split scheme (active)' endif write(*,'(a25,i2)') ' # prog. vars.: ',physics_process(1)%nprg_active endif From c61a2a61e7493c4b3dccae26761bdbd4f1939c5b Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 13 Jul 2023 11:01:50 -0600 Subject: [PATCH 031/249] GNU bug found in SCM CI --- physics/GFS_ccpp_scheme_sim_pre.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/GFS_ccpp_scheme_sim_pre.F90 b/physics/GFS_ccpp_scheme_sim_pre.F90 index 61ab573a3..db80e0c84 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.F90 +++ b/physics/GFS_ccpp_scheme_sim_pre.F90 @@ -159,9 +159,9 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, close (nlunit) ! Only proceed if scheme simulator requested. - if (prc_SWRAD_cfg(1) .or. prc_LWRAD_cfg(1) .or. prc_PBL_cfg(1) .or. & - prc_GWD_cfg(1) .or. prc_SCNV_cfg(1) .or. prc_DCNV_cfg(1) .or. & - prc_cldMP_cfg(1)) then + if (prc_SWRAD_cfg(1) == 1 .or. prc_LWRAD_cfg(1) == 1 .or. prc_PBL_cfg(1) == 1 .or. & + prc_GWD_cfg(1) == 1 .or. prc_SCNV_cfg(1) == 1 .or. prc_DCNV_cfg(1) == 1 .or. & + prc_cldMP_cfg(1) == 1 ) then else return endif From 8e5646e91dc31ac88baf4905eeb3056578b8aa9e Mon Sep 17 00:00:00 2001 From: dustinswales Date: Mon, 17 Jul 2023 18:08:45 -0600 Subject: [PATCH 032/249] Some cleanup. --- physics/GFS_ccpp_scheme_sim_pre.F90 | 14 +++++++++----- physics/GFS_ccpp_scheme_sim_pre.meta | 7 +++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/physics/GFS_ccpp_scheme_sim_pre.F90 b/physics/GFS_ccpp_scheme_sim_pre.F90 index db80e0c84..47865353d 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.F90 +++ b/physics/GFS_ccpp_scheme_sim_pre.F90 @@ -25,13 +25,15 @@ module GFS_ccpp_scheme_sim_pre !! \section arg_table_GFS_ccpp_scheme_sim_pre_run !! \htmlinclude GFS_ccpp_scheme_sim_pre_run.html !! - subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process_dcnv, & - index_of_process_longwave, index_of_process_shortwave, index_of_process_scnv, & - index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind, physics_process, & - iactive_T, iactive_u, iactive_v, iactive_q, active_phys_tend, errmsg, errflg) + subroutine GFS_ccpp_scheme_sim_pre_run(do_ccpp_scheme_sim, dtend, ntqv, dtidx, dtp, & + index_of_process_dcnv, index_of_process_longwave, index_of_process_shortwave, & + index_of_process_scnv, index_of_process_orographic_gwd, index_of_process_pbl, & + index_of_process_mp, index_of_temperature, index_of_x_wind, index_of_y_wind, & + physics_process, iactive_T, iactive_u, iactive_v, iactive_q, active_phys_tend, & + errmsg, errflg) ! Inputs + logical, intent(in) :: do_ccpp_scheme_sim integer, intent(in) :: ntqv, index_of_process_dcnv, index_of_process_longwave, & index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & @@ -54,6 +56,8 @@ subroutine GFS_ccpp_scheme_sim_pre_run(dtend, ntqv, dtidx, dtp, index_of_process errmsg = '' errflg = 0 + if (.not. do_ccpp_scheme_sim) return + ! Get tendency for "active" process. ! ###################################################################################### diff --git a/physics/GFS_ccpp_scheme_sim_pre.meta b/physics/GFS_ccpp_scheme_sim_pre.meta index 682b4baf8..ca6d4f7cc 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.meta +++ b/physics/GFS_ccpp_scheme_sim_pre.meta @@ -7,6 +7,13 @@ [ccpp-arg-table] name = GFS_ccpp_scheme_sim_pre_run type = scheme +[do_ccpp_scheme_sim] + standard_name = flag_for_ccpp_scheme_simulator + long_name = flag for ccpp scheme simulator + units = flag + dimensions = () + type = logical + intent = in [physics_process] standard_name = physics_process_type_for_CCPP_scheme_simulator long_name = physics process type for CCPP scheme simulator From e3c00d35207299024be4b016a2db8c3ad40f3ea7 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 19 Jul 2023 11:53:00 -0600 Subject: [PATCH 033/249] Renamed scheme simulator suite simulator --- ...sim_pre.F90 => GFS_ccpp_suite_sim_pre.F90} | 74 +++++++++---------- ...m_pre.meta => GFS_ccpp_suite_sim_pre.meta} | 40 +++++----- ...simulator.F90 => ccpp_suite_simulator.F90} | 28 +++---- ...mulator.meta => ccpp_suite_simulator.meta} | 56 +++++++------- ...or.F90 => module_ccpp_suite_simulator.F90} | 10 +-- ....meta => module_ccpp_suite_simulator.meta} | 4 +- 6 files changed, 106 insertions(+), 106 deletions(-) rename physics/{GFS_ccpp_scheme_sim_pre.F90 => GFS_ccpp_suite_sim_pre.F90} (86%) rename physics/{GFS_ccpp_scheme_sim_pre.meta => GFS_ccpp_suite_sim_pre.meta} (83%) rename physics/{ccpp_scheme_simulator.F90 => ccpp_suite_simulator.F90} (91%) rename physics/{ccpp_scheme_simulator.meta => ccpp_suite_simulator.meta} (76%) rename physics/{module_ccpp_scheme_simulator.F90 => module_ccpp_suite_simulator.F90} (98%) rename physics/{module_ccpp_scheme_simulator.meta => module_ccpp_suite_simulator.meta} (86%) diff --git a/physics/GFS_ccpp_scheme_sim_pre.F90 b/physics/GFS_ccpp_suite_sim_pre.F90 similarity index 86% rename from physics/GFS_ccpp_scheme_sim_pre.F90 rename to physics/GFS_ccpp_suite_sim_pre.F90 index 47865353d..fbaf5a1d9 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.F90 +++ b/physics/GFS_ccpp_suite_sim_pre.F90 @@ -1,31 +1,31 @@ ! ######################################################################################## ! -! Description: Interstitial CCPP scheme to couple UFS physics to ccpp_scheme_simulator. +! Description: Interstitial CCPP suite to couple UFS physics to ccpp_suite_simulator. ! ! Contains: -! - load_ccpp_scheme_sim(): read and load data into type used by ccpp_scheme_simulator. +! - load_ccpp_suite_sim(): read and load data into type used by ccpp_suite_simulator. ! called once during model initialization -! - GFS_ccpp_scheme_sim_pre_run(): prepare GFS diagnostic physics tendencies for -! ccpp_scheme_simulator. +! - GFS_ccpp_suite_sim_pre_run(): prepare GFS diagnostic physics tendencies for +! ccpp_suite_simulator. ! ! ######################################################################################## -module GFS_ccpp_scheme_sim_pre +module GFS_ccpp_suite_sim_pre use machine, only: kind_phys - use module_ccpp_scheme_simulator, only: base_physics_process + use module_ccpp_suite_simulator, only: base_physics_process use netcdf implicit none - public GFS_ccpp_scheme_sim_pre_run, load_ccpp_scheme_sim + public GFS_ccpp_suite_sim_pre_run, load_ccpp_suite_sim contains ! ###################################################################################### ! - ! SUBROUTINE GFS_ccpp_scheme_sim_pre_run + ! SUBROUTINE GFS_ccpp_suite_sim_pre_run ! ! ###################################################################################### -!! \section arg_table_GFS_ccpp_scheme_sim_pre_run -!! \htmlinclude GFS_ccpp_scheme_sim_pre_run.html +!! \section arg_table_GFS_ccpp_suite_sim_pre_run +!! \htmlinclude GFS_ccpp_suite_sim_pre_run.html !! - subroutine GFS_ccpp_scheme_sim_pre_run(do_ccpp_scheme_sim, dtend, ntqv, dtidx, dtp, & + subroutine GFS_ccpp_suite_sim_pre_run(do_ccpp_suite_sim, dtend, ntqv, dtidx, dtp, & index_of_process_dcnv, index_of_process_longwave, index_of_process_shortwave, & index_of_process_scnv, index_of_process_orographic_gwd, index_of_process_pbl, & index_of_process_mp, index_of_temperature, index_of_x_wind, index_of_y_wind, & @@ -33,7 +33,7 @@ subroutine GFS_ccpp_scheme_sim_pre_run(do_ccpp_scheme_sim, dtend, ntqv, dtidx, d errmsg, errflg) ! Inputs - logical, intent(in) :: do_ccpp_scheme_sim + logical, intent(in) :: do_ccpp_suite_sim integer, intent(in) :: ntqv, index_of_process_dcnv, index_of_process_longwave, & index_of_process_shortwave, index_of_process_scnv, & index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & @@ -56,7 +56,7 @@ subroutine GFS_ccpp_scheme_sim_pre_run(do_ccpp_scheme_sim, dtend, ntqv, dtidx, d errmsg = '' errflg = 0 - if (.not. do_ccpp_scheme_sim) return + if (.not. do_ccpp_suite_sim) return ! Get tendency for "active" process. @@ -64,7 +64,7 @@ subroutine GFS_ccpp_scheme_sim_pre_run(do_ccpp_scheme_sim, dtend, ntqv, dtidx, d ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional ! array, CCPP standard_name = cumulative_change_of_state_variables. ! These are not the instantaneous physics tendencies that are applied to the state by - ! the physics schemes. Not all schemes output physics tendencies... + ! the physics suites. Not all suites output physics tendencies... ! Rather these are intended for diagnostic puposes and are accumulated over some ! interval. ! In the UFS/SCM this is controlled by the diagnostic bucket interval, namelist option @@ -107,10 +107,10 @@ subroutine GFS_ccpp_scheme_sim_pre_run(do_ccpp_scheme_sim, dtend, ntqv, dtidx, d active_phys_tend(:,:,iactive_q) = dtend(:,:,idtend)/dtp endif - end subroutine GFS_ccpp_scheme_sim_pre_run + end subroutine GFS_ccpp_suite_sim_pre_run ! ###################################################################################### - subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, & + subroutine load_ccpp_suite_sim(nlunit, nml_file, physics_process, iactive_T, & iactive_u, iactive_v, iactive_q, errmsg, errflg) ! Inputs @@ -125,13 +125,13 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, ! Local variables integer :: ncid, dimID, varID, status, ios, iprc, nlev_data, ntime_data - character(len=256) :: scheme_sim_file - logical :: exists, do_ccpp_scheme_sim + character(len=256) :: suite_sim_file + logical :: exists, do_ccpp_suite_sim integer :: nprc_sim ! For each process there is a corresponding namelist entry, which is constructed as ! follows: - ! {use_scheme_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} + ! {use_suite_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} integer, dimension(3) :: & prc_LWRAD_cfg = (/0,0,0/), & prc_SWRAD_cfg = (/0,0,0/), & @@ -142,7 +142,7 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, prc_cldMP_cfg = (/0,0,0/) ! Namelist - namelist / ccpp_scheme_sim_nml / do_ccpp_scheme_sim, scheme_sim_file, nprc_sim, & + namelist / ccpp_suite_sim_nml / do_ccpp_suite_sim, suite_sim_file, nprc_sim, & prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg, prc_GWD_cfg, prc_SCNV_cfg, & prc_DCNV_cfg, prc_cldMP_cfg @@ -152,17 +152,17 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, ! Read in namelist inquire (file = trim (nml_file), exist = exists) if (.not. exists) then - errmsg = 'CCPP scheme simulator namelist file: '//trim(nml_file)//' does not exist.' + errmsg = 'CCPP suite simulator namelist file: '//trim(nml_file)//' does not exist.' errflg = 1 return else open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) endif rewind (nlunit) - read (nlunit, nml = ccpp_scheme_sim_nml, iostat=status) + read (nlunit, nml = ccpp_suite_sim_nml, iostat=status) close (nlunit) - ! Only proceed if scheme simulator requested. + ! Only proceed if suite simulator requested. if (prc_SWRAD_cfg(1) == 1 .or. prc_LWRAD_cfg(1) == 1 .or. prc_PBL_cfg(1) == 1 .or. & prc_GWD_cfg(1) == 1 .or. prc_SCNV_cfg(1) == 1 .or. prc_DCNV_cfg(1) == 1 .or. & prc_cldMP_cfg(1) == 1 ) then @@ -171,9 +171,9 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, endif ! Check that input data file exists. - inquire (file = trim (scheme_sim_file), exist = exists) + inquire (file = trim (suite_sim_file), exist = exists) if (.not. exists) then - errmsg = 'CCPP scheme simulator file: '//trim(scheme_sim_file)//' does not exist' + errmsg = 'CCPP suite simulator file: '//trim(suite_sim_file)//' does not exist' errflg = 1 return endif @@ -183,9 +183,9 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, ! ! Open file - status = nf90_open(trim(scheme_sim_file), NF90_NOWRITE, ncid) + status = nf90_open(trim(suite_sim_file), NF90_NOWRITE, ncid) if (status /= nf90_noerr) then - errmsg = 'Error reading in CCPP scheme simulator file: '//trim(scheme_sim_file) + errmsg = 'Error reading in CCPP suite simulator file: '//trim(suite_sim_file) errflg = 1 return endif @@ -195,7 +195,7 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, if (status == nf90_noerr) then status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) else - errmsg = 'CCPP scheme simulator file: '//trim(scheme_sim_file)//' does not contain [time] dimension' + errmsg = 'CCPP suite simulator file: '//trim(suite_sim_file)//' does not contain [time] dimension' errflg = 1 return endif @@ -204,7 +204,7 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, if (status == nf90_noerr) then status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) else - errmsg = 'CCPP scheme simulator file: '//trim(scheme_sim_file)//' does not contain [lev] dimension' + errmsg = 'CCPP suite simulator file: '//trim(suite_sim_file)//' does not contain [lev] dimension' errflg = 1 return endif @@ -230,7 +230,7 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, if (status == nf90_noerr) then status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%time) else - errmsg = 'SCM data tendency file: '//trim(scheme_sim_file)//' does not contain times variable' + errmsg = 'SCM data tendency file: '//trim(suite_sim_file)//' does not contain times variable' errflg = 1 return endif @@ -403,7 +403,7 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) endif - ! Which process-scheme is "active"? Is process time-split? + ! Which process-suite is "active"? Is process time-split? if (.not. physics_process(iprc)%use_sim) then physics_process(1)%iactive_scheme = iprc physics_process(1)%active_name = physics_process(iprc)%name @@ -416,20 +416,20 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, if (physics_process(1)%iactive_scheme == 0) then errflg = 1 - errmsg = "ERROR: No active scheme set for CCPP scheme simulator" + errmsg = "ERROR: No active suite set for CCPP suite simulator" return endif print*, "-----------------------------------" - print*, "--- Using CCPP scheme simulator ---" + print*, "--- Using CCPP suite simulator ---" print*, "-----------------------------------" do iprc = 1,nprc_sim if (physics_process(iprc)%use_sim) then - print*," simulate_scheme: ", trim(physics_process(iprc)%name) + print*," simulate_suite: ", trim(physics_process(iprc)%name) print*," order: ", physics_process(iprc)%order print*," time_split: ", physics_process(iprc)%time_split else - print*, " active_scheme: ", trim(physics_process(1)%active_name) + print*, " active_suite: ", trim(physics_process(1)%active_name) print*, " order: ", physics_process(physics_process(1)%iactive_scheme)%order print*, " time_split : ", physics_process(1)%active_tsp endif @@ -437,6 +437,6 @@ subroutine load_ccpp_scheme_sim(nlunit, nml_file, physics_process, iactive_T, print*, "-----------------------------------" print*, "-----------------------------------" - end subroutine load_ccpp_scheme_sim + end subroutine load_ccpp_suite_sim -end module GFS_ccpp_scheme_sim_pre +end module GFS_ccpp_suite_sim_pre diff --git a/physics/GFS_ccpp_scheme_sim_pre.meta b/physics/GFS_ccpp_suite_sim_pre.meta similarity index 83% rename from physics/GFS_ccpp_scheme_sim_pre.meta rename to physics/GFS_ccpp_suite_sim_pre.meta index ca6d4f7cc..cc73813fa 100644 --- a/physics/GFS_ccpp_scheme_sim_pre.meta +++ b/physics/GFS_ccpp_suite_sim_pre.meta @@ -1,24 +1,24 @@ [ccpp-table-properties] - name = GFS_ccpp_scheme_sim_pre + name = GFS_ccpp_suite_sim_pre type = scheme - dependencies = machine.F,module_ccpp_scheme_simulator.F90 + dependencies = machine.F,module_ccpp_suite_simulator.F90 ######################################################################## [ccpp-arg-table] - name = GFS_ccpp_scheme_sim_pre_run + name = GFS_ccpp_suite_sim_pre_run type = scheme -[do_ccpp_scheme_sim] - standard_name = flag_for_ccpp_scheme_simulator - long_name = flag for ccpp scheme simulator +[do_ccpp_suite_sim] + standard_name = flag_for_ccpp_suite_simulator + long_name = flag for ccpp suite simulator units = flag dimensions = () type = logical intent = in [physics_process] - standard_name = physics_process_type_for_CCPP_scheme_simulator - long_name = physics process type for CCPP scheme simulator + standard_name = physics_process_type_for_CCPP_suite_simulator + long_name = physics process type for CCPP suite simulator units = mixed - dimensions = (number_of_physics_process_in_CCPP_scheme_simulator) + dimensions = (number_of_physics_process_in_CCPP_suite_simulator) type = base_physics_process intent = in [dtend] @@ -122,37 +122,37 @@ type = integer intent = in [active_phys_tend] - standard_name = tendencies_for_active_process_in_ccpp_scheme_simulator - long_name = tendencies for active physics process in ccpp scheme simulator + standard_name = tendencies_for_active_process_in_ccpp_suite_simulator + long_name = tendencies for active physics process in ccpp suite simulator units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_scheme_simulator) + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_suite_simulator) type = real kind = kind_phys intent = out [iactive_T] - standard_name = index_for_active_T_in_CCPP_scheme_simulator - long_name = index into active process tracer array for temperature in CCPP scheme simulator + standard_name = index_for_active_T_in_CCPP_suite_simulator + long_name = index into active process tracer array for temperature in CCPP suite simulator units = count dimensions = () type = integer intent = in [iactive_u] - standard_name = index_for_active_u_in_CCPP_scheme_simulator - long_name = index into active process tracer array for zonal wind in CCPP scheme simulator + standard_name = index_for_active_u_in_CCPP_suite_simulator + long_name = index into active process tracer array for zonal wind in CCPP suite simulator units = count dimensions = () type = integer intent = in [iactive_v] - standard_name = index_for_active_v_in_CCPP_scheme_simulator - long_name = index into active process tracer array for meridional wind in CCPP scheme simulator + standard_name = index_for_active_v_in_CCPP_suite_simulator + long_name = index into active process tracer array for meridional wind in CCPP suite simulator units = count dimensions = () type = integer intent = in [iactive_q] - standard_name = index_for_active_q_in_CCPP_scheme_simulator - long_name = index into active process tracer array for moisture in CCPP scheme simulator + standard_name = index_for_active_q_in_CCPP_suite_simulator + long_name = index into active process tracer array for moisture in CCPP suite simulator units = count dimensions = () type = integer diff --git a/physics/ccpp_scheme_simulator.F90 b/physics/ccpp_suite_simulator.F90 similarity index 91% rename from physics/ccpp_scheme_simulator.F90 rename to physics/ccpp_suite_simulator.F90 index f3a6372ac..c1592263d 100644 --- a/physics/ccpp_scheme_simulator.F90 +++ b/physics/ccpp_suite_simulator.F90 @@ -1,14 +1,14 @@ ! ######################################################################################## ! -! Description: This scheme simulates the evolution of the internal physics state +! Description: This suite simulates the evolution of the internal physics state ! represented by a CCPP Suite Definition File (SDF). ! -! To activate this scheme it must be a) embedded within the SDF and b) activated through +! To activate this suite it must be a) embedded within the SDF and b) activated through ! the physics namelist. ! The derived-data type "base_physics_process" contains the metadata needed to reconstruct ! the temporal evolution of the state. An array of base_physics_process, physics_process, ! is populated by the host during initialization and passed to the physics. Additionally, -! this type holds any data, or type-bound procedures, required by the scheme simulator(s). +! this type holds any data, or type-bound procedures, required by the suite simulator(s). ! ! For this initial demonstration we are using 2-dimensional (height, time) forcing data, ! which is on the same native vertical grid as the SCM. The dataset has a temporal @@ -17,29 +17,29 @@ ! (constant) diurnal cycle. ! ! ######################################################################################## -module ccpp_scheme_simulator +module ccpp_suite_simulator use machine, only: kind_phys - use module_ccpp_scheme_simulator, only: base_physics_process, sim_LWRAD, sim_SWRAD, & + use module_ccpp_suite_simulator, only: base_physics_process, sim_LWRAD, sim_SWRAD, & sim_PBL, sim_GWD, sim_DCNV, sim_SCNV, sim_cldMP implicit none - public ccpp_scheme_simulator_run + public ccpp_suite_simulator_run contains ! ###################################################################################### ! - ! SUBROUTINE ccpp_scheme_simulator_run + ! SUBROUTINE ccpp_suite_simulator_run ! ! ###################################################################################### -!! \section arg_table_ccpp_scheme_simulator_run -!! \htmlinclude ccpp_scheme_simulator_run.html +!! \section arg_table_ccpp_suite_simulator_run +!! \htmlinclude ccpp_suite_simulator_run.html !! - subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, jdat, & + subroutine ccpp_suite_simulator_run(do_ccpp_suite_sim, kdt, nCol, nLay, dtp, jdat, & iactive_T, iactive_u, iactive_v, iactive_q, proc_start, proc_end, physics_process,& in_pre_active, in_post_active, tgrs, ugrs, vgrs, qgrs, active_phys_tend, gt0, gu0,& gv0, gq0, errmsg, errflg) ! Inputs - logical, intent(in) :: do_ccpp_scheme_sim + logical, intent(in) :: do_ccpp_suite_sim integer, intent(in) :: kdt, nCol, nLay, jdat(8), iactive_T, iactive_u, & iactive_v, iactive_q real(kind_phys), intent(in) :: dtp, tgrs(:,:), ugrs(:,:), vgrs(:,:), qgrs(:,:,:), & @@ -60,7 +60,7 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j errmsg = '' errflg = 0 - if (.not. do_ccpp_scheme_sim) return + if (.not. do_ccpp_suite_sim) return ! Current forecast time (Data-format specific) year = jdat(1) @@ -207,6 +207,6 @@ subroutine ccpp_scheme_simulator_run(do_ccpp_scheme_sim, kdt, nCol, nLay, dtp, j in_post_active = .false. endif - end subroutine ccpp_scheme_simulator_run + end subroutine ccpp_suite_simulator_run -end module ccpp_scheme_simulator +end module ccpp_suite_simulator diff --git a/physics/ccpp_scheme_simulator.meta b/physics/ccpp_suite_simulator.meta similarity index 76% rename from physics/ccpp_scheme_simulator.meta rename to physics/ccpp_suite_simulator.meta index c60cd9a38..f2737a263 100644 --- a/physics/ccpp_scheme_simulator.meta +++ b/physics/ccpp_suite_simulator.meta @@ -1,14 +1,14 @@ [ccpp-table-properties] - name = ccpp_scheme_simulator + name = ccpp_suite_simulator type = scheme - dependencies = machine.F,module_ccpp_scheme_simulator.F90 + dependencies = machine.F,module_ccpp_suite_simulator.F90 [ccpp-arg-table] - name = ccpp_scheme_simulator_run + name = ccpp_suite_simulator_run type = scheme -[do_ccpp_scheme_sim] - standard_name = flag_for_ccpp_scheme_simulator - long_name = flag for ccpp scheme simulator +[do_ccpp_suite_sim] + standard_name = flag_for_ccpp_suite_simulator + long_name = flag for ccpp suite simulator units = flag dimensions = () type = logical @@ -50,29 +50,29 @@ type = integer intent = in [proc_start] - standard_name = index_for_first_physics_process_in_CCPP_scheme_simulator - long_name = index for first physics process in CCPP scheme simulator + standard_name = index_for_first_physics_process_in_CCPP_suite_simulator + long_name = index for first physics process in CCPP suite simulator units = count dimensions = () type = integer intent = inout [proc_end] - standard_name = index_for_last_physics_process_in_CCPP_scheme_simulator - long_name = index for last physics process in CCPP scheme simulator + standard_name = index_for_last_physics_process_in_CCPP_suite_simulator + long_name = index for last physics process in CCPP suite simulator units = count dimensions = () type = integer intent = inout [in_pre_active] - standard_name = flag_to_indicate_location_in_physics_process_loop_before_active_scheme - long_name = flag to indicate location in physics process loop before active scheme + standard_name = flag_to_indicate_location_in_physics_process_loop_before_active_suite + long_name = flag to indicate location in physics process loop before active suite units = flag dimensions = () type = logical intent = inout [in_post_active] - standard_name = flag_to_indicate_location_in_physics_process_loop_after_active_scheme - long_name = flag to indicate location in physics process loop after active scheme + standard_name = flag_to_indicate_location_in_physics_process_loop_after_active_suite + long_name = flag to indicate location in physics process loop after active suite units = flag dimensions = () type = logical @@ -110,37 +110,37 @@ kind = kind_phys intent = in [active_phys_tend] - standard_name = tendencies_for_active_process_in_ccpp_scheme_simulator - long_name = tendencies for active physics process in ccpp scheme simulator + standard_name = tendencies_for_active_process_in_ccpp_suite_simulator + long_name = tendencies for active physics process in ccpp suite simulator units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_scheme_simulator) + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_suite_simulator) type = real kind = kind_phys intent = in [iactive_T] - standard_name = index_for_active_T_in_CCPP_scheme_simulator - long_name = index into active process tracer array for temperature in CCPP scheme simulator + standard_name = index_for_active_T_in_CCPP_suite_simulator + long_name = index into active process tracer array for temperature in CCPP suite simulator units = count dimensions = () type = integer intent = in [iactive_u] - standard_name = index_for_active_u_in_CCPP_scheme_simulator - long_name = index into active process tracer array for zonal wind in CCPP scheme simulator + standard_name = index_for_active_u_in_CCPP_suite_simulator + long_name = index into active process tracer array for zonal wind in CCPP suite simulator units = count dimensions = () type = integer intent = in [iactive_v] - standard_name = index_for_active_v_in_CCPP_scheme_simulator - long_name = index into active process tracer array for meridional wind in CCPP scheme simulator + standard_name = index_for_active_v_in_CCPP_suite_simulator + long_name = index into active process tracer array for meridional wind in CCPP suite simulator units = count dimensions = () type = integer intent = in [iactive_q] - standard_name = index_for_active_q_in_CCPP_scheme_simulator - long_name = index into active process tracer array for moisture in CCPP scheme simulator + standard_name = index_for_active_q_in_CCPP_suite_simulator + long_name = index into active process tracer array for moisture in CCPP suite simulator units = count dimensions = () type = integer @@ -178,10 +178,10 @@ kind = kind_phys intent = inout [physics_process] - standard_name = physics_process_type_for_CCPP_scheme_simulator - long_name = physics process type for CCPP scheme simulator + standard_name = physics_process_type_for_CCPP_suite_simulator + long_name = physics process type for CCPP suite simulator units = mixed - dimensions = (number_of_physics_process_in_CCPP_scheme_simulator) + dimensions = (number_of_physics_process_in_CCPP_suite_simulator) type = base_physics_process intent = inout [errmsg] diff --git a/physics/module_ccpp_scheme_simulator.F90 b/physics/module_ccpp_suite_simulator.F90 similarity index 98% rename from physics/module_ccpp_scheme_simulator.F90 rename to physics/module_ccpp_suite_simulator.F90 index a122563d9..c759c583a 100644 --- a/physics/module_ccpp_scheme_simulator.F90 +++ b/physics/module_ccpp_suite_simulator.F90 @@ -1,12 +1,12 @@ ! ######################################################################################## ! ! This module contains the type, base_physics_process, and supporting subroutines needed -! by the ccpp scheme simulator. +! by the ccpp suite simulator. ! ! ######################################################################################## -module module_ccpp_scheme_simulator -!> \section arg_table_module_ccpp_scheme_simulator Argument table -!! \htmlinclude module_ccpp_scheme_simulator.html +module module_ccpp_suite_simulator +!> \section arg_table_module_ccpp_suite_simulator Argument table +!! \htmlinclude module_ccpp_suite_simulator.html !! use machine, only : kind_phys implicit none @@ -307,4 +307,4 @@ subroutine sim_cldMP( year, month, day, hour, min, sec, process) endif end subroutine sim_cldMP -end module module_ccpp_scheme_simulator +end module module_ccpp_suite_simulator diff --git a/physics/module_ccpp_scheme_simulator.meta b/physics/module_ccpp_suite_simulator.meta similarity index 86% rename from physics/module_ccpp_scheme_simulator.meta rename to physics/module_ccpp_suite_simulator.meta index 8eefb228c..cd8e3db1b 100644 --- a/physics/module_ccpp_scheme_simulator.meta +++ b/physics/module_ccpp_suite_simulator.meta @@ -9,12 +9,12 @@ ######################################################################## [ccpp-table-properties] - name = module_ccpp_scheme_simulator + name = module_ccpp_suite_simulator type = module dependencies = machine.F [ccpp-arg-table] - name = module_ccpp_scheme_simulator + name = module_ccpp_suite_simulator type = module [base_physics_process] standard_name = base_physics_process From 2d6d44c8d56aa707d4e11901f1965df322c2322a Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 19 Jul 2023 16:12:43 -0600 Subject: [PATCH 034/249] Omission from previous commit --- physics/ccpp_suite_simulator.meta | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/ccpp_suite_simulator.meta b/physics/ccpp_suite_simulator.meta index f2737a263..bfa664922 100644 --- a/physics/ccpp_suite_simulator.meta +++ b/physics/ccpp_suite_simulator.meta @@ -64,15 +64,15 @@ type = integer intent = inout [in_pre_active] - standard_name = flag_to_indicate_location_in_physics_process_loop_before_active_suite - long_name = flag to indicate location in physics process loop before active suite + standard_name = flag_to_indicate_location_in_physics_process_loop_before_active_scheme + long_name = flag to indicate location in physics process loop before active scheme units = flag dimensions = () type = logical intent = inout [in_post_active] - standard_name = flag_to_indicate_location_in_physics_process_loop_after_active_suite - long_name = flag to indicate location in physics process loop after active suite + standard_name = flag_to_indicate_location_in_physics_process_loop_after_active_scheme + long_name = flag to indicate location in physics process loop after active scheme units = flag dimensions = () type = logical From 5ab1a5bb7385214ec8febaa0d2bef2f6a1377481 Mon Sep 17 00:00:00 2001 From: dustinswales Date: Wed, 19 Jul 2023 16:48:11 -0600 Subject: [PATCH 035/249] Add ability to use constant forcing data when one-dimensional data is provided. --- physics/module_ccpp_suite_simulator.F90 | 28 ++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/physics/module_ccpp_suite_simulator.F90 b/physics/module_ccpp_suite_simulator.F90 index c759c583a..c4f9fc4e4 100644 --- a/physics/module_ccpp_suite_simulator.F90 +++ b/physics/module_ccpp_suite_simulator.F90 @@ -94,21 +94,39 @@ function linterp_1D(this, var_name, year, month, day, hour, min, sec) result(err character(len=*), intent(in) :: var_name integer, intent(in) :: year, month, day, hour, min, sec character(len=128) :: err_message - integer :: ti(1), tf(1) + integer :: ti(1), tf(1), ntime real(kind_phys) :: w1, w2 ! Interpolation weights call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) + ntime = size(this%tend2d%T(1,:)) + select case(var_name) case("T") - this%tend1d%T = w1*this%tend2d%T(:,ti(1)) + w2*this%tend2d%T(:,tf(1)) + if (tf(1) .le. ntime) then + this%tend1d%T = w1*this%tend2d%T(:,ti(1)) + w2*this%tend2d%T(:,tf(1)) + else + this%tend1d%T = this%tend2d%T(:,1) + endif case("u") - this%tend1d%u = w1*this%tend2d%u(:,ti(1)) + w2*this%tend2d%u(:,tf(1)) + if (tf(1) .le. ntime) then + this%tend1d%u = w1*this%tend2d%u(:,ti(1)) + w2*this%tend2d%u(:,tf(1)) + else + this%tend1d%u = this%tend2d%u(:,1) + endif case("v") - this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1)) + if (tf(1) .le. ntime) then + this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1)) + else + this%tend1d%v = this%tend2d%v(:,1) + endif case("q") - this%tend1d%q = w1*this%tend2d%q(:,ti(1)) + w2*this%tend2d%q(:,tf(1)) + if (tf(1) .le. ntime) then + this%tend1d%q = w1*this%tend2d%q(:,ti(1)) + w2*this%tend2d%q(:,tf(1)) + else + this%tend1d%q = this%tend2d%q(:,1) + endif end select end function linterp_1D From 9891fff7bd9eb8660a60ff203112298bf1349406 Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Mon, 31 Jul 2023 10:50:36 -0600 Subject: [PATCH 036/249] switch from in to inout for output variables --- physics/sfc_land.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/sfc_land.f b/physics/sfc_land.f index aec47ff77..d4e88c25a 100644 --- a/physics/sfc_land.f +++ b/physics/sfc_land.f @@ -112,7 +112,7 @@ subroutine sfc_land_run & & cmm_lnd, chh_lnd, zvfun_lnd ! --- outputs: - real (kind=kind_phys), dimension(:), intent(out) :: & + real (kind=kind_phys), dimension(:), intent(inout) :: & & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, gflux, & & runoff, drain, cmm, chh, zvfun ! From 70038f6f5f70572f09489732e3563f1d11066a1f Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Mon, 31 Jul 2023 11:50:02 -0600 Subject: [PATCH 037/249] update meta file for sfc_land too --- physics/sfc_land.meta | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/physics/sfc_land.meta b/physics/sfc_land.meta index 979cca377..493d2a70b 100644 --- a/physics/sfc_land.meta +++ b/physics/sfc_land.meta @@ -153,7 +153,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [qsurf] standard_name = surface_specific_humidity_over_land long_name = surface air saturation specific humidity over land @@ -161,7 +161,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [evap] standard_name = kinematic_surface_upward_latent_heat_flux_over_land long_name = kinematic surface upward latent heat flux over land @@ -169,7 +169,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land @@ -177,7 +177,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [ep] standard_name = surface_upward_potential_latent_heat_flux_over_land long_name = surface upward potential latent heat flux over land @@ -185,7 +185,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [t2mmp] standard_name = temperature_at_2m_from_noahmp long_name = 2 meter temperature from noahmp @@ -193,7 +193,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [q2mp] standard_name = specific_humidity_at_2m_from_noahmp long_name = 2 meter specific humidity from noahmp @@ -201,7 +201,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [gflux] standard_name = upward_heat_flux_in_soil_over_land long_name = soil heat flux over land @@ -209,7 +209,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [runoff] standard_name = surface_runoff_flux long_name = surface runoff flux @@ -217,7 +217,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [drain] standard_name = subsurface_runoff_flux long_name = subsurface runoff flux @@ -225,7 +225,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [cmm] standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land long_name = momentum exchange coefficient over land @@ -233,7 +233,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [chh] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land long_name = thermal exchange coefficient over land @@ -241,7 +241,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [zvfun] standard_name = function_of_surface_roughness_length_and_green_vegetation_fraction long_name = function of surface roughness length and green vegetation fraction @@ -249,7 +249,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 6ec72e918d2f2d04f78a9afaf5b58968370a44a4 Mon Sep 17 00:00:00 2001 From: uturuncoglu Date: Mon, 31 Jul 2023 16:21:27 -0600 Subject: [PATCH 038/249] update sfc_land --- physics/sfc_land.F90 | 108 ++++++++++++++++++++++++++++++ physics/sfc_land.f | 154 ------------------------------------------- 2 files changed, 108 insertions(+), 154 deletions(-) create mode 100644 physics/sfc_land.F90 delete mode 100644 physics/sfc_land.f diff --git a/physics/sfc_land.F90 b/physics/sfc_land.F90 new file mode 100644 index 000000000..2b0696ed8 --- /dev/null +++ b/physics/sfc_land.F90 @@ -0,0 +1,108 @@ +!> \file sfc_land.F90 +!! This file contains the code for coupling to land component + +!> This module contains the CCPP-compliant GFS land post +!! interstitial codes, which returns updated surface +!! properties such as latent heat and sensible heat +!! provided by the component version of land model + +!> This module contains the CCPP-compliant GFS land scheme. + module sfc_land + + use machine, only : kind_phys + + contains + +!> \defgroup sfc_land for coupling to land +!! @{ +!! \section diagram Calling Hierarchy Diagram +!! \section intraphysics Intraphysics Communication +!! +!> \brief Brief description of the subroutine +!! +!! \section arg_table_sfc_land_run Arguments +!! \htmlinclude sfc_land_run.html +!! + +!! +!! \section general General Algorithm +!! \section detailed Detailed Algorithm +!! @{ + subroutine sfc_land_run(im, cpllnd, cpllnd2atm, flag_iter, dry, & + sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & + ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & + runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & + sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & + gflux, runoff, drain, cmm, chh, zvfun, & + errmsg, errflg) + + implicit none + + ! Inputs + integer , intent(in) :: im + logical , intent(in) :: cpllnd + 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(:) + ! 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) :: gflux(:) + real(kind=kind_phys), intent(inout) :: runoff(:) + real(kind=kind_phys), intent(inout) :: drain(:) + real(kind=kind_phys), intent(inout) :: cmm(:) + real(kind=kind_phys), intent(inout) :: chh(:) + real(kind=kind_phys), intent(inout) :: zvfun(:) + ! Outputs + character(len=*) , intent(out) :: errmsg + integer , intent(out) :: errflg + + ! Locals + integer :: i + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Check coupling from component land to atmosphere + if (.not. cpllnd2atm) return + + ! Fill variables + do i = 1, im + sncovr1(i) = sncovr1_lnd(i) + qsurf(i) = qsurf_lnd(i) + hflx(i) = hflx_lnd(i) + evap(i) = evap_lnd(i) + ep(i) = ep_lnd(i) + t2mmp(i) = t2mmp_lnd(i) + q2mp(i) = q2mp_lnd(i) + gflux(i) = gflux_lnd(i) + drain(i) = drain_lnd(i) + runoff(i) = runoff_lnd(i) + cmm(i) = cmm_lnd(i) + chh(i) = chh_lnd(i) + zvfun(i) = zvfun_lnd(i) + enddo + + end subroutine sfc_land_run + +!> @} + end module sfc_land diff --git a/physics/sfc_land.f b/physics/sfc_land.f deleted file mode 100644 index d4e88c25a..000000000 --- a/physics/sfc_land.f +++ /dev/null @@ -1,154 +0,0 @@ -!> \file sfc_land.f -!! This file contains the code for coupling to land component - -!> This module contains the CCPP-compliant GFS land post -!! interstitial codes, which returns updated surface -!! properties such as latent heat and sensible heat -!! provided by the component version of land model - -!> This module contains the CCPP-compliant GFS land scheme. - module sfc_land - - contains - -!> \defgroup sfc_land for coupling to land -!! @{ -!! \section diagram Calling Hierarchy Diagram -!! \section intraphysics Intraphysics Communication -!! -!> \brief Brief description of the subroutine -!! -!! \section arg_table_sfc_land_run Arguments -!! \htmlinclude sfc_land_run.html -!! - -!! -!! \section general General Algorithm -!! \section detailed Detailed Algorithm -!! @{ - -! -!----------------------------------- - subroutine sfc_land_run & -! --- inputs: - & ( im, cpllnd, cpllnd2atm, flag_iter, dry, & - & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, & - & ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, & - & runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, zvfun_lnd, & -! --- outputs: - & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, & - & gflux, runoff, drain, cmm, chh, zvfun, & - & errmsg, errflg - & ) - -! ===================================================================== ! -! description: ! -! Dec 2022 -- Ufuk Turuncoglu created for coupling to land ! -! ! -! usage: ! -! ! -! call sfc_land ! -! inputs: ! -! ( im, cpllnd, cpllnd2atm, flag_iter, dry, ! -! sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ! -! ep_lnd, t2mmp_lnd, q2mp_lnd, gflux_lnd, ! -! runoff_lnd, drain_lnd, cmm_lnd, chh_lnd, ! -! zvfun_lnd, ! -! outputs: ! -! sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, ! -! gflux, runoff, drain, cmm, chh, zvfun, ! -! errmsg, errflg) ! -! ! -! ==================== defination of variables ==================== ! -! ! -! inputs: -! im - integer, horiz dimension -! cpllnd - logical, flag for land coupling -! cpllnd2atm - logical, flag for land coupling (lnd->atm) -! flag_iter - logical, flag for iteration -! dry - logical, eq T if a point with any land -! sncovr1_lnd - real , surface snow area fraction -! qsurf_lnd - real , specific humidity at sfc -! evap_lnd - real , evaporation from latent heat -! hflx_lnd - real , sensible heat -! ep_lnd - real , surface upward potential latent heat flux -! t2mmp_lnd - real , 2m temperature -! q2mp_lnd - real , 2m specific humidity -! gflux_lnd - real , soil heat flux over land -! runoff_lnd - real , surface runoff -! drain_lnd - real , subsurface runoff -! cmm_lnd - real , surface drag wind speed for momentum -! chh_lnd - real , surface drag mass flux for heat and moisture -! zvfun_lnd - real , function of surface roughness length and green vegetation fraction -! outputs: -! sncovr1 - real , snow cover over land -! qsurf - real , specific humidity at sfc -! evap - real , evaporation from latent heat -! hflx - real , sensible heat -! ep - real , potential evaporation -! t2mmp - real , temperature at 2m -! q2mp - real , specific humidity at 2m -! gflux - real , soil heat flux over land -! runoff - real , surface runoff -! drain - real , subsurface runoff -! cmm - real , surface drag wind speed for momentum -! chh - real , surface drag mass flux for heat and moisture -! zvfun - real , function of surface roughness length and green vegetation fraction -! ==================== end of description ===================== ! -! -! - use machine , only : kind_phys - implicit none - -! --- inputs: - integer, intent(in) :: im - logical, intent(in) :: cpllnd, cpllnd2atm - logical, dimension(:), intent(in) :: flag_iter - logical, dimension(:), intent(in) :: dry - - real (kind=kind_phys), dimension(:), intent(in) :: & - & sncovr1_lnd, qsurf_lnd, evap_lnd, hflx_lnd, ep_lnd, & - & t2mmp_lnd, q2mp_lnd, gflux_lnd, runoff_lnd, drain_lnd, & - & cmm_lnd, chh_lnd, zvfun_lnd - -! --- outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: & - & sncovr1, qsurf, evap, hflx, ep, t2mmp, q2mp, gflux, & - & runoff, drain, cmm, chh, zvfun -! - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! --- locals: - - integer :: i - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 -! - if (.not. cpllnd2atm) return -! - do i = 1, im - sncovr1(i) = sncovr1_lnd(i) - qsurf(i) = qsurf_lnd(i) - hflx(i) = hflx_lnd(i) - evap(i) = evap_lnd(i) - ep(i) = ep_lnd(i) - t2mmp(i) = t2mmp_lnd(i) - q2mp(i) = q2mp_lnd(i) - gflux(i) = gflux_lnd(i) - drain(i) = drain_lnd(i) - runoff(i) = runoff_lnd(i) - cmm(i) = cmm_lnd(i) - chh(i) = chh_lnd(i) - zvfun(i) = zvfun_lnd(i) - enddo - - return -!----------------------------------- - end subroutine sfc_land_run -!----------------------------------- - -!> @} - end module sfc_land From c31f9207d1d75f4a42e32404ba7ecad264f90404 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 1 Sep 2023 17:50:08 +0000 Subject: [PATCH 039/249] Reorganization --- .gitmodules | 2 +- physics/{ => CONV/CCC}/cu_c3_deep.F90 | 0 physics/{ => CONV/CCC}/cu_c3_driver.F90 | 0 physics/{ => CONV/CCC}/cu_c3_driver.meta | 2 +- physics/{ => CONV/CCC}/cu_c3_driver_post.F90 | 0 physics/{ => CONV/CCC}/cu_c3_driver_post.meta | 2 +- physics/{ => CONV/CCC}/cu_c3_driver_pre.F90 | 0 physics/{ => CONV/CCC}/cu_c3_driver_pre.meta | 2 +- physics/{ => CONV/CCC}/cu_c3_sh.F90 | 0 physics/{ => CONV/Chikira_Sugiyama}/cs_conv.F90 | 0 physics/{ => CONV/Chikira_Sugiyama}/cs_conv.meta | 2 +- .../{ => CONV/Chikira_Sugiyama}/cs_conv_aw_adj.F90 | 0 .../{ => CONV/Chikira_Sugiyama}/cs_conv_aw_adj.meta | 2 +- physics/{ => CONV/Chikira_Sugiyama}/cs_conv_post.F90 | 0 physics/{ => CONV/Chikira_Sugiyama}/cs_conv_post.meta | 2 +- physics/{ => CONV/Chikira_Sugiyama}/cs_conv_pre.F90 | 0 physics/{ => CONV/Chikira_Sugiyama}/cs_conv_pre.meta | 2 +- physics/{ => CONV/Grell_Freitas}/cu_gf_deep.F90 | 0 physics/{ => CONV/Grell_Freitas}/cu_gf_driver.F90 | 0 physics/{ => CONV/Grell_Freitas}/cu_gf_driver.meta | 2 +- .../{ => CONV/Grell_Freitas}/cu_gf_driver_post.F90 | 0 .../{ => CONV/Grell_Freitas}/cu_gf_driver_post.meta | 2 +- physics/{ => CONV/Grell_Freitas}/cu_gf_driver_pre.F90 | 0 .../{ => CONV/Grell_Freitas}/cu_gf_driver_pre.meta | 2 +- physics/{ => CONV/Grell_Freitas}/cu_gf_sh.F90 | 0 physics/{ => CONV/RAS}/rascnv.F90 | 0 physics/{ => CONV/RAS}/rascnv.meta | 2 +- physics/{ => CONV/SAMF}/samfaerosols.F | 0 physics/{ => CONV/SAMF}/samfdeepcnv.f | 0 physics/{ => CONV/SAMF}/samfdeepcnv.meta | 2 +- physics/{ => CONV/SAMF}/samfshalcnv.f | 0 physics/{ => CONV/SAMF}/samfshalcnv.meta | 2 +- physics/{ => CONV/SAS}/sascnvn.F | 0 physics/{ => CONV/SAS}/sascnvn.meta | 2 +- physics/{ => CONV/SAS}/shalcnv.F | 0 physics/{ => CONV/SAS}/shalcnv.meta | 2 +- physics/{ => CONV/nTiedtke}/cu_ntiedtke.F90 | 0 physics/{ => CONV/nTiedtke}/cu_ntiedtke.meta | 2 +- physics/{ => CONV/nTiedtke}/cu_ntiedtke_post.F90 | 0 physics/{ => CONV/nTiedtke}/cu_ntiedtke_post.meta | 2 +- physics/{ => CONV/nTiedtke}/cu_ntiedtke_pre.F90 | 0 physics/{ => CONV/nTiedtke}/cu_ntiedtke_pre.meta | 2 +- physics/{ => CONV}/progsigma_calc.f90 | 0 physics/{ => GWD}/cires_orowam2017.f | 0 physics/{ => GWD}/cires_tauamf_data.F90 | 0 physics/{ => GWD}/cires_ugwp.F90 | 0 physics/{ => GWD}/cires_ugwp.meta | 2 +- physics/{ => GWD}/cires_ugwp_initialize.F90 | 0 physics/{ => GWD}/cires_ugwp_module.F90 | 0 physics/{ => GWD}/cires_ugwp_post.F90 | 0 physics/{ => GWD}/cires_ugwp_post.meta | 2 +- physics/{ => GWD}/cires_ugwp_triggers.F90 | 0 physics/{ => GWD}/cires_ugwpv1_initialize.F90 | 0 physics/{ => GWD}/cires_ugwpv1_module.F90 | 0 physics/{ => GWD}/cires_ugwpv1_oro.F90 | 0 physics/{ => GWD}/cires_ugwpv1_solv2.F90 | 0 physics/{ => GWD}/cires_ugwpv1_sporo.F90 | 0 physics/{ => GWD}/cires_ugwpv1_triggers.F90 | 0 physics/{ => GWD}/drag_suite.F90 | 0 physics/{ => GWD}/drag_suite.meta | 2 +- physics/{ => GWD}/gwdc.f | 0 physics/{ => GWD}/gwdc.meta | 2 +- physics/{ => GWD}/gwdc_post.f | 0 physics/{ => GWD}/gwdc_post.meta | 2 +- physics/{ => GWD}/gwdc_pre.f | 0 physics/{ => GWD}/gwdc_pre.meta | 2 +- physics/{ => GWD}/gwdps.f | 0 physics/{ => GWD}/gwdps.meta | 2 +- physics/{ => GWD}/rayleigh_damp.f | 0 physics/{ => GWD}/rayleigh_damp.meta | 2 +- physics/{ => GWD}/ugwp_driver_v0.F | 0 physics/{ => GWD}/ugwpv1_gsldrag.F90 | 0 physics/{ => GWD}/ugwpv1_gsldrag.meta | 2 +- physics/{ => GWD}/ugwpv1_gsldrag_post.F90 | 0 physics/{ => GWD}/ugwpv1_gsldrag_post.meta | 2 +- physics/{ => GWD}/unified_ugwp.F90 | 0 physics/{ => GWD}/unified_ugwp.meta | 8 ++++---- physics/{ => GWD}/unified_ugwp_post.F90 | 0 physics/{ => GWD}/unified_ugwp_post.meta | 2 +- .../{ => Interstitials/GFS}/GFS_DCNV_generic_post.F90 | 0 .../GFS}/GFS_DCNV_generic_post.meta | 2 +- .../{ => Interstitials/GFS}/GFS_DCNV_generic_pre.F90 | 0 .../{ => Interstitials/GFS}/GFS_DCNV_generic_pre.meta | 2 +- .../{ => Interstitials/GFS}/GFS_GWD_generic_post.F90 | 0 .../{ => Interstitials/GFS}/GFS_GWD_generic_post.meta | 2 +- .../{ => Interstitials/GFS}/GFS_GWD_generic_pre.F90 | 0 .../{ => Interstitials/GFS}/GFS_GWD_generic_pre.meta | 2 +- .../{ => Interstitials/GFS}/GFS_MP_generic_post.F90 | 0 .../{ => Interstitials/GFS}/GFS_MP_generic_post.meta | 2 +- .../{ => Interstitials/GFS}/GFS_MP_generic_pre.F90 | 0 .../{ => Interstitials/GFS}/GFS_MP_generic_pre.meta | 2 +- .../GFS}/GFS_PBL_generic_common.F90 | 0 .../{ => Interstitials/GFS}/GFS_PBL_generic_post.F90 | 0 .../{ => Interstitials/GFS}/GFS_PBL_generic_post.meta | 2 +- .../{ => Interstitials/GFS}/GFS_PBL_generic_pre.F90 | 0 .../{ => Interstitials/GFS}/GFS_PBL_generic_pre.meta | 2 +- .../{ => Interstitials/GFS}/GFS_SCNV_generic_post.F90 | 0 .../GFS}/GFS_SCNV_generic_post.meta | 2 +- .../{ => Interstitials/GFS}/GFS_SCNV_generic_pre.F90 | 0 .../{ => Interstitials/GFS}/GFS_SCNV_generic_pre.meta | 2 +- .../{ => Interstitials/GFS}/GFS_cloud_diagnostics.F90 | 0 .../GFS}/GFS_cloud_diagnostics.meta | 3 ++- physics/{ => Interstitials/GFS}/GFS_debug.F90 | 0 physics/{ => Interstitials/GFS}/GFS_debug.meta | 2 +- .../GFS}/GFS_phys_time_vary.fv3.F90 | 0 .../GFS}/GFS_phys_time_vary.fv3.meta | 11 +++++++++-- .../GFS}/GFS_phys_time_vary.scm.F90 | 0 .../GFS}/GFS_phys_time_vary.scm.meta | 11 +++++++++-- .../{ => Interstitials/GFS}/GFS_rad_time_vary.fv3.F90 | 0 .../GFS}/GFS_rad_time_vary.fv3.meta | 3 ++- .../{ => Interstitials/GFS}/GFS_rad_time_vary.scm.F90 | 0 .../GFS}/GFS_rad_time_vary.scm.meta | 3 ++- .../{ => Interstitials/GFS}/GFS_radiation_surface.F90 | 0 .../GFS}/GFS_radiation_surface.meta | 5 ++++- physics/{ => Interstitials/GFS}/GFS_rrtmg_post.F90 | 0 physics/{ => Interstitials/GFS}/GFS_rrtmg_post.meta | 4 +++- physics/{ => Interstitials/GFS}/GFS_rrtmg_pre.F90 | 0 physics/{ => Interstitials/GFS}/GFS_rrtmg_pre.meta | 10 +++++++--- physics/{ => Interstitials/GFS}/GFS_rrtmg_setup.F90 | 0 physics/{ => Interstitials/GFS}/GFS_rrtmg_setup.meta | 8 ++++++-- .../{ => Interstitials/GFS}/GFS_rrtmgp_cloud_mp.F90 | 0 .../{ => Interstitials/GFS}/GFS_rrtmgp_cloud_mp.meta | 5 ++++- .../GFS}/GFS_rrtmgp_cloud_overlap.F90 | 0 .../GFS}/GFS_rrtmgp_cloud_overlap.meta | 4 +++- physics/{ => Interstitials/GFS}/GFS_rrtmgp_post.F90 | 0 physics/{ => Interstitials/GFS}/GFS_rrtmgp_post.meta | 4 +++- physics/{ => Interstitials/GFS}/GFS_rrtmgp_pre.F90 | 1 - physics/{ => Interstitials/GFS}/GFS_rrtmgp_pre.meta | 5 +++-- physics/{ => Interstitials/GFS}/GFS_rrtmgp_setup.F90 | 0 physics/{ => Interstitials/GFS}/GFS_rrtmgp_setup.meta | 6 ++++-- physics/{ => Interstitials/GFS}/GFS_stochastics.F90 | 0 physics/{ => Interstitials/GFS}/GFS_stochastics.meta | 2 +- .../GFS}/GFS_suite_interstitial_1.F90 | 0 .../GFS}/GFS_suite_interstitial_1.meta | 2 +- .../GFS}/GFS_suite_interstitial_2.F90 | 0 .../GFS}/GFS_suite_interstitial_2.meta | 2 +- .../GFS}/GFS_suite_interstitial_3.F90 | 0 .../GFS}/GFS_suite_interstitial_3.meta | 2 +- .../GFS}/GFS_suite_interstitial_4.F90 | 0 .../GFS}/GFS_suite_interstitial_4.meta | 4 +++- .../GFS}/GFS_suite_interstitial_5.F90 | 0 .../GFS}/GFS_suite_interstitial_5.meta | 2 +- .../GFS}/GFS_suite_interstitial_phys_reset.F90 | 0 .../GFS}/GFS_suite_interstitial_phys_reset.meta | 2 +- .../GFS}/GFS_suite_interstitial_rad_reset.F90 | 0 .../GFS}/GFS_suite_interstitial_rad_reset.meta | 2 +- .../GFS}/GFS_suite_stateout_reset.F90 | 0 .../GFS}/GFS_suite_stateout_reset.meta | 2 +- .../GFS}/GFS_suite_stateout_update.F90 | 0 .../GFS}/GFS_suite_stateout_update.meta | 2 +- .../GFS}/GFS_surface_composites_inter.F90 | 0 .../GFS}/GFS_surface_composites_inter.meta | 2 +- .../GFS}/GFS_surface_composites_post.F90 | 0 .../GFS}/GFS_surface_composites_post.meta | 3 ++- .../GFS}/GFS_surface_composites_pre.F90 | 0 .../GFS}/GFS_surface_composites_pre.meta | 2 +- .../GFS}/GFS_surface_generic_post.F90 | 0 .../GFS}/GFS_surface_generic_post.meta | 2 +- .../GFS}/GFS_surface_generic_pre.F90 | 0 .../GFS}/GFS_surface_generic_pre.meta | 3 ++- .../GFS}/GFS_surface_loop_control_part1.F90 | 0 .../GFS}/GFS_surface_loop_control_part1.meta | 2 +- .../GFS}/GFS_surface_loop_control_part2.F90 | 0 .../GFS}/GFS_surface_loop_control_part2.meta | 2 +- .../{ => Interstitials/GFS}/GFS_time_vary_pre.fv3.F90 | 0 .../GFS}/GFS_time_vary_pre.fv3.meta | 3 ++- .../{ => Interstitials/GFS}/GFS_time_vary_pre.scm.F90 | 0 .../GFS}/GFS_time_vary_pre.scm.meta | 3 ++- physics/{ => Interstitials/GFS}/aerinterp.F90 | 0 physics/{ => Interstitials/GFS}/cnvc90.f | 0 physics/{ => Interstitials/GFS}/cnvc90.meta | 2 +- physics/{ => Interstitials/GFS}/dcyc2t3.f | 0 physics/{ => Interstitials/GFS}/dcyc2t3.meta | 2 +- physics/{ => Interstitials/GFS}/gcycle.F90 | 0 physics/{ => Interstitials/GFS}/iccn_def.F | 0 physics/{ => Interstitials/GFS}/iccninterp.F90 | 0 .../GFS}/maximum_hourly_diagnostics.F90 | 0 .../GFS}/maximum_hourly_diagnostics.meta | 2 +- physics/{ => Interstitials/GFS}/phys_tend.F90 | 0 physics/{ => Interstitials/GFS}/phys_tend.meta | 2 +- physics/{ => Interstitials/GFS}/scm_sfc_flux_spec.F90 | 0 .../{ => Interstitials/GFS}/scm_sfc_flux_spec.meta | 2 +- physics/{ => Interstitials/GFS}/sfcsub.F | 0 physics/{ => Interstitials/GFS}/sgscloud_radpost.F90 | 0 physics/{ => Interstitials/GFS}/sgscloud_radpost.meta | 2 +- physics/{ => Interstitials/GFS}/sgscloud_radpre.F90 | 0 physics/{ => Interstitials/GFS}/sgscloud_radpre.meta | 5 ++++- physics/{ => Land/CLM_lake}/clm_lake.f90 | 0 physics/{ => Land/CLM_lake}/clm_lake.meta | 2 +- physics/{ => Land/Flake}/flake.F90 | 0 physics/{ => Land/Flake}/flake_driver.F90 | 0 physics/{ => Land/Flake}/flake_driver.meta | 2 +- physics/{ => Land/Noah}/lsm_noah.f | 0 physics/{ => Land/Noah}/lsm_noah.meta | 3 ++- physics/{ => Land/Noah}/sflx.f | 0 physics/{ => Land/Noah}/surface_perturbation.F90 | 0 .../{ => Land/Noahmp}/module_sf_noahmp_glacier.F90 | 0 physics/{ => Land/Noahmp}/module_sf_noahmplsm.F90 | 0 physics/{ => Land/Noahmp}/noahmp_tables.f90 | 0 physics/{ => Land/Noahmp}/noahmpdrv.F90 | 0 physics/{ => Land/Noahmp}/noahmpdrv.meta | 2 +- physics/{ => Land/Noahmp}/noahmptable.tbl | 0 physics/{ => Land/RUC}/lsm_ruc.F90 | 0 physics/{ => Land/RUC}/lsm_ruc.meta | 2 +- physics/{ => Land/RUC}/module_sf_ruclsm.F90 | 0 physics/{ => Land/RUC}/module_soil_pre.F90 | 0 physics/{ => Land/RUC}/namelist_soilveg_ruc.F90 | 0 physics/{ => Land/RUC}/set_soilveg_ruc.F90 | 0 physics/{ => Land}/namelist_soilveg.f | 0 physics/{ => Land}/set_soilveg.f | 0 .../{ => MP/Ferrier_Aligo}/module_MP_FER_HIRES.F90 | 0 physics/{ => MP/Ferrier_Aligo}/mp_fer_hires.F90 | 0 physics/{ => MP/Ferrier_Aligo}/mp_fer_hires.meta | 2 +- physics/{ => MP/GFDL}/GFDL_parse_tracers.F90 | 0 physics/{ => MP/GFDL}/fv_sat_adj.F90 | 0 physics/{ => MP/GFDL}/fv_sat_adj.meta | 2 +- physics/{ => MP/GFDL}/gfdl_cloud_microphys.F90 | 0 physics/{ => MP/GFDL}/gfdl_cloud_microphys.meta | 2 +- physics/{ => MP/GFDL}/gfdl_sfc_layer.F90 | 0 physics/{ => MP/GFDL}/gfdl_sfc_layer.meta | 2 +- physics/{ => MP/GFDL}/module_gfdl_cloud_microphys.F90 | 0 physics/{ => MP/GFDL}/module_sf_exchcoef.f90 | 0 physics/{ => MP/GFDL}/multi_gases.F90 | 0 physics/{ => MP/Morrison_Gettelman}/aer_cloud.F | 0 physics/{ => MP/Morrison_Gettelman}/aerclm_def.F | 0 physics/{ => MP/Morrison_Gettelman}/cldmacro.F | 0 physics/{ => MP/Morrison_Gettelman}/cldwat2m_micro.F | 0 physics/{ => MP/Morrison_Gettelman}/m_micro.F90 | 0 physics/{ => MP/Morrison_Gettelman}/m_micro.meta | 2 +- physics/{ => MP/Morrison_Gettelman}/m_micro_post.F90 | 0 physics/{ => MP/Morrison_Gettelman}/m_micro_post.meta | 2 +- physics/{ => MP/Morrison_Gettelman}/m_micro_pre.F90 | 0 physics/{ => MP/Morrison_Gettelman}/m_micro_pre.meta | 2 +- physics/{ => MP/Morrison_Gettelman}/micro_mg2_0.F90 | 0 physics/{ => MP/Morrison_Gettelman}/micro_mg3_0.F90 | 0 .../{ => MP/Morrison_Gettelman}/micro_mg_utils.F90 | 0 physics/{ => MP/Morrison_Gettelman}/wv_saturation.F | 0 physics/{ => MP/NSSL}/module_mp_nssl_2mom.F90 | 0 physics/{ => MP/NSSL}/mp_nssl.F90 | 0 physics/{ => MP/NSSL}/mp_nssl.meta | 2 +- physics/{ => MP/Thompson}/module_mp_radar.F90 | 0 physics/{ => MP/Thompson}/module_mp_thompson.F90 | 0 .../module_mp_thompson_make_number_concentrations.F90 | 0 physics/{ => MP/Thompson}/mp_thompson.F90 | 0 physics/{ => MP/Thompson}/mp_thompson.meta | 2 +- physics/{ => MP/Thompson}/mp_thompson_post.F90 | 0 physics/{ => MP/Thompson}/mp_thompson_post.meta | 2 +- physics/{ => MP/Thompson}/mp_thompson_pre.F90 | 0 physics/{ => MP/Thompson}/mp_thompson_pre.meta | 2 +- physics/{ => MP/Zhao_Carr}/zhaocarr_gscond.f | 0 physics/{ => MP/Zhao_Carr}/zhaocarr_gscond.meta | 2 +- physics/{ => MP/Zhao_Carr}/zhaocarr_precpd.f | 0 physics/{ => MP/Zhao_Carr}/zhaocarr_precpd.meta | 2 +- physics/{ => MP}/calpreciptype.f90 | 0 physics/{ => NOTUSED}/gfs_phy_tracer_config.F | 0 physics/{ => NOTUSED}/gocart_tracer_config_stub.f | 0 physics/{ => NOTUSED}/rrtmg_lw_pre.F90 | 0 physics/{ => NOTUSED}/rrtmg_lw_pre.meta | 0 physics/{ => PBL/HEDMF}/hedmf.f | 0 physics/{ => PBL/HEDMF}/hedmf.meta | 2 +- physics/{ => PBL/MYJ}/module_BL_MYJPBL.F90 | 0 physics/{ => PBL/MYJ}/myjpbl_wrapper.F90 | 0 physics/{ => PBL/MYJ}/myjpbl_wrapper.meta | 2 +- physics/{ => PBL/MYNN_EDMF}/bl_mynn_common.f90 | 0 physics/{ => PBL/MYNN_EDMF}/module_bl_mynn.F90 | 0 physics/{ => PBL/MYNN_EDMF}/mynnedmf_wrapper.F90 | 0 physics/{ => PBL/MYNN_EDMF}/mynnedmf_wrapper.meta | 2 +- physics/{ => PBL/SATMEDMF}/mfscu.f | 0 physics/{ => PBL/SATMEDMF}/mfscuq.f | 0 physics/{ => PBL/SATMEDMF}/satmedmfvdif.F | 0 physics/{ => PBL/SATMEDMF}/satmedmfvdif.meta | 2 +- physics/{ => PBL/SATMEDMF}/satmedmfvdifq.F | 0 physics/{ => PBL/SATMEDMF}/satmedmfvdifq.meta | 2 +- physics/{ => PBL/SHOC}/moninshoc.f | 0 physics/{ => PBL/SHOC}/moninshoc.meta | 2 +- physics/{ => PBL/SHOC}/shoc.F90 | 0 physics/{ => PBL/SHOC}/shoc.meta | 2 +- physics/{ => PBL/YSU}/ysuvdif.F90 | 0 physics/{ => PBL/YSU}/ysuvdif.meta | 2 +- physics/{ => PBL}/mfpbl.f | 0 physics/{ => PBL}/mfpblt.f | 0 physics/{ => PBL}/mfpbltq.f | 0 physics/{ => PBL/saYSU}/shinhongvdif.F90 | 0 physics/{ => PBL/saYSU}/shinhongvdif.meta | 2 +- physics/{ => PBL}/tridi.f | 0 physics/{ => Radiation/RRTMG}/iounitdef.f | 0 physics/{ => Radiation/RRTMG}/module_bfmicrophysics.f | 0 physics/{ => Radiation/RRTMG}/rad_sw_pre.F90 | 0 physics/{ => Radiation/RRTMG}/rad_sw_pre.meta | 2 +- physics/{ => Radiation/RRTMG}/radcons.f90 | 0 physics/{ => Radiation/RRTMG}/radlw_datatb.f | 0 physics/{ => Radiation/RRTMG}/radlw_main.F90 | 0 physics/{ => Radiation/RRTMG}/radlw_main.meta | 2 +- physics/{ => Radiation/RRTMG}/radlw_param.f | 0 physics/{ => Radiation/RRTMG}/radlw_param.meta | 0 physics/{ => Radiation/RRTMG}/radsw_datatb.f | 0 physics/{ => Radiation/RRTMG}/radsw_main.F90 | 0 physics/{ => Radiation/RRTMG}/radsw_main.meta | 2 +- physics/{ => Radiation/RRTMG}/radsw_param.f | 0 physics/{ => Radiation/RRTMG}/radsw_param.meta | 0 .../{ => Radiation/RRTMG}/rrtmg_lw_cloud_optics.F90 | 0 physics/{ => Radiation/RRTMG}/rrtmg_lw_post.F90 | 0 physics/{ => Radiation/RRTMG}/rrtmg_lw_post.meta | 2 +- .../{ => Radiation/RRTMG}/rrtmg_sw_cloud_optics.F90 | 0 physics/{ => Radiation/RRTMG}/rrtmg_sw_post.F90 | 0 physics/{ => Radiation/RRTMG}/rrtmg_sw_post.meta | 2 +- .../{ => Radiation/RRTMGP}/rrtmgp_aerosol_optics.F90 | 0 .../{ => Radiation/RRTMGP}/rrtmgp_aerosol_optics.meta | 2 +- .../{ => Radiation/RRTMGP}/rrtmgp_lw_cloud_optics.F90 | 0 .../{ => Radiation/RRTMGP}/rrtmgp_lw_gas_optics.F90 | 0 physics/{ => Radiation/RRTMGP}/rrtmgp_lw_main.F90 | 0 physics/{ => Radiation/RRTMGP}/rrtmgp_lw_main.meta | 7 ++++--- physics/{ => Radiation/RRTMGP}/rrtmgp_sampling.F90 | 0 .../{ => Radiation/RRTMGP}/rrtmgp_sw_cloud_optics.F90 | 0 .../{ => Radiation/RRTMGP}/rrtmgp_sw_gas_optics.F90 | 0 physics/{ => Radiation/RRTMGP}/rrtmgp_sw_main.F90 | 0 physics/{ => Radiation/RRTMGP}/rrtmgp_sw_main.meta | 7 ++++--- physics/{ => Radiation}/mersenne_twister.f | 0 physics/{ => Radiation}/radiation_aerosols.f | 0 physics/{ => Radiation}/radiation_astronomy.f | 0 physics/{ => Radiation}/radiation_cloud_overlap.F90 | 0 physics/{ => Radiation}/radiation_clouds.f | 0 physics/{ => Radiation}/radiation_gases.f | 0 physics/{ => Radiation}/radiation_surface.f | 0 physics/{ => Radiation}/radiation_tools.F90 | 0 physics/{ => SFC_Layer/GFS_sfc}/date_def.f | 0 physics/{ => SFC_Layer/GFS_sfc}/module_nst_model.f90 | 0 .../{ => SFC_Layer/GFS_sfc}/module_nst_parameters.f90 | 0 .../{ => SFC_Layer/GFS_sfc}/module_nst_water_prop.f90 | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_cice.f | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_cice.meta | 3 ++- physics/{ => SFC_Layer/GFS_sfc}/sfc_diag.f | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_diag.meta | 3 ++- physics/{ => SFC_Layer/GFS_sfc}/sfc_diag_post.F90 | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_diag_post.meta | 3 ++- physics/{ => SFC_Layer/GFS_sfc}/sfc_diff.f | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_diff.meta | 3 ++- physics/{ => SFC_Layer/GFS_sfc}/sfc_nst.f | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_nst.meta | 2 +- physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_post.f | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_post.meta | 2 +- physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_pre.f | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_pre.meta | 2 +- physics/{ => SFC_Layer/GFS_sfc}/sfc_ocean.F | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_ocean.meta | 2 +- physics/{ => SFC_Layer/GFS_sfc}/sfc_sice.f | 0 physics/{ => SFC_Layer/GFS_sfc}/sfc_sice.meta | 3 ++- physics/{ => SFC_Layer/MYJ}/module_SF_JSFC.F90 | 0 physics/{ => SFC_Layer/MYJ}/myjsfc_wrapper.F90 | 0 physics/{ => SFC_Layer/MYJ}/myjsfc_wrapper.meta | 2 +- physics/{ => SFC_Layer/MYNN}/module_sf_mynn.F90 | 0 physics/{ => SFC_Layer/MYNN}/mynnsfc_wrapper.F90 | 0 physics/{ => SFC_Layer/MYNN}/mynnsfc_wrapper.meta | 2 +- physics/{ => h2o_photo}/h2o_def.f | 0 physics/{ => h2o_photo}/h2o_def.meta | 2 +- physics/{ => h2o_photo}/h2ointerp.f90 | 0 physics/{ => h2o_photo}/h2ophys.f | 0 physics/{ => h2o_photo}/h2ophys.meta | 2 +- physics/{ => hooks}/machine.F | 0 physics/{ => hooks}/machine.meta | 0 physics/{ => hooks}/physcons.F90 | 0 physics/{ => o3_photo}/ozinterp.f90 | 0 physics/{ => o3_photo}/ozne_def.f | 0 physics/{ => o3_photo}/ozne_def.meta | 2 +- physics/{ => o3_photo}/ozphys.f | 0 physics/{ => o3_photo}/ozphys.meta | 2 +- physics/{ => o3_photo}/ozphys_2015.f | 0 physics/{ => o3_photo}/ozphys_2015.meta | 2 +- physics/rte-rrtmgp | 1 - physics/smoke_dust/rrfs_smoke_postpbl.meta | 2 +- physics/smoke_dust/rrfs_smoke_wrapper.meta | 2 +- physics/{ => tools}/funcphys.f90 | 0 physics/{ => tools}/get_phi_fv3.F90 | 0 physics/{ => tools}/get_phi_fv3.meta | 2 +- physics/{ => tools}/get_prs_fv3.F90 | 0 physics/{ => tools}/get_prs_fv3.meta | 2 +- 376 files changed, 208 insertions(+), 153 deletions(-) rename physics/{ => CONV/CCC}/cu_c3_deep.F90 (100%) rename physics/{ => CONV/CCC}/cu_c3_driver.F90 (100%) rename physics/{ => CONV/CCC}/cu_c3_driver.meta (99%) rename physics/{ => CONV/CCC}/cu_c3_driver_post.F90 (100%) rename physics/{ => CONV/CCC}/cu_c3_driver_post.meta (98%) rename physics/{ => CONV/CCC}/cu_c3_driver_pre.F90 (100%) rename physics/{ => CONV/CCC}/cu_c3_driver_pre.meta (98%) rename physics/{ => CONV/CCC}/cu_c3_sh.F90 (100%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv.F90 (100%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv.meta (99%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv_aw_adj.F90 (100%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv_aw_adj.meta (99%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv_post.F90 (100%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv_post.meta (97%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv_pre.F90 (100%) rename physics/{ => CONV/Chikira_Sugiyama}/cs_conv_pre.meta (99%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_deep.F90 (100%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_driver.F90 (100%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_driver.meta (99%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_driver_post.F90 (100%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_driver_post.meta (98%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_driver_pre.F90 (100%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_driver_pre.meta (98%) rename physics/{ => CONV/Grell_Freitas}/cu_gf_sh.F90 (100%) rename physics/{ => CONV/RAS}/rascnv.F90 (100%) rename physics/{ => CONV/RAS}/rascnv.meta (99%) rename physics/{ => CONV/SAMF}/samfaerosols.F (100%) rename physics/{ => CONV/SAMF}/samfdeepcnv.f (100%) rename physics/{ => CONV/SAMF}/samfdeepcnv.meta (99%) rename physics/{ => CONV/SAMF}/samfshalcnv.f (100%) rename physics/{ => CONV/SAMF}/samfshalcnv.meta (99%) rename physics/{ => CONV/SAS}/sascnvn.F (100%) rename physics/{ => CONV/SAS}/sascnvn.meta (99%) rename physics/{ => CONV/SAS}/shalcnv.F (100%) rename physics/{ => CONV/SAS}/shalcnv.meta (99%) rename physics/{ => CONV/nTiedtke}/cu_ntiedtke.F90 (100%) rename physics/{ => CONV/nTiedtke}/cu_ntiedtke.meta (99%) rename physics/{ => CONV/nTiedtke}/cu_ntiedtke_post.F90 (100%) rename physics/{ => CONV/nTiedtke}/cu_ntiedtke_post.meta (97%) rename physics/{ => CONV/nTiedtke}/cu_ntiedtke_pre.F90 (100%) rename physics/{ => CONV/nTiedtke}/cu_ntiedtke_pre.meta (98%) rename physics/{ => CONV}/progsigma_calc.f90 (100%) rename physics/{ => GWD}/cires_orowam2017.f (100%) rename physics/{ => GWD}/cires_tauamf_data.F90 (100%) rename physics/{ => GWD}/cires_ugwp.F90 (100%) rename physics/{ => GWD}/cires_ugwp.meta (99%) rename physics/{ => GWD}/cires_ugwp_initialize.F90 (100%) rename physics/{ => GWD}/cires_ugwp_module.F90 (100%) rename physics/{ => GWD}/cires_ugwp_post.F90 (100%) rename physics/{ => GWD}/cires_ugwp_post.meta (99%) rename physics/{ => GWD}/cires_ugwp_triggers.F90 (100%) rename physics/{ => GWD}/cires_ugwpv1_initialize.F90 (100%) rename physics/{ => GWD}/cires_ugwpv1_module.F90 (100%) rename physics/{ => GWD}/cires_ugwpv1_oro.F90 (100%) rename physics/{ => GWD}/cires_ugwpv1_solv2.F90 (100%) rename physics/{ => GWD}/cires_ugwpv1_sporo.F90 (100%) rename physics/{ => GWD}/cires_ugwpv1_triggers.F90 (100%) rename physics/{ => GWD}/drag_suite.F90 (100%) rename physics/{ => GWD}/drag_suite.meta (99%) rename physics/{ => GWD}/gwdc.f (100%) rename physics/{ => GWD}/gwdc.meta (99%) rename physics/{ => GWD}/gwdc_post.f (100%) rename physics/{ => GWD}/gwdc_post.meta (99%) rename physics/{ => GWD}/gwdc_pre.f (100%) rename physics/{ => GWD}/gwdc_pre.meta (99%) rename physics/{ => GWD}/gwdps.f (100%) rename physics/{ => GWD}/gwdps.meta (99%) rename physics/{ => GWD}/rayleigh_damp.f (100%) rename physics/{ => GWD}/rayleigh_damp.meta (99%) rename physics/{ => GWD}/ugwp_driver_v0.F (100%) rename physics/{ => GWD}/ugwpv1_gsldrag.F90 (100%) rename physics/{ => GWD}/ugwpv1_gsldrag.meta (99%) rename physics/{ => GWD}/ugwpv1_gsldrag_post.F90 (100%) rename physics/{ => GWD}/ugwpv1_gsldrag_post.meta (99%) rename physics/{ => GWD}/unified_ugwp.F90 (100%) rename physics/{ => GWD}/unified_ugwp.meta (99%) rename physics/{ => GWD}/unified_ugwp_post.F90 (100%) rename physics/{ => GWD}/unified_ugwp_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_DCNV_generic_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_DCNV_generic_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_DCNV_generic_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_DCNV_generic_pre.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_GWD_generic_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_GWD_generic_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_GWD_generic_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_GWD_generic_pre.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_MP_generic_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_MP_generic_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_MP_generic_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_MP_generic_pre.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_PBL_generic_common.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_PBL_generic_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_PBL_generic_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_PBL_generic_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_PBL_generic_pre.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_SCNV_generic_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_SCNV_generic_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_SCNV_generic_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_SCNV_generic_pre.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_cloud_diagnostics.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_cloud_diagnostics.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_debug.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_debug.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_phys_time_vary.fv3.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_phys_time_vary.fv3.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_phys_time_vary.scm.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_phys_time_vary.scm.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rad_time_vary.fv3.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rad_time_vary.fv3.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rad_time_vary.scm.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rad_time_vary.scm.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_radiation_surface.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_radiation_surface.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rrtmg_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rrtmg_post.meta (97%) rename physics/{ => Interstitials/GFS}/GFS_rrtmg_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rrtmg_pre.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rrtmg_setup.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rrtmg_setup.meta (97%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_cloud_mp.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_cloud_mp.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_cloud_overlap.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_cloud_overlap.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_post.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_pre.F90 (99%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_pre.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_setup.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_rrtmgp_setup.meta (97%) rename physics/{ => Interstitials/GFS}/GFS_stochastics.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_stochastics.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_1.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_1.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_2.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_2.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_3.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_3.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_4.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_4.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_5.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_5.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_phys_reset.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_phys_reset.meta (96%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_rad_reset.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_interstitial_rad_reset.meta (96%) rename physics/{ => Interstitials/GFS}/GFS_suite_stateout_reset.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_stateout_reset.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_suite_stateout_update.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_suite_stateout_update.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_surface_composites_inter.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_surface_composites_inter.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_surface_composites_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_surface_composites_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_surface_composites_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_surface_composites_pre.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_surface_generic_post.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_surface_generic_post.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_surface_generic_pre.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_surface_generic_pre.meta (99%) rename physics/{ => Interstitials/GFS}/GFS_surface_loop_control_part1.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_surface_loop_control_part1.meta (97%) rename physics/{ => Interstitials/GFS}/GFS_surface_loop_control_part2.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_surface_loop_control_part2.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_time_vary_pre.fv3.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_time_vary_pre.fv3.meta (98%) rename physics/{ => Interstitials/GFS}/GFS_time_vary_pre.scm.F90 (100%) rename physics/{ => Interstitials/GFS}/GFS_time_vary_pre.scm.meta (98%) rename physics/{ => Interstitials/GFS}/aerinterp.F90 (100%) rename physics/{ => Interstitials/GFS}/cnvc90.f (100%) rename physics/{ => Interstitials/GFS}/cnvc90.meta (98%) rename physics/{ => Interstitials/GFS}/dcyc2t3.f (100%) rename physics/{ => Interstitials/GFS}/dcyc2t3.meta (99%) rename physics/{ => Interstitials/GFS}/gcycle.F90 (100%) rename physics/{ => Interstitials/GFS}/iccn_def.F (100%) rename physics/{ => Interstitials/GFS}/iccninterp.F90 (100%) rename physics/{ => Interstitials/GFS}/maximum_hourly_diagnostics.F90 (100%) rename physics/{ => Interstitials/GFS}/maximum_hourly_diagnostics.meta (99%) rename physics/{ => Interstitials/GFS}/phys_tend.F90 (100%) rename physics/{ => Interstitials/GFS}/phys_tend.meta (98%) rename physics/{ => Interstitials/GFS}/scm_sfc_flux_spec.F90 (100%) rename physics/{ => Interstitials/GFS}/scm_sfc_flux_spec.meta (99%) rename physics/{ => Interstitials/GFS}/sfcsub.F (100%) rename physics/{ => Interstitials/GFS}/sgscloud_radpost.F90 (100%) rename physics/{ => Interstitials/GFS}/sgscloud_radpost.meta (98%) rename physics/{ => Interstitials/GFS}/sgscloud_radpre.F90 (100%) rename physics/{ => Interstitials/GFS}/sgscloud_radpre.meta (98%) rename physics/{ => Land/CLM_lake}/clm_lake.f90 (100%) rename physics/{ => Land/CLM_lake}/clm_lake.meta (99%) rename physics/{ => Land/Flake}/flake.F90 (100%) rename physics/{ => Land/Flake}/flake_driver.F90 (100%) rename physics/{ => Land/Flake}/flake_driver.meta (99%) rename physics/{ => Land/Noah}/lsm_noah.f (100%) rename physics/{ => Land/Noah}/lsm_noah.meta (99%) rename physics/{ => Land/Noah}/sflx.f (100%) rename physics/{ => Land/Noah}/surface_perturbation.F90 (100%) rename physics/{ => Land/Noahmp}/module_sf_noahmp_glacier.F90 (100%) rename physics/{ => Land/Noahmp}/module_sf_noahmplsm.F90 (100%) rename physics/{ => Land/Noahmp}/noahmp_tables.f90 (100%) rename physics/{ => Land/Noahmp}/noahmpdrv.F90 (100%) rename physics/{ => Land/Noahmp}/noahmpdrv.meta (99%) rename physics/{ => Land/Noahmp}/noahmptable.tbl (100%) rename physics/{ => Land/RUC}/lsm_ruc.F90 (100%) rename physics/{ => Land/RUC}/lsm_ruc.meta (99%) rename physics/{ => Land/RUC}/module_sf_ruclsm.F90 (100%) rename physics/{ => Land/RUC}/module_soil_pre.F90 (100%) rename physics/{ => Land/RUC}/namelist_soilveg_ruc.F90 (100%) rename physics/{ => Land/RUC}/set_soilveg_ruc.F90 (100%) rename physics/{ => Land}/namelist_soilveg.f (100%) rename physics/{ => Land}/set_soilveg.f (100%) rename physics/{ => MP/Ferrier_Aligo}/module_MP_FER_HIRES.F90 (100%) rename physics/{ => MP/Ferrier_Aligo}/mp_fer_hires.F90 (100%) rename physics/{ => MP/Ferrier_Aligo}/mp_fer_hires.meta (99%) rename physics/{ => MP/GFDL}/GFDL_parse_tracers.F90 (100%) rename physics/{ => MP/GFDL}/fv_sat_adj.F90 (100%) rename physics/{ => MP/GFDL}/fv_sat_adj.meta (99%) rename physics/{ => MP/GFDL}/gfdl_cloud_microphys.F90 (100%) rename physics/{ => MP/GFDL}/gfdl_cloud_microphys.meta (99%) rename physics/{ => MP/GFDL}/gfdl_sfc_layer.F90 (100%) rename physics/{ => MP/GFDL}/gfdl_sfc_layer.meta (99%) rename physics/{ => MP/GFDL}/module_gfdl_cloud_microphys.F90 (100%) rename physics/{ => MP/GFDL}/module_sf_exchcoef.f90 (100%) rename physics/{ => MP/GFDL}/multi_gases.F90 (100%) rename physics/{ => MP/Morrison_Gettelman}/aer_cloud.F (100%) rename physics/{ => MP/Morrison_Gettelman}/aerclm_def.F (100%) rename physics/{ => MP/Morrison_Gettelman}/cldmacro.F (100%) rename physics/{ => MP/Morrison_Gettelman}/cldwat2m_micro.F (100%) rename physics/{ => MP/Morrison_Gettelman}/m_micro.F90 (100%) rename physics/{ => MP/Morrison_Gettelman}/m_micro.meta (99%) rename physics/{ => MP/Morrison_Gettelman}/m_micro_post.F90 (100%) rename physics/{ => MP/Morrison_Gettelman}/m_micro_post.meta (99%) rename physics/{ => MP/Morrison_Gettelman}/m_micro_pre.F90 (100%) rename physics/{ => MP/Morrison_Gettelman}/m_micro_pre.meta (99%) rename physics/{ => MP/Morrison_Gettelman}/micro_mg2_0.F90 (100%) rename physics/{ => MP/Morrison_Gettelman}/micro_mg3_0.F90 (100%) rename physics/{ => MP/Morrison_Gettelman}/micro_mg_utils.F90 (100%) rename physics/{ => MP/Morrison_Gettelman}/wv_saturation.F (100%) rename physics/{ => MP/NSSL}/module_mp_nssl_2mom.F90 (100%) rename physics/{ => MP/NSSL}/mp_nssl.F90 (100%) rename physics/{ => MP/NSSL}/mp_nssl.meta (99%) rename physics/{ => MP/Thompson}/module_mp_radar.F90 (100%) rename physics/{ => MP/Thompson}/module_mp_thompson.F90 (100%) rename physics/{ => MP/Thompson}/module_mp_thompson_make_number_concentrations.F90 (100%) rename physics/{ => MP/Thompson}/mp_thompson.F90 (100%) rename physics/{ => MP/Thompson}/mp_thompson.meta (99%) rename physics/{ => MP/Thompson}/mp_thompson_post.F90 (100%) rename physics/{ => MP/Thompson}/mp_thompson_post.meta (98%) rename physics/{ => MP/Thompson}/mp_thompson_pre.F90 (100%) rename physics/{ => MP/Thompson}/mp_thompson_pre.meta (97%) rename physics/{ => MP/Zhao_Carr}/zhaocarr_gscond.f (100%) rename physics/{ => MP/Zhao_Carr}/zhaocarr_gscond.meta (98%) rename physics/{ => MP/Zhao_Carr}/zhaocarr_precpd.f (100%) rename physics/{ => MP/Zhao_Carr}/zhaocarr_precpd.meta (98%) rename physics/{ => MP}/calpreciptype.f90 (100%) rename physics/{ => NOTUSED}/gfs_phy_tracer_config.F (100%) rename physics/{ => NOTUSED}/gocart_tracer_config_stub.f (100%) rename physics/{ => NOTUSED}/rrtmg_lw_pre.F90 (100%) rename physics/{ => NOTUSED}/rrtmg_lw_pre.meta (100%) rename physics/{ => PBL/HEDMF}/hedmf.f (100%) rename physics/{ => PBL/HEDMF}/hedmf.meta (99%) rename physics/{ => PBL/MYJ}/module_BL_MYJPBL.F90 (100%) rename physics/{ => PBL/MYJ}/myjpbl_wrapper.F90 (100%) rename physics/{ => PBL/MYJ}/myjpbl_wrapper.meta (99%) rename physics/{ => PBL/MYNN_EDMF}/bl_mynn_common.f90 (100%) rename physics/{ => PBL/MYNN_EDMF}/module_bl_mynn.F90 (100%) rename physics/{ => PBL/MYNN_EDMF}/mynnedmf_wrapper.F90 (100%) rename physics/{ => PBL/MYNN_EDMF}/mynnedmf_wrapper.meta (99%) rename physics/{ => PBL/SATMEDMF}/mfscu.f (100%) rename physics/{ => PBL/SATMEDMF}/mfscuq.f (100%) rename physics/{ => PBL/SATMEDMF}/satmedmfvdif.F (100%) rename physics/{ => PBL/SATMEDMF}/satmedmfvdif.meta (99%) rename physics/{ => PBL/SATMEDMF}/satmedmfvdifq.F (100%) rename physics/{ => PBL/SATMEDMF}/satmedmfvdifq.meta (99%) rename physics/{ => PBL/SHOC}/moninshoc.f (100%) rename physics/{ => PBL/SHOC}/moninshoc.meta (99%) rename physics/{ => PBL/SHOC}/shoc.F90 (100%) rename physics/{ => PBL/SHOC}/shoc.meta (99%) rename physics/{ => PBL/YSU}/ysuvdif.F90 (100%) rename physics/{ => PBL/YSU}/ysuvdif.meta (99%) rename physics/{ => PBL}/mfpbl.f (100%) rename physics/{ => PBL}/mfpblt.f (100%) rename physics/{ => PBL}/mfpbltq.f (100%) rename physics/{ => PBL/saYSU}/shinhongvdif.F90 (100%) rename physics/{ => PBL/saYSU}/shinhongvdif.meta (99%) rename physics/{ => PBL}/tridi.f (100%) rename physics/{ => Radiation/RRTMG}/iounitdef.f (100%) rename physics/{ => Radiation/RRTMG}/module_bfmicrophysics.f (100%) rename physics/{ => Radiation/RRTMG}/rad_sw_pre.F90 (100%) rename physics/{ => Radiation/RRTMG}/rad_sw_pre.meta (96%) rename physics/{ => Radiation/RRTMG}/radcons.f90 (100%) rename physics/{ => Radiation/RRTMG}/radlw_datatb.f (100%) rename physics/{ => Radiation/RRTMG}/radlw_main.F90 (100%) rename physics/{ => Radiation/RRTMG}/radlw_main.meta (99%) rename physics/{ => Radiation/RRTMG}/radlw_param.f (100%) rename physics/{ => Radiation/RRTMG}/radlw_param.meta (100%) rename physics/{ => Radiation/RRTMG}/radsw_datatb.f (100%) rename physics/{ => Radiation/RRTMG}/radsw_main.F90 (100%) rename physics/{ => Radiation/RRTMG}/radsw_main.meta (99%) rename physics/{ => Radiation/RRTMG}/radsw_param.f (100%) rename physics/{ => Radiation/RRTMG}/radsw_param.meta (100%) rename physics/{ => Radiation/RRTMG}/rrtmg_lw_cloud_optics.F90 (100%) rename physics/{ => Radiation/RRTMG}/rrtmg_lw_post.F90 (100%) rename physics/{ => Radiation/RRTMG}/rrtmg_lw_post.meta (99%) rename physics/{ => Radiation/RRTMG}/rrtmg_sw_cloud_optics.F90 (100%) rename physics/{ => Radiation/RRTMG}/rrtmg_sw_post.F90 (100%) rename physics/{ => Radiation/RRTMG}/rrtmg_sw_post.meta (99%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_aerosol_optics.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_aerosol_optics.meta (98%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_lw_cloud_optics.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_lw_gas_optics.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_lw_main.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_lw_main.meta (98%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_sampling.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_sw_cloud_optics.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_sw_gas_optics.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_sw_main.F90 (100%) rename physics/{ => Radiation/RRTMGP}/rrtmgp_sw_main.meta (98%) rename physics/{ => Radiation}/mersenne_twister.f (100%) rename physics/{ => Radiation}/radiation_aerosols.f (100%) rename physics/{ => Radiation}/radiation_astronomy.f (100%) rename physics/{ => Radiation}/radiation_cloud_overlap.F90 (100%) rename physics/{ => Radiation}/radiation_clouds.f (100%) rename physics/{ => Radiation}/radiation_gases.f (100%) rename physics/{ => Radiation}/radiation_surface.f (100%) rename physics/{ => Radiation}/radiation_tools.F90 (100%) rename physics/{ => SFC_Layer/GFS_sfc}/date_def.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/module_nst_model.f90 (100%) rename physics/{ => SFC_Layer/GFS_sfc}/module_nst_parameters.f90 (100%) rename physics/{ => SFC_Layer/GFS_sfc}/module_nst_water_prop.f90 (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_cice.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_cice.meta (99%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_diag.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_diag.meta (99%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_diag_post.F90 (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_diag_post.meta (98%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_diff.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_diff.meta (99%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_nst.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_nst.meta (99%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_post.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_post.meta (98%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_pre.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_nst_pre.meta (97%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_ocean.F (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_ocean.meta (99%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_sice.f (100%) rename physics/{ => SFC_Layer/GFS_sfc}/sfc_sice.meta (99%) rename physics/{ => SFC_Layer/MYJ}/module_SF_JSFC.F90 (100%) rename physics/{ => SFC_Layer/MYJ}/myjsfc_wrapper.F90 (100%) rename physics/{ => SFC_Layer/MYJ}/myjsfc_wrapper.meta (99%) rename physics/{ => SFC_Layer/MYNN}/module_sf_mynn.F90 (100%) rename physics/{ => SFC_Layer/MYNN}/mynnsfc_wrapper.F90 (100%) rename physics/{ => SFC_Layer/MYNN}/mynnsfc_wrapper.meta (99%) rename physics/{ => h2o_photo}/h2o_def.f (100%) rename physics/{ => h2o_photo}/h2o_def.meta (94%) rename physics/{ => h2o_photo}/h2ointerp.f90 (100%) rename physics/{ => h2o_photo}/h2ophys.f (100%) rename physics/{ => h2o_photo}/h2ophys.meta (98%) rename physics/{ => hooks}/machine.F (100%) rename physics/{ => hooks}/machine.meta (100%) rename physics/{ => hooks}/physcons.F90 (100%) rename physics/{ => o3_photo}/ozinterp.f90 (100%) rename physics/{ => o3_photo}/ozne_def.f (100%) rename physics/{ => o3_photo}/ozne_def.meta (95%) rename physics/{ => o3_photo}/ozphys.f (100%) rename physics/{ => o3_photo}/ozphys.meta (99%) rename physics/{ => o3_photo}/ozphys_2015.f (100%) rename physics/{ => o3_photo}/ozphys_2015.meta (99%) delete mode 160000 physics/rte-rrtmgp rename physics/{ => tools}/funcphys.f90 (100%) rename physics/{ => tools}/get_phi_fv3.F90 (100%) rename physics/{ => tools}/get_phi_fv3.meta (97%) rename physics/{ => tools}/get_prs_fv3.F90 (100%) rename physics/{ => tools}/get_prs_fv3.meta (98%) diff --git a/.gitmodules b/.gitmodules index 8758980ec..c82541c5b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +1,4 @@ [submodule "physics/rte-rrtmgp"] - path = physics/rte-rrtmgp + path = physics/Radiation/RRTMGP/rte-rrtmgp url = https://github.com/earth-system-radiation/rte-rrtmgp branch = main diff --git a/physics/cu_c3_deep.F90 b/physics/CONV/CCC/cu_c3_deep.F90 similarity index 100% rename from physics/cu_c3_deep.F90 rename to physics/CONV/CCC/cu_c3_deep.F90 diff --git a/physics/cu_c3_driver.F90 b/physics/CONV/CCC/cu_c3_driver.F90 similarity index 100% rename from physics/cu_c3_driver.F90 rename to physics/CONV/CCC/cu_c3_driver.F90 diff --git a/physics/cu_c3_driver.meta b/physics/CONV/CCC/cu_c3_driver.meta similarity index 99% rename from physics/cu_c3_driver.meta rename to physics/CONV/CCC/cu_c3_driver.meta index 999b5c2bc..bb2784642 100644 --- a/physics/cu_c3_driver.meta +++ b/physics/CONV/CCC/cu_c3_driver.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_c3_driver type = scheme - dependencies = cu_c3_deep.F90,cu_c3_sh.F90,machine.F,physcons.F90,progsigma_calc.f90 + dependencies = cu_c3_deep.F90,cu_c3_sh.F90,../../hooks/machine.F,../../hooks/physcons.F90,../progsigma_calc.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_c3_driver_post.F90 b/physics/CONV/CCC/cu_c3_driver_post.F90 similarity index 100% rename from physics/cu_c3_driver_post.F90 rename to physics/CONV/CCC/cu_c3_driver_post.F90 diff --git a/physics/cu_c3_driver_post.meta b/physics/CONV/CCC/cu_c3_driver_post.meta similarity index 98% rename from physics/cu_c3_driver_post.meta rename to physics/CONV/CCC/cu_c3_driver_post.meta index c53972f09..78dca2ed4 100644 --- a/physics/cu_c3_driver_post.meta +++ b/physics/CONV/CCC/cu_c3_driver_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_c3_driver_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_c3_driver_pre.F90 b/physics/CONV/CCC/cu_c3_driver_pre.F90 similarity index 100% rename from physics/cu_c3_driver_pre.F90 rename to physics/CONV/CCC/cu_c3_driver_pre.F90 diff --git a/physics/cu_c3_driver_pre.meta b/physics/CONV/CCC/cu_c3_driver_pre.meta similarity index 98% rename from physics/cu_c3_driver_pre.meta rename to physics/CONV/CCC/cu_c3_driver_pre.meta index c018bee9f..a022cf743 100644 --- a/physics/cu_c3_driver_pre.meta +++ b/physics/CONV/CCC/cu_c3_driver_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_c3_driver_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_c3_sh.F90 b/physics/CONV/CCC/cu_c3_sh.F90 similarity index 100% rename from physics/cu_c3_sh.F90 rename to physics/CONV/CCC/cu_c3_sh.F90 diff --git a/physics/cs_conv.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 similarity index 100% rename from physics/cs_conv.F90 rename to physics/CONV/Chikira_Sugiyama/cs_conv.F90 diff --git a/physics/cs_conv.meta b/physics/CONV/Chikira_Sugiyama/cs_conv.meta similarity index 99% rename from physics/cs_conv.meta rename to physics/CONV/Chikira_Sugiyama/cs_conv.meta index fae1c91fe..49e460ed6 100644 --- a/physics/cs_conv.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = cs_conv type = scheme - dependencies = funcphys.f90,machine.F,physcons.F90 + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,../../hooks/physcons.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/cs_conv_aw_adj.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 similarity index 100% rename from physics/cs_conv_aw_adj.F90 rename to physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.F90 diff --git a/physics/cs_conv_aw_adj.meta b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta similarity index 99% rename from physics/cs_conv_aw_adj.meta rename to physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta index 0dada0fd5..54350dbac 100644 --- a/physics/cs_conv_aw_adj.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cs_conv_aw_adj type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cs_conv_post.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv_post.F90 similarity index 100% rename from physics/cs_conv_post.F90 rename to physics/CONV/Chikira_Sugiyama/cs_conv_post.F90 diff --git a/physics/cs_conv_post.meta b/physics/CONV/Chikira_Sugiyama/cs_conv_post.meta similarity index 97% rename from physics/cs_conv_post.meta rename to physics/CONV/Chikira_Sugiyama/cs_conv_post.meta index 116ffbef4..75de3fca7 100644 --- a/physics/cs_conv_post.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = cs_conv_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cs_conv_pre.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv_pre.F90 similarity index 100% rename from physics/cs_conv_pre.F90 rename to physics/CONV/Chikira_Sugiyama/cs_conv_pre.F90 diff --git a/physics/cs_conv_pre.meta b/physics/CONV/Chikira_Sugiyama/cs_conv_pre.meta similarity index 99% rename from physics/cs_conv_pre.meta rename to physics/CONV/Chikira_Sugiyama/cs_conv_pre.meta index 2decd5f8b..7ce80496b 100644 --- a/physics/cs_conv_pre.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cs_conv_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_gf_deep.F90 b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 similarity index 100% rename from physics/cu_gf_deep.F90 rename to physics/CONV/Grell_Freitas/cu_gf_deep.F90 diff --git a/physics/cu_gf_driver.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver.F90 similarity index 100% rename from physics/cu_gf_driver.F90 rename to physics/CONV/Grell_Freitas/cu_gf_driver.F90 diff --git a/physics/cu_gf_driver.meta b/physics/CONV/Grell_Freitas/cu_gf_driver.meta similarity index 99% rename from physics/cu_gf_driver.meta rename to physics/CONV/Grell_Freitas/cu_gf_driver.meta index 8b1a46e2d..d5324f05a 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_gf_driver type = scheme - dependencies = cu_gf_deep.F90,cu_gf_sh.F90,machine.F,physcons.F90 + dependencies = cu_gf_deep.F90,cu_gf_sh.F90,../../hooks/machine.F,../../hooks/physcons.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_gf_driver_post.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver_post.F90 similarity index 100% rename from physics/cu_gf_driver_post.F90 rename to physics/CONV/Grell_Freitas/cu_gf_driver_post.F90 diff --git a/physics/cu_gf_driver_post.meta b/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta similarity index 98% rename from physics/cu_gf_driver_post.meta rename to physics/CONV/Grell_Freitas/cu_gf_driver_post.meta index 48e762cb4..fe2308b1b 100644 --- a/physics/cu_gf_driver_post.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_gf_driver_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_gf_driver_pre.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90 similarity index 100% rename from physics/cu_gf_driver_pre.F90 rename to physics/CONV/Grell_Freitas/cu_gf_driver_pre.F90 diff --git a/physics/cu_gf_driver_pre.meta b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta similarity index 98% rename from physics/cu_gf_driver_pre.meta rename to physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta index 7fd66d19b..5139cae6d 100644 --- a/physics/cu_gf_driver_pre.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_gf_driver_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_gf_sh.F90 b/physics/CONV/Grell_Freitas/cu_gf_sh.F90 similarity index 100% rename from physics/cu_gf_sh.F90 rename to physics/CONV/Grell_Freitas/cu_gf_sh.F90 diff --git a/physics/rascnv.F90 b/physics/CONV/RAS/rascnv.F90 similarity index 100% rename from physics/rascnv.F90 rename to physics/CONV/RAS/rascnv.F90 diff --git a/physics/rascnv.meta b/physics/CONV/RAS/rascnv.meta similarity index 99% rename from physics/rascnv.meta rename to physics/CONV/RAS/rascnv.meta index 5285c830f..f5a707ded 100644 --- a/physics/rascnv.meta +++ b/physics/CONV/RAS/rascnv.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rascnv type = scheme - dependencies = funcphys.f90,machine.F + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/samfaerosols.F b/physics/CONV/SAMF/samfaerosols.F similarity index 100% rename from physics/samfaerosols.F rename to physics/CONV/SAMF/samfaerosols.F diff --git a/physics/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f similarity index 100% rename from physics/samfdeepcnv.f rename to physics/CONV/SAMF/samfdeepcnv.f diff --git a/physics/samfdeepcnv.meta b/physics/CONV/SAMF/samfdeepcnv.meta similarity index 99% rename from physics/samfdeepcnv.meta rename to physics/CONV/SAMF/samfdeepcnv.meta index bed4d655d..ec9157ef3 100644 --- a/physics/samfdeepcnv.meta +++ b/physics/CONV/SAMF/samfdeepcnv.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = samfdeepcnv type = scheme - dependencies = funcphys.f90,machine.F,samfaerosols.F,progsigma_calc.f90 + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,samfaerosols.F,../progsigma_calc.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f similarity index 100% rename from physics/samfshalcnv.f rename to physics/CONV/SAMF/samfshalcnv.f diff --git a/physics/samfshalcnv.meta b/physics/CONV/SAMF/samfshalcnv.meta similarity index 99% rename from physics/samfshalcnv.meta rename to physics/CONV/SAMF/samfshalcnv.meta index c1fffef58..aab66d625 100644 --- a/physics/samfshalcnv.meta +++ b/physics/CONV/SAMF/samfshalcnv.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = samfshalcnv type = scheme - dependencies = funcphys.f90,machine.F,samfaerosols.F,progsigma_calc.f90 + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,samfaerosols.F,../progsigma_calc.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/sascnvn.F b/physics/CONV/SAS/sascnvn.F similarity index 100% rename from physics/sascnvn.F rename to physics/CONV/SAS/sascnvn.F diff --git a/physics/sascnvn.meta b/physics/CONV/SAS/sascnvn.meta similarity index 99% rename from physics/sascnvn.meta rename to physics/CONV/SAS/sascnvn.meta index 66e5161ad..fefa2823a 100644 --- a/physics/sascnvn.meta +++ b/physics/CONV/SAS/sascnvn.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sascnvn type = scheme - dependencies = funcphys.f90,machine.F + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/shalcnv.F b/physics/CONV/SAS/shalcnv.F similarity index 100% rename from physics/shalcnv.F rename to physics/CONV/SAS/shalcnv.F diff --git a/physics/shalcnv.meta b/physics/CONV/SAS/shalcnv.meta similarity index 99% rename from physics/shalcnv.meta rename to physics/CONV/SAS/shalcnv.meta index f554201c5..15324ed08 100644 --- a/physics/shalcnv.meta +++ b/physics/CONV/SAS/shalcnv.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = shalcnv type = scheme - dependencies = funcphys.f90,machine.F + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_ntiedtke.F90 b/physics/CONV/nTiedtke/cu_ntiedtke.F90 similarity index 100% rename from physics/cu_ntiedtke.F90 rename to physics/CONV/nTiedtke/cu_ntiedtke.F90 diff --git a/physics/cu_ntiedtke.meta b/physics/CONV/nTiedtke/cu_ntiedtke.meta similarity index 99% rename from physics/cu_ntiedtke.meta rename to physics/CONV/nTiedtke/cu_ntiedtke.meta index dded8fb20..b425a80ad 100644 --- a/physics/cu_ntiedtke.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_ntiedtke type = scheme - dependencies = machine.F,physcons.F90 + dependencies = ../../hooks/machine.F,../../hooks/physcons.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_ntiedtke_post.F90 b/physics/CONV/nTiedtke/cu_ntiedtke_post.F90 similarity index 100% rename from physics/cu_ntiedtke_post.F90 rename to physics/CONV/nTiedtke/cu_ntiedtke_post.F90 diff --git a/physics/cu_ntiedtke_post.meta b/physics/CONV/nTiedtke/cu_ntiedtke_post.meta similarity index 97% rename from physics/cu_ntiedtke_post.meta rename to physics/CONV/nTiedtke/cu_ntiedtke_post.meta index 703d32b90..9960b6b77 100644 --- a/physics/cu_ntiedtke_post.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_ntiedtke_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cu_ntiedtke_pre.F90 b/physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 similarity index 100% rename from physics/cu_ntiedtke_pre.F90 rename to physics/CONV/nTiedtke/cu_ntiedtke_pre.F90 diff --git a/physics/cu_ntiedtke_pre.meta b/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta similarity index 98% rename from physics/cu_ntiedtke_pre.meta rename to physics/CONV/nTiedtke/cu_ntiedtke_pre.meta index ccb9b7f48..26392f0e6 100644 --- a/physics/cu_ntiedtke_pre.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cu_ntiedtke_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/progsigma_calc.f90 b/physics/CONV/progsigma_calc.f90 similarity index 100% rename from physics/progsigma_calc.f90 rename to physics/CONV/progsigma_calc.f90 diff --git a/physics/cires_orowam2017.f b/physics/GWD/cires_orowam2017.f similarity index 100% rename from physics/cires_orowam2017.f rename to physics/GWD/cires_orowam2017.f diff --git a/physics/cires_tauamf_data.F90 b/physics/GWD/cires_tauamf_data.F90 similarity index 100% rename from physics/cires_tauamf_data.F90 rename to physics/GWD/cires_tauamf_data.F90 diff --git a/physics/cires_ugwp.F90 b/physics/GWD/cires_ugwp.F90 similarity index 100% rename from physics/cires_ugwp.F90 rename to physics/GWD/cires_ugwp.F90 diff --git a/physics/cires_ugwp.meta b/physics/GWD/cires_ugwp.meta similarity index 99% rename from physics/cires_ugwp.meta rename to physics/GWD/cires_ugwp.meta index d944a635e..cd0192ca7 100644 --- a/physics/cires_ugwp.meta +++ b/physics/GWD/cires_ugwp.meta @@ -3,7 +3,7 @@ type = scheme # DH* 20200804 - this is a result of the nasty hack to call gwdps from within ugwp-v0! dependencies=cires_ugwp_triggers.F90,cires_ugwp_initialize.F90 - dependencies=cires_orowam2017.f,cires_ugwp_module.F90,gwdps.f,machine.F,ugwp_driver_v0.F + dependencies=cires_orowam2017.f,cires_ugwp_module.F90,gwdps.f,../hooks/machine.F,ugwp_driver_v0.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cires_ugwp_initialize.F90 b/physics/GWD/cires_ugwp_initialize.F90 similarity index 100% rename from physics/cires_ugwp_initialize.F90 rename to physics/GWD/cires_ugwp_initialize.F90 diff --git a/physics/cires_ugwp_module.F90 b/physics/GWD/cires_ugwp_module.F90 similarity index 100% rename from physics/cires_ugwp_module.F90 rename to physics/GWD/cires_ugwp_module.F90 diff --git a/physics/cires_ugwp_post.F90 b/physics/GWD/cires_ugwp_post.F90 similarity index 100% rename from physics/cires_ugwp_post.F90 rename to physics/GWD/cires_ugwp_post.F90 diff --git a/physics/cires_ugwp_post.meta b/physics/GWD/cires_ugwp_post.meta similarity index 99% rename from physics/cires_ugwp_post.meta rename to physics/GWD/cires_ugwp_post.meta index 5add9d43f..dabc40082 100644 --- a/physics/cires_ugwp_post.meta +++ b/physics/GWD/cires_ugwp_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cires_ugwp_post type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/cires_ugwp_triggers.F90 b/physics/GWD/cires_ugwp_triggers.F90 similarity index 100% rename from physics/cires_ugwp_triggers.F90 rename to physics/GWD/cires_ugwp_triggers.F90 diff --git a/physics/cires_ugwpv1_initialize.F90 b/physics/GWD/cires_ugwpv1_initialize.F90 similarity index 100% rename from physics/cires_ugwpv1_initialize.F90 rename to physics/GWD/cires_ugwpv1_initialize.F90 diff --git a/physics/cires_ugwpv1_module.F90 b/physics/GWD/cires_ugwpv1_module.F90 similarity index 100% rename from physics/cires_ugwpv1_module.F90 rename to physics/GWD/cires_ugwpv1_module.F90 diff --git a/physics/cires_ugwpv1_oro.F90 b/physics/GWD/cires_ugwpv1_oro.F90 similarity index 100% rename from physics/cires_ugwpv1_oro.F90 rename to physics/GWD/cires_ugwpv1_oro.F90 diff --git a/physics/cires_ugwpv1_solv2.F90 b/physics/GWD/cires_ugwpv1_solv2.F90 similarity index 100% rename from physics/cires_ugwpv1_solv2.F90 rename to physics/GWD/cires_ugwpv1_solv2.F90 diff --git a/physics/cires_ugwpv1_sporo.F90 b/physics/GWD/cires_ugwpv1_sporo.F90 similarity index 100% rename from physics/cires_ugwpv1_sporo.F90 rename to physics/GWD/cires_ugwpv1_sporo.F90 diff --git a/physics/cires_ugwpv1_triggers.F90 b/physics/GWD/cires_ugwpv1_triggers.F90 similarity index 100% rename from physics/cires_ugwpv1_triggers.F90 rename to physics/GWD/cires_ugwpv1_triggers.F90 diff --git a/physics/drag_suite.F90 b/physics/GWD/drag_suite.F90 similarity index 100% rename from physics/drag_suite.F90 rename to physics/GWD/drag_suite.F90 diff --git a/physics/drag_suite.meta b/physics/GWD/drag_suite.meta similarity index 99% rename from physics/drag_suite.meta rename to physics/GWD/drag_suite.meta index 66f320b98..94dddcc93 100644 --- a/physics/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = drag_suite type = scheme - dependencies = + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/gwdc.f b/physics/GWD/gwdc.f similarity index 100% rename from physics/gwdc.f rename to physics/GWD/gwdc.f diff --git a/physics/gwdc.meta b/physics/GWD/gwdc.meta similarity index 99% rename from physics/gwdc.meta rename to physics/GWD/gwdc.meta index 341879b0b..9884d8a62 100644 --- a/physics/gwdc.meta +++ b/physics/GWD/gwdc.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = gwdc type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/gwdc_post.f b/physics/GWD/gwdc_post.f similarity index 100% rename from physics/gwdc_post.f rename to physics/GWD/gwdc_post.f diff --git a/physics/gwdc_post.meta b/physics/GWD/gwdc_post.meta similarity index 99% rename from physics/gwdc_post.meta rename to physics/GWD/gwdc_post.meta index 25415b888..97649d4cf 100644 --- a/physics/gwdc_post.meta +++ b/physics/GWD/gwdc_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = gwdc_post type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/gwdc_pre.f b/physics/GWD/gwdc_pre.f similarity index 100% rename from physics/gwdc_pre.f rename to physics/GWD/gwdc_pre.f diff --git a/physics/gwdc_pre.meta b/physics/GWD/gwdc_pre.meta similarity index 99% rename from physics/gwdc_pre.meta rename to physics/GWD/gwdc_pre.meta index 63df59cfa..55b0054bd 100644 --- a/physics/gwdc_pre.meta +++ b/physics/GWD/gwdc_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = gwdc_pre type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/gwdps.f b/physics/GWD/gwdps.f similarity index 100% rename from physics/gwdps.f rename to physics/GWD/gwdps.f diff --git a/physics/gwdps.meta b/physics/GWD/gwdps.meta similarity index 99% rename from physics/gwdps.meta rename to physics/GWD/gwdps.meta index af60886ab..bbe7569d0 100644 --- a/physics/gwdps.meta +++ b/physics/GWD/gwdps.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = gwdps type = scheme - dependencies = + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/rayleigh_damp.f b/physics/GWD/rayleigh_damp.f similarity index 100% rename from physics/rayleigh_damp.f rename to physics/GWD/rayleigh_damp.f diff --git a/physics/rayleigh_damp.meta b/physics/GWD/rayleigh_damp.meta similarity index 99% rename from physics/rayleigh_damp.meta rename to physics/GWD/rayleigh_damp.meta index 63025bcff..525acbe8b 100644 --- a/physics/rayleigh_damp.meta +++ b/physics/GWD/rayleigh_damp.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rayleigh_damp type = scheme - dependencies = + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/ugwp_driver_v0.F b/physics/GWD/ugwp_driver_v0.F similarity index 100% rename from physics/ugwp_driver_v0.F rename to physics/GWD/ugwp_driver_v0.F diff --git a/physics/ugwpv1_gsldrag.F90 b/physics/GWD/ugwpv1_gsldrag.F90 similarity index 100% rename from physics/ugwpv1_gsldrag.F90 rename to physics/GWD/ugwpv1_gsldrag.F90 diff --git a/physics/ugwpv1_gsldrag.meta b/physics/GWD/ugwpv1_gsldrag.meta similarity index 99% rename from physics/ugwpv1_gsldrag.meta rename to physics/GWD/ugwpv1_gsldrag.meta index 82caa8832..73d7eee1c 100644 --- a/physics/ugwpv1_gsldrag.meta +++ b/physics/GWD/ugwpv1_gsldrag.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ugwpv1_gsldrag type = scheme - dependencies = machine.F,drag_suite.F90 + dependencies = ../hooks/machine.F,drag_suite.F90 dependencies = cires_ugwpv1_module.F90,cires_ugwpv1_triggers.F90,cires_ugwpv1_initialize.F90,cires_ugwpv1_solv2.F90 dependencies = cires_ugwpv1_sporo.F90,cires_ugwpv1_oro.F90 ######################################################################## diff --git a/physics/ugwpv1_gsldrag_post.F90 b/physics/GWD/ugwpv1_gsldrag_post.F90 similarity index 100% rename from physics/ugwpv1_gsldrag_post.F90 rename to physics/GWD/ugwpv1_gsldrag_post.F90 diff --git a/physics/ugwpv1_gsldrag_post.meta b/physics/GWD/ugwpv1_gsldrag_post.meta similarity index 99% rename from physics/ugwpv1_gsldrag_post.meta rename to physics/GWD/ugwpv1_gsldrag_post.meta index f8766060c..e1c63102d 100644 --- a/physics/ugwpv1_gsldrag_post.meta +++ b/physics/GWD/ugwpv1_gsldrag_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ugwpv1_gsldrag_post type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 similarity index 100% rename from physics/unified_ugwp.F90 rename to physics/GWD/unified_ugwp.F90 diff --git a/physics/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta similarity index 99% rename from physics/unified_ugwp.meta rename to physics/GWD/unified_ugwp.meta index 8af99957a..a08ee3960 100644 --- a/physics/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -1,10 +1,10 @@ [ccpp-table-properties] name = unified_ugwp type = scheme - - dependencies=cires_ugwp_triggers.F90,cires_ugwp_initialize.F90 - dependencies=cires_orowam2017.f, cires_ugwp_module.F90,gwdps.f,machine.F,ugwp_driver_v0.F - dependencies=drag_suite.F90 + dependencies = ../hooks/machine.F + dependencies = cires_ugwp_triggers.F90,cires_ugwp_initialize.F90 + dependencies = cires_orowam2017.f,cires_ugwp_module.F90,gwdps.f,ugwp_driver_v0.F + dependencies = drag_suite.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/unified_ugwp_post.F90 b/physics/GWD/unified_ugwp_post.F90 similarity index 100% rename from physics/unified_ugwp_post.F90 rename to physics/GWD/unified_ugwp_post.F90 diff --git a/physics/unified_ugwp_post.meta b/physics/GWD/unified_ugwp_post.meta similarity index 99% rename from physics/unified_ugwp_post.meta rename to physics/GWD/unified_ugwp_post.meta index 6da6342df..7784c28ec 100644 --- a/physics/unified_ugwp_post.meta +++ b/physics/GWD/unified_ugwp_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = unified_ugwp_post type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_DCNV_generic_post.F90 b/physics/Interstitials/GFS/GFS_DCNV_generic_post.F90 similarity index 100% rename from physics/GFS_DCNV_generic_post.F90 rename to physics/Interstitials/GFS/GFS_DCNV_generic_post.F90 diff --git a/physics/GFS_DCNV_generic_post.meta b/physics/Interstitials/GFS/GFS_DCNV_generic_post.meta similarity index 99% rename from physics/GFS_DCNV_generic_post.meta rename to physics/Interstitials/GFS/GFS_DCNV_generic_post.meta index 8428752ce..359e580fe 100644 --- a/physics/GFS_DCNV_generic_post.meta +++ b/physics/Interstitials/GFS/GFS_DCNV_generic_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_DCNV_generic_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_DCNV_generic_pre.F90 b/physics/Interstitials/GFS/GFS_DCNV_generic_pre.F90 similarity index 100% rename from physics/GFS_DCNV_generic_pre.F90 rename to physics/Interstitials/GFS/GFS_DCNV_generic_pre.F90 diff --git a/physics/GFS_DCNV_generic_pre.meta b/physics/Interstitials/GFS/GFS_DCNV_generic_pre.meta similarity index 99% rename from physics/GFS_DCNV_generic_pre.meta rename to physics/Interstitials/GFS/GFS_DCNV_generic_pre.meta index ee2050926..46de572f0 100644 --- a/physics/GFS_DCNV_generic_pre.meta +++ b/physics/Interstitials/GFS/GFS_DCNV_generic_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_DCNV_generic_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_GWD_generic_post.F90 b/physics/Interstitials/GFS/GFS_GWD_generic_post.F90 similarity index 100% rename from physics/GFS_GWD_generic_post.F90 rename to physics/Interstitials/GFS/GFS_GWD_generic_post.F90 diff --git a/physics/GFS_GWD_generic_post.meta b/physics/Interstitials/GFS/GFS_GWD_generic_post.meta similarity index 99% rename from physics/GFS_GWD_generic_post.meta rename to physics/Interstitials/GFS/GFS_GWD_generic_post.meta index 204c16c84..beca39282 100644 --- a/physics/GFS_GWD_generic_post.meta +++ b/physics/Interstitials/GFS/GFS_GWD_generic_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_GWD_generic_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_GWD_generic_pre.F90 b/physics/Interstitials/GFS/GFS_GWD_generic_pre.F90 similarity index 100% rename from physics/GFS_GWD_generic_pre.F90 rename to physics/Interstitials/GFS/GFS_GWD_generic_pre.F90 diff --git a/physics/GFS_GWD_generic_pre.meta b/physics/Interstitials/GFS/GFS_GWD_generic_pre.meta similarity index 99% rename from physics/GFS_GWD_generic_pre.meta rename to physics/Interstitials/GFS/GFS_GWD_generic_pre.meta index 9bcc03300..dbbfc261d 100644 --- a/physics/GFS_GWD_generic_pre.meta +++ b/physics/Interstitials/GFS/GFS_GWD_generic_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_GWD_generic_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_MP_generic_post.F90 b/physics/Interstitials/GFS/GFS_MP_generic_post.F90 similarity index 100% rename from physics/GFS_MP_generic_post.F90 rename to physics/Interstitials/GFS/GFS_MP_generic_post.F90 diff --git a/physics/GFS_MP_generic_post.meta b/physics/Interstitials/GFS/GFS_MP_generic_post.meta similarity index 99% rename from physics/GFS_MP_generic_post.meta rename to physics/Interstitials/GFS/GFS_MP_generic_post.meta index 7cd2ca4b5..0ac5c4527 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/Interstitials/GFS/GFS_MP_generic_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_MP_generic_post type = scheme - dependencies = calpreciptype.f90,machine.F + dependencies = ../../MP/calpreciptype.f90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_MP_generic_pre.F90 b/physics/Interstitials/GFS/GFS_MP_generic_pre.F90 similarity index 100% rename from physics/GFS_MP_generic_pre.F90 rename to physics/Interstitials/GFS/GFS_MP_generic_pre.F90 diff --git a/physics/GFS_MP_generic_pre.meta b/physics/Interstitials/GFS/GFS_MP_generic_pre.meta similarity index 98% rename from physics/GFS_MP_generic_pre.meta rename to physics/Interstitials/GFS/GFS_MP_generic_pre.meta index a2a4947ef..6d5fd1538 100644 --- a/physics/GFS_MP_generic_pre.meta +++ b/physics/Interstitials/GFS/GFS_MP_generic_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_MP_generic_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_PBL_generic_common.F90 b/physics/Interstitials/GFS/GFS_PBL_generic_common.F90 similarity index 100% rename from physics/GFS_PBL_generic_common.F90 rename to physics/Interstitials/GFS/GFS_PBL_generic_common.F90 diff --git a/physics/GFS_PBL_generic_post.F90 b/physics/Interstitials/GFS/GFS_PBL_generic_post.F90 similarity index 100% rename from physics/GFS_PBL_generic_post.F90 rename to physics/Interstitials/GFS/GFS_PBL_generic_post.F90 diff --git a/physics/GFS_PBL_generic_post.meta b/physics/Interstitials/GFS/GFS_PBL_generic_post.meta similarity index 99% rename from physics/GFS_PBL_generic_post.meta rename to physics/Interstitials/GFS/GFS_PBL_generic_post.meta index b20142991..53a769c49 100644 --- a/physics/GFS_PBL_generic_post.meta +++ b/physics/Interstitials/GFS/GFS_PBL_generic_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_PBL_generic_post type = scheme - dependencies = GFS_PBL_generic_common.F90,machine.F + dependencies = GFS_PBL_generic_common.F90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_PBL_generic_pre.F90 b/physics/Interstitials/GFS/GFS_PBL_generic_pre.F90 similarity index 100% rename from physics/GFS_PBL_generic_pre.F90 rename to physics/Interstitials/GFS/GFS_PBL_generic_pre.F90 diff --git a/physics/GFS_PBL_generic_pre.meta b/physics/Interstitials/GFS/GFS_PBL_generic_pre.meta similarity index 99% rename from physics/GFS_PBL_generic_pre.meta rename to physics/Interstitials/GFS/GFS_PBL_generic_pre.meta index a09b34b48..0377582a4 100644 --- a/physics/GFS_PBL_generic_pre.meta +++ b/physics/Interstitials/GFS/GFS_PBL_generic_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_PBL_generic_pre type = scheme - dependencies = GFS_PBL_generic_common.F90,machine.F + dependencies = GFS_PBL_generic_common.F90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_SCNV_generic_post.F90 b/physics/Interstitials/GFS/GFS_SCNV_generic_post.F90 similarity index 100% rename from physics/GFS_SCNV_generic_post.F90 rename to physics/Interstitials/GFS/GFS_SCNV_generic_post.F90 diff --git a/physics/GFS_SCNV_generic_post.meta b/physics/Interstitials/GFS/GFS_SCNV_generic_post.meta similarity index 99% rename from physics/GFS_SCNV_generic_post.meta rename to physics/Interstitials/GFS/GFS_SCNV_generic_post.meta index bf6ba394f..963ad4a81 100644 --- a/physics/GFS_SCNV_generic_post.meta +++ b/physics/Interstitials/GFS/GFS_SCNV_generic_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_SCNV_generic_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_SCNV_generic_pre.F90 b/physics/Interstitials/GFS/GFS_SCNV_generic_pre.F90 similarity index 100% rename from physics/GFS_SCNV_generic_pre.F90 rename to physics/Interstitials/GFS/GFS_SCNV_generic_pre.F90 diff --git a/physics/GFS_SCNV_generic_pre.meta b/physics/Interstitials/GFS/GFS_SCNV_generic_pre.meta similarity index 99% rename from physics/GFS_SCNV_generic_pre.meta rename to physics/Interstitials/GFS/GFS_SCNV_generic_pre.meta index eccd547a1..fbd9e47d8 100644 --- a/physics/GFS_SCNV_generic_pre.meta +++ b/physics/Interstitials/GFS/GFS_SCNV_generic_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_SCNV_generic_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_cloud_diagnostics.F90 b/physics/Interstitials/GFS/GFS_cloud_diagnostics.F90 similarity index 100% rename from physics/GFS_cloud_diagnostics.F90 rename to physics/Interstitials/GFS/GFS_cloud_diagnostics.F90 diff --git a/physics/GFS_cloud_diagnostics.meta b/physics/Interstitials/GFS/GFS_cloud_diagnostics.meta similarity index 98% rename from physics/GFS_cloud_diagnostics.meta rename to physics/Interstitials/GFS/GFS_cloud_diagnostics.meta index 53d1552e6..576c66463 100644 --- a/physics/GFS_cloud_diagnostics.meta +++ b/physics/Interstitials/GFS/GFS_cloud_diagnostics.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = GFS_cloud_diagnostics type = scheme - dependencies = machine.F,radiation_clouds.f + relative_path = ../../ + dependencies = hooks/machine.F,Radiation/radiation_clouds.f ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_debug.F90 b/physics/Interstitials/GFS/GFS_debug.F90 similarity index 100% rename from physics/GFS_debug.F90 rename to physics/Interstitials/GFS/GFS_debug.F90 diff --git a/physics/GFS_debug.meta b/physics/Interstitials/GFS/GFS_debug.meta similarity index 99% rename from physics/GFS_debug.meta rename to physics/Interstitials/GFS/GFS_debug.meta index 1ad24e1d6..de3f49a6f 100644 --- a/physics/GFS_debug.meta +++ b/physics/Interstitials/GFS/GFS_debug.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_diagtoscreen type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/Interstitials/GFS/GFS_phys_time_vary.fv3.F90 similarity index 100% rename from physics/GFS_phys_time_vary.fv3.F90 rename to physics/Interstitials/GFS/GFS_phys_time_vary.fv3.F90 diff --git a/physics/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/GFS/GFS_phys_time_vary.fv3.meta similarity index 98% rename from physics/GFS_phys_time_vary.fv3.meta rename to physics/Interstitials/GFS/GFS_phys_time_vary.fv3.meta index 363469e91..45125385c 100644 --- a/physics/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/GFS/GFS_phys_time_vary.fv3.meta @@ -1,8 +1,15 @@ [ccpp-table-properties] name = GFS_phys_time_vary type = scheme - dependencies = aerclm_def.F,aerinterp.F90,gcycle.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f - dependencies = namelist_soilveg.f,set_soilveg.f,ozinterp.f90,ozne_def.f,sfcsub.F,cires_tauamf_data.F90,noahmp_tables.f90 + relative_path = ../../ + dependencies = hooks/machine.F + dependencies = Interstitials/GFS/gcycle.F90,Interstitials/GFS/iccn_def.F,Interstitials/GFS/iccninterp.F90,Interstitials/GFS/sfcsub.F + dependencies = Radiation/mersenne_twister.f + dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 + dependencies = Land/namelist_soilveg.f,Land/set_soilveg.f,Land/Noahmp/noahmp_tables.f90 + dependencies = o3_photo/ozinterp.f90,o3_photo/ozne_def.f + dependencies = h2o_photo/h2o_def.f,h2o_photo/h2ointerp.f90 + dependencies = GWD/cires_tauamf_data.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_phys_time_vary.scm.F90 b/physics/Interstitials/GFS/GFS_phys_time_vary.scm.F90 similarity index 100% rename from physics/GFS_phys_time_vary.scm.F90 rename to physics/Interstitials/GFS/GFS_phys_time_vary.scm.F90 diff --git a/physics/GFS_phys_time_vary.scm.meta b/physics/Interstitials/GFS/GFS_phys_time_vary.scm.meta similarity index 98% rename from physics/GFS_phys_time_vary.scm.meta rename to physics/Interstitials/GFS/GFS_phys_time_vary.scm.meta index 8b59e4bed..84f22aede 100644 --- a/physics/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/GFS/GFS_phys_time_vary.scm.meta @@ -1,8 +1,15 @@ [ccpp-table-properties] name = GFS_phys_time_vary type = scheme - dependencies = aerclm_def.F,aerinterp.F90,h2o_def.f,h2ointerp.f90,iccn_def.F,iccninterp.F90,machine.F,mersenne_twister.f - dependencies = namelist_soilveg.f,set_soilveg.f,ozinterp.f90,ozne_def.f,cires_tauamf_data.F90,noahmp_tables.f90 + relative_path = ../../ + dependencies = hooks/machine.F + dependencies = Interstitials/GFS/iccn_def.F,Interstitials/GFS/iccninterp.F90,Interstitials/GFS/sfcsub.F + dependencies = Radiation/mersenne_twister.f + dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 + dependencies = Land/namelist_soilveg.f,Land/set_soilveg.f,Land/Noahmp/noahmp_tables.f90 + dependencies = o3_photo/ozinterp.f90,o3_photo/ozne_def.f + dependencies = h2o_photo/h2o_def.f,h2o_photo/h2ointerp.f90 + dependencies = GWD/cires_tauamf_data.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rad_time_vary.fv3.F90 b/physics/Interstitials/GFS/GFS_rad_time_vary.fv3.F90 similarity index 100% rename from physics/GFS_rad_time_vary.fv3.F90 rename to physics/Interstitials/GFS/GFS_rad_time_vary.fv3.F90 diff --git a/physics/GFS_rad_time_vary.fv3.meta b/physics/Interstitials/GFS/GFS_rad_time_vary.fv3.meta similarity index 98% rename from physics/GFS_rad_time_vary.fv3.meta rename to physics/Interstitials/GFS/GFS_rad_time_vary.fv3.meta index 19eb41dc2..0759b7e2a 100644 --- a/physics/GFS_rad_time_vary.fv3.meta +++ b/physics/Interstitials/GFS/GFS_rad_time_vary.fv3.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = GFS_rad_time_vary type = scheme - dependencies = machine.F,mersenne_twister.f,radcons.f90 + relative_path = ../../ + dependencies = hooks/machine.F,Radiation/mersenne_twister.f,Radiation/RRTMG/radcons.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rad_time_vary.scm.F90 b/physics/Interstitials/GFS/GFS_rad_time_vary.scm.F90 similarity index 100% rename from physics/GFS_rad_time_vary.scm.F90 rename to physics/Interstitials/GFS/GFS_rad_time_vary.scm.F90 diff --git a/physics/GFS_rad_time_vary.scm.meta b/physics/Interstitials/GFS/GFS_rad_time_vary.scm.meta similarity index 98% rename from physics/GFS_rad_time_vary.scm.meta rename to physics/Interstitials/GFS/GFS_rad_time_vary.scm.meta index 19eb41dc2..0759b7e2a 100644 --- a/physics/GFS_rad_time_vary.scm.meta +++ b/physics/Interstitials/GFS/GFS_rad_time_vary.scm.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = GFS_rad_time_vary type = scheme - dependencies = machine.F,mersenne_twister.f,radcons.f90 + relative_path = ../../ + dependencies = hooks/machine.F,Radiation/mersenne_twister.f,Radiation/RRTMG/radcons.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_radiation_surface.F90 b/physics/Interstitials/GFS/GFS_radiation_surface.F90 similarity index 100% rename from physics/GFS_radiation_surface.F90 rename to physics/Interstitials/GFS/GFS_radiation_surface.F90 diff --git a/physics/GFS_radiation_surface.meta b/physics/Interstitials/GFS/GFS_radiation_surface.meta similarity index 98% rename from physics/GFS_radiation_surface.meta rename to physics/Interstitials/GFS/GFS_radiation_surface.meta index 9d5734706..c18b81d9f 100644 --- a/physics/GFS_radiation_surface.meta +++ b/physics/Interstitials/GFS/GFS_radiation_surface.meta @@ -1,7 +1,10 @@ [ccpp-table-properties] name = GFS_radiation_surface type = scheme - dependencies = iounitdef.f,machine.F,radiation_surface.f,set_soilveg_ruc.F90,namelist_soilveg_ruc.F90 + relative_path = ../../ + dependencies = Radiation/iounitdef.f,Radiation/radiation_surface.f + dependencies = Land/RUC/set_soilveg_ruc.F90,Land/RUC/namelist_soilveg_ruc.F90 + dependencies = hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmg_post.F90 b/physics/Interstitials/GFS/GFS_rrtmg_post.F90 similarity index 100% rename from physics/GFS_rrtmg_post.F90 rename to physics/Interstitials/GFS/GFS_rrtmg_post.F90 diff --git a/physics/GFS_rrtmg_post.meta b/physics/Interstitials/GFS/GFS_rrtmg_post.meta similarity index 97% rename from physics/GFS_rrtmg_post.meta rename to physics/Interstitials/GFS/GFS_rrtmg_post.meta index 5fa6328a7..c84b9da31 100644 --- a/physics/GFS_rrtmg_post.meta +++ b/physics/Interstitials/GFS/GFS_rrtmg_post.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = GFS_rrtmg_post type = scheme - dependencies = iounitdef.f,machine.F,radiation_aerosols.f,radlw_param.f,radsw_param.f + relative_path = ../../ + dependencies = hooks/machine.F + dependencies = Radiation/iounitdef.f,Radiation/radiation_aerosols.f,Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmg_pre.F90 b/physics/Interstitials/GFS/GFS_rrtmg_pre.F90 similarity index 100% rename from physics/GFS_rrtmg_pre.F90 rename to physics/Interstitials/GFS/GFS_rrtmg_pre.F90 diff --git a/physics/GFS_rrtmg_pre.meta b/physics/Interstitials/GFS/GFS_rrtmg_pre.meta similarity index 98% rename from physics/GFS_rrtmg_pre.meta rename to physics/Interstitials/GFS/GFS_rrtmg_pre.meta index a8aecdbe0..e0e67c8f5 100644 --- a/physics/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/GFS/GFS_rrtmg_pre.meta @@ -1,9 +1,13 @@ [ccpp-table-properties] name = GFS_rrtmg_pre type = scheme - dependencies = funcphys.f90,iounitdef.f,machine.F,module_bfmicrophysics.f,module_mp_radar.F90,module_mp_thompson.F90 - dependencies = module_mp_thompson_make_number_concentrations.F90,radcons.f90,radiation_aerosols.f - dependencies = radiation_astronomy.f,radiation_clouds.f,radiation_gases.f,radlw_param.f,radsw_param.f,surface_perturbation.F90,radiation_cloud_overlap.F90 + relative_path = ../../ + dependencies = tools/funcphys.f90,hooks/machine.F + dependencies = MP/Thompson/module_mp_thompson.F90,MP/Thompsonmodule_mp_thompson_make_number_concentrations.F90 + dependencies = Radiation/iounitdef.f,Radiation/RRTMG/radcons.f90,Radiation/radiation_aerosols.f + dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_clouds.f,Radiation/radiation_gases.f + dependencies = Radiation/radlw_param.f,Radiation/radsw_param.f,Radiation/radiation_cloud_overlap.F90 + dependencies = Land/Noah/surface_perturbation.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmg_setup.F90 b/physics/Interstitials/GFS/GFS_rrtmg_setup.F90 similarity index 100% rename from physics/GFS_rrtmg_setup.F90 rename to physics/Interstitials/GFS/GFS_rrtmg_setup.F90 diff --git a/physics/GFS_rrtmg_setup.meta b/physics/Interstitials/GFS/GFS_rrtmg_setup.meta similarity index 97% rename from physics/GFS_rrtmg_setup.meta rename to physics/Interstitials/GFS/GFS_rrtmg_setup.meta index adf6d8750..0c199deaa 100644 --- a/physics/GFS_rrtmg_setup.meta +++ b/physics/Interstitials/GFS/GFS_rrtmg_setup.meta @@ -1,8 +1,12 @@ [ccpp-table-properties] name = GFS_rrtmg_setup type = scheme - dependencies = iounitdef.f,module_bfmicrophysics.f,radcons.f90,radiation_aerosols.f,radiation_astronomy.f,radiation_clouds.f - dependencies = module_mp_thompson.F90,radiation_gases.f,radlw_main.F90,radlw_param.f,radsw_main.F90,radsw_param.f,machine.F + relative_path = ../../ + dependencies = hooks/machine.F + dependencies = Radiaiton/iounitdef.f,Radiaiton/RRTMG/radcons.f90,Radiaiton/radiation_aerosols.f + dependencies = Radiaiton/radiation_astronomy.f,Radiaiton/radiation_clouds.f,Radiaiton/radiation_gases.f + dependencies = Radiaiton/radlw_main.F90,Radiaiton/radlw_param.f,Radiaiton/radsw_main.F90,Radiaiton/radsw_param.f + dependencies = MP/Thompson/module_mp_thompson.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmgp_cloud_mp.F90 b/physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.F90 similarity index 100% rename from physics/GFS_rrtmgp_cloud_mp.F90 rename to physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.F90 diff --git a/physics/GFS_rrtmgp_cloud_mp.meta b/physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.meta similarity index 98% rename from physics/GFS_rrtmgp_cloud_mp.meta rename to physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.meta index b782e73b4..f67259b87 100644 --- a/physics/GFS_rrtmgp_cloud_mp.meta +++ b/physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.meta @@ -1,7 +1,10 @@ [ccpp-table-properties] name = GFS_rrtmgp_cloud_mp type = scheme - dependencies = radiation_tools.F90, radiation_clouds.f, module_mp_thompson_make_number_concentrations.F90, module_mp_thompson.F90, rrtmgp_lw_cloud_optics.F90 + relative_path = ../../ + dependencies = hooks/machine.F + dependencies = Radiation/radiation_tools.F90,Radiation/radiation_clouds.f,Radiation/RRTMGP/rrtmgp_lw_cloud_optics.F90 + dependencies = MP/Thompson/module_mp_thompson_make_number_concentrations.F90,MP/Thompson/module_mp_thompson.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmgp_cloud_overlap.F90 b/physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.F90 similarity index 100% rename from physics/GFS_rrtmgp_cloud_overlap.F90 rename to physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.F90 diff --git a/physics/GFS_rrtmgp_cloud_overlap.meta b/physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.meta similarity index 98% rename from physics/GFS_rrtmgp_cloud_overlap.meta rename to physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.meta index cf6a05217..4d9af626d 100644 --- a/physics/GFS_rrtmgp_cloud_overlap.meta +++ b/physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = GFS_rrtmgp_cloud_overlap type = scheme - dependencies = radiation_tools.F90, radiation_cloud_overlap.F90 + relative_path = ../../ + dependencies = hooks/machine.F + dependencies = Radiation/radiation_tools.F90,Radiation/radiation_cloud_overlap.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmgp_post.F90 b/physics/Interstitials/GFS/GFS_rrtmgp_post.F90 similarity index 100% rename from physics/GFS_rrtmgp_post.F90 rename to physics/Interstitials/GFS/GFS_rrtmgp_post.F90 diff --git a/physics/GFS_rrtmgp_post.meta b/physics/Interstitials/GFS/GFS_rrtmgp_post.meta similarity index 98% rename from physics/GFS_rrtmgp_post.meta rename to physics/Interstitials/GFS/GFS_rrtmgp_post.meta index e4bc3e5dc..c21c2ef7c 100644 --- a/physics/GFS_rrtmgp_post.meta +++ b/physics/Interstitials/GFS/GFS_rrtmgp_post.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = GFS_rrtmgp_post type = scheme - dependencies = iounitdef.f,machine.F,radiation_aerosols.f,radlw_param.f,radiation_tools.F90,rte-rrtmgp/extensions/mo_heating_rates.F90 + relative_path = ../../ + dependencies = Radiation/iounitdef.f,hooks/machine.F,Radiation/radiation_aerosols.f + dependencies = Radiation/RRTMG/radlw_param.f,Radiation/radiation_tools.F90,Radiation/RRTMGP/rte-rrtmgp/extensions/mo_heating_rates.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmgp_pre.F90 b/physics/Interstitials/GFS/GFS_rrtmgp_pre.F90 similarity index 99% rename from physics/GFS_rrtmgp_pre.F90 rename to physics/Interstitials/GFS/GFS_rrtmgp_pre.F90 index 009eb8c38..b76f93659 100644 --- a/physics/GFS_rrtmgp_pre.F90 +++ b/physics/Interstitials/GFS/GFS_rrtmgp_pre.F90 @@ -9,7 +9,6 @@ module GFS_rrtmgp_pre use funcphys, only: fpvs use module_radiation_astronomy, only: coszmn use module_radiation_gases, only: NF_VGAS, getgases, getozn - use mo_gas_concentrations, only: ty_gas_concs use radiation_tools, only: check_error_msg,cmp_tlev use rrtmgp_lw_gas_optics, only: lw_gas_props diff --git a/physics/GFS_rrtmgp_pre.meta b/physics/Interstitials/GFS/GFS_rrtmgp_pre.meta similarity index 98% rename from physics/GFS_rrtmgp_pre.meta rename to physics/Interstitials/GFS/GFS_rrtmgp_pre.meta index abb07b825..ae67ef51b 100644 --- a/physics/GFS_rrtmgp_pre.meta +++ b/physics/Interstitials/GFS/GFS_rrtmgp_pre.meta @@ -1,8 +1,9 @@ [ccpp-table-properties] name = GFS_rrtmgp_pre type = scheme - dependencies = funcphys.f90,iounitdef.f,machine.F,module_bfmicrophysics.f,physcons.F90,radcons.f90,radiation_aerosols.f - dependencies = radiation_astronomy.f,radiation_gases.f,radiation_tools.F90,rrtmg_lw_cloud_optics.F90 + relative_path = ../../ + dependencies = tools/funcphys.f90,hooks/machine.F,Radiation/iounitdef.f,Radiation/radiation_aerosols.f + dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_gases.f,Radiation/radiation_tools.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_rrtmgp_setup.F90 b/physics/Interstitials/GFS/GFS_rrtmgp_setup.F90 similarity index 100% rename from physics/GFS_rrtmgp_setup.F90 rename to physics/Interstitials/GFS/GFS_rrtmgp_setup.F90 diff --git a/physics/GFS_rrtmgp_setup.meta b/physics/Interstitials/GFS/GFS_rrtmgp_setup.meta similarity index 97% rename from physics/GFS_rrtmgp_setup.meta rename to physics/Interstitials/GFS/GFS_rrtmgp_setup.meta index c4f7cfaa5..5d21e1910 100644 --- a/physics/GFS_rrtmgp_setup.meta +++ b/physics/Interstitials/GFS/GFS_rrtmgp_setup.meta @@ -1,8 +1,10 @@ [ccpp-table-properties] name = GFS_rrtmgp_setup type = scheme - dependencies = iounitdef.f,machine.F,module_bfmicrophysics.f,radiation_aerosols.f,radiation_astronomy.f - dependencies = module_mp_thompson.F90,radiation_gases.f + relative_path = ../../ + dependencies = hooks/machine.F,MP/Thompson/module_mp_thompson.F90 + dependencies = Radiation/iounitdef.f,Radiation/radiation_aerosols.f + dependencies = Radiation/radiation_gases.f,Radiation/radiation_astronomy.f ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_stochastics.F90 b/physics/Interstitials/GFS/GFS_stochastics.F90 similarity index 100% rename from physics/GFS_stochastics.F90 rename to physics/Interstitials/GFS/GFS_stochastics.F90 diff --git a/physics/GFS_stochastics.meta b/physics/Interstitials/GFS/GFS_stochastics.meta similarity index 99% rename from physics/GFS_stochastics.meta rename to physics/Interstitials/GFS/GFS_stochastics.meta index 796f4ddf7..6c55a09de 100644 --- a/physics/GFS_stochastics.meta +++ b/physics/Interstitials/GFS/GFS_stochastics.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_stochastics type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F [ccpp-arg-table] name = GFS_stochastics_init diff --git a/physics/GFS_suite_interstitial_1.F90 b/physics/Interstitials/GFS/GFS_suite_interstitial_1.F90 similarity index 100% rename from physics/GFS_suite_interstitial_1.F90 rename to physics/Interstitials/GFS/GFS_suite_interstitial_1.F90 diff --git a/physics/GFS_suite_interstitial_1.meta b/physics/Interstitials/GFS/GFS_suite_interstitial_1.meta similarity index 99% rename from physics/GFS_suite_interstitial_1.meta rename to physics/Interstitials/GFS/GFS_suite_interstitial_1.meta index a465ed320..295ffdf2e 100644 --- a/physics/GFS_suite_interstitial_1.meta +++ b/physics/Interstitials/GFS/GFS_suite_interstitial_1.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_interstitial_1 type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_interstitial_2.F90 b/physics/Interstitials/GFS/GFS_suite_interstitial_2.F90 similarity index 100% rename from physics/GFS_suite_interstitial_2.F90 rename to physics/Interstitials/GFS/GFS_suite_interstitial_2.F90 diff --git a/physics/GFS_suite_interstitial_2.meta b/physics/Interstitials/GFS/GFS_suite_interstitial_2.meta similarity index 99% rename from physics/GFS_suite_interstitial_2.meta rename to physics/Interstitials/GFS/GFS_suite_interstitial_2.meta index 1f4300574..de4db5f9f 100644 --- a/physics/GFS_suite_interstitial_2.meta +++ b/physics/Interstitials/GFS/GFS_suite_interstitial_2.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_interstitial_2 type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_interstitial_3.F90 b/physics/Interstitials/GFS/GFS_suite_interstitial_3.F90 similarity index 100% rename from physics/GFS_suite_interstitial_3.F90 rename to physics/Interstitials/GFS/GFS_suite_interstitial_3.F90 diff --git a/physics/GFS_suite_interstitial_3.meta b/physics/Interstitials/GFS/GFS_suite_interstitial_3.meta similarity index 99% rename from physics/GFS_suite_interstitial_3.meta rename to physics/Interstitials/GFS/GFS_suite_interstitial_3.meta index e8f9fe889..22f57e354 100644 --- a/physics/GFS_suite_interstitial_3.meta +++ b/physics/Interstitials/GFS/GFS_suite_interstitial_3.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_interstitial_3 type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_interstitial_4.F90 b/physics/Interstitials/GFS/GFS_suite_interstitial_4.F90 similarity index 100% rename from physics/GFS_suite_interstitial_4.F90 rename to physics/Interstitials/GFS/GFS_suite_interstitial_4.F90 diff --git a/physics/GFS_suite_interstitial_4.meta b/physics/Interstitials/GFS/GFS_suite_interstitial_4.meta similarity index 98% rename from physics/GFS_suite_interstitial_4.meta rename to physics/Interstitials/GFS/GFS_suite_interstitial_4.meta index 92870d95f..c0df52f1a 100644 --- a/physics/GFS_suite_interstitial_4.meta +++ b/physics/Interstitials/GFS/GFS_suite_interstitial_4.meta @@ -2,7 +2,9 @@ [ccpp-table-properties] name = GFS_suite_interstitial_4 type = scheme - dependencies = machine.F,module_mp_thompson_make_number_concentrations.F90 + relative_path = ../../ + dependencies = hooks/machine.F + dependencies = MP/Thompson/module_mp_thompson_make_number_concentrations.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_interstitial_5.F90 b/physics/Interstitials/GFS/GFS_suite_interstitial_5.F90 similarity index 100% rename from physics/GFS_suite_interstitial_5.F90 rename to physics/Interstitials/GFS/GFS_suite_interstitial_5.F90 diff --git a/physics/GFS_suite_interstitial_5.meta b/physics/Interstitials/GFS/GFS_suite_interstitial_5.meta similarity index 98% rename from physics/GFS_suite_interstitial_5.meta rename to physics/Interstitials/GFS/GFS_suite_interstitial_5.meta index 9d32160a1..511137901 100644 --- a/physics/GFS_suite_interstitial_5.meta +++ b/physics/Interstitials/GFS/GFS_suite_interstitial_5.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_interstitial_5 type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_interstitial_phys_reset.F90 b/physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.F90 similarity index 100% rename from physics/GFS_suite_interstitial_phys_reset.F90 rename to physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.F90 diff --git a/physics/GFS_suite_interstitial_phys_reset.meta b/physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.meta similarity index 96% rename from physics/GFS_suite_interstitial_phys_reset.meta rename to physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.meta index adebbc833..947a1950f 100644 --- a/physics/GFS_suite_interstitial_phys_reset.meta +++ b/physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_interstitial_phys_reset type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_interstitial_rad_reset.F90 b/physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.F90 similarity index 100% rename from physics/GFS_suite_interstitial_rad_reset.F90 rename to physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.F90 diff --git a/physics/GFS_suite_interstitial_rad_reset.meta b/physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.meta similarity index 96% rename from physics/GFS_suite_interstitial_rad_reset.meta rename to physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.meta index 91fd8cba7..aaaff02f5 100644 --- a/physics/GFS_suite_interstitial_rad_reset.meta +++ b/physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_suite_interstitial_rad_reset type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_stateout_reset.F90 b/physics/Interstitials/GFS/GFS_suite_stateout_reset.F90 similarity index 100% rename from physics/GFS_suite_stateout_reset.F90 rename to physics/Interstitials/GFS/GFS_suite_stateout_reset.F90 diff --git a/physics/GFS_suite_stateout_reset.meta b/physics/Interstitials/GFS/GFS_suite_stateout_reset.meta similarity index 98% rename from physics/GFS_suite_stateout_reset.meta rename to physics/Interstitials/GFS/GFS_suite_stateout_reset.meta index fa4111e6b..b84d10691 100644 --- a/physics/GFS_suite_stateout_reset.meta +++ b/physics/Interstitials/GFS/GFS_suite_stateout_reset.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_stateout_reset type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_suite_stateout_update.F90 b/physics/Interstitials/GFS/GFS_suite_stateout_update.F90 similarity index 100% rename from physics/GFS_suite_stateout_update.F90 rename to physics/Interstitials/GFS/GFS_suite_stateout_update.F90 diff --git a/physics/GFS_suite_stateout_update.meta b/physics/Interstitials/GFS/GFS_suite_stateout_update.meta similarity index 99% rename from physics/GFS_suite_stateout_update.meta rename to physics/Interstitials/GFS/GFS_suite_stateout_update.meta index 580482b71..8a0d784f2 100644 --- a/physics/GFS_suite_stateout_update.meta +++ b/physics/Interstitials/GFS/GFS_suite_stateout_update.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_suite_stateout_update type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_surface_composites_inter.F90 b/physics/Interstitials/GFS/GFS_surface_composites_inter.F90 similarity index 100% rename from physics/GFS_surface_composites_inter.F90 rename to physics/Interstitials/GFS/GFS_surface_composites_inter.F90 diff --git a/physics/GFS_surface_composites_inter.meta b/physics/Interstitials/GFS/GFS_surface_composites_inter.meta similarity index 99% rename from physics/GFS_surface_composites_inter.meta rename to physics/Interstitials/GFS/GFS_surface_composites_inter.meta index 36af0ef5a..ef3005583 100644 --- a/physics/GFS_surface_composites_inter.meta +++ b/physics/Interstitials/GFS/GFS_surface_composites_inter.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_surface_composites_inter type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_surface_composites_post.F90 b/physics/Interstitials/GFS/GFS_surface_composites_post.F90 similarity index 100% rename from physics/GFS_surface_composites_post.F90 rename to physics/Interstitials/GFS/GFS_surface_composites_post.F90 diff --git a/physics/GFS_surface_composites_post.meta b/physics/Interstitials/GFS/GFS_surface_composites_post.meta similarity index 99% rename from physics/GFS_surface_composites_post.meta rename to physics/Interstitials/GFS/GFS_surface_composites_post.meta index a78610cc7..35b54544a 100644 --- a/physics/GFS_surface_composites_post.meta +++ b/physics/Interstitials/GFS/GFS_surface_composites_post.meta @@ -2,7 +2,8 @@ [ccpp-table-properties] name = GFS_surface_composites_post type = scheme - dependencies = machine.F,sfc_diff.f + relative_path = ../../ + dependencies = hooks/machine.F,SFC_Layer/GFS_sfc/sfc_diff.f ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_surface_composites_pre.F90 b/physics/Interstitials/GFS/GFS_surface_composites_pre.F90 similarity index 100% rename from physics/GFS_surface_composites_pre.F90 rename to physics/Interstitials/GFS/GFS_surface_composites_pre.F90 diff --git a/physics/GFS_surface_composites_pre.meta b/physics/Interstitials/GFS/GFS_surface_composites_pre.meta similarity index 99% rename from physics/GFS_surface_composites_pre.meta rename to physics/Interstitials/GFS/GFS_surface_composites_pre.meta index d6b9003fe..33e2f0523 100644 --- a/physics/GFS_surface_composites_pre.meta +++ b/physics/Interstitials/GFS/GFS_surface_composites_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_surface_composites_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_surface_generic_post.F90 b/physics/Interstitials/GFS/GFS_surface_generic_post.F90 similarity index 100% rename from physics/GFS_surface_generic_post.F90 rename to physics/Interstitials/GFS/GFS_surface_generic_post.F90 diff --git a/physics/GFS_surface_generic_post.meta b/physics/Interstitials/GFS/GFS_surface_generic_post.meta similarity index 99% rename from physics/GFS_surface_generic_post.meta rename to physics/Interstitials/GFS/GFS_surface_generic_post.meta index 9658be7d8..2c28b17d7 100644 --- a/physics/GFS_surface_generic_post.meta +++ b/physics/Interstitials/GFS/GFS_surface_generic_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_surface_generic_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_surface_generic_pre.F90 b/physics/Interstitials/GFS/GFS_surface_generic_pre.F90 similarity index 100% rename from physics/GFS_surface_generic_pre.F90 rename to physics/Interstitials/GFS/GFS_surface_generic_pre.F90 diff --git a/physics/GFS_surface_generic_pre.meta b/physics/Interstitials/GFS/GFS_surface_generic_pre.meta similarity index 99% rename from physics/GFS_surface_generic_pre.meta rename to physics/Interstitials/GFS/GFS_surface_generic_pre.meta index d78988787..63fb9b96c 100644 --- a/physics/GFS_surface_generic_pre.meta +++ b/physics/Interstitials/GFS/GFS_surface_generic_pre.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = GFS_surface_generic_pre type = scheme - dependencies = machine.F,surface_perturbation.F90 + relative_path = ../../ + dependencies = hooks/machine.F,Land/Noah/surface_perturbation.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_surface_loop_control_part1.F90 b/physics/Interstitials/GFS/GFS_surface_loop_control_part1.F90 similarity index 100% rename from physics/GFS_surface_loop_control_part1.F90 rename to physics/Interstitials/GFS/GFS_surface_loop_control_part1.F90 diff --git a/physics/GFS_surface_loop_control_part1.meta b/physics/Interstitials/GFS/GFS_surface_loop_control_part1.meta similarity index 97% rename from physics/GFS_surface_loop_control_part1.meta rename to physics/Interstitials/GFS/GFS_surface_loop_control_part1.meta index f178320ee..4bf962f6e 100644 --- a/physics/GFS_surface_loop_control_part1.meta +++ b/physics/Interstitials/GFS/GFS_surface_loop_control_part1.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_surface_loop_control_part1 type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_surface_loop_control_part2.F90 b/physics/Interstitials/GFS/GFS_surface_loop_control_part2.F90 similarity index 100% rename from physics/GFS_surface_loop_control_part2.F90 rename to physics/Interstitials/GFS/GFS_surface_loop_control_part2.F90 diff --git a/physics/GFS_surface_loop_control_part2.meta b/physics/Interstitials/GFS/GFS_surface_loop_control_part2.meta similarity index 98% rename from physics/GFS_surface_loop_control_part2.meta rename to physics/Interstitials/GFS/GFS_surface_loop_control_part2.meta index 7c9bc7408..ba19bf437 100644 --- a/physics/GFS_surface_loop_control_part2.meta +++ b/physics/Interstitials/GFS/GFS_surface_loop_control_part2.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = GFS_surface_loop_control_part2 type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_time_vary_pre.fv3.F90 b/physics/Interstitials/GFS/GFS_time_vary_pre.fv3.F90 similarity index 100% rename from physics/GFS_time_vary_pre.fv3.F90 rename to physics/Interstitials/GFS/GFS_time_vary_pre.fv3.F90 diff --git a/physics/GFS_time_vary_pre.fv3.meta b/physics/Interstitials/GFS/GFS_time_vary_pre.fv3.meta similarity index 98% rename from physics/GFS_time_vary_pre.fv3.meta rename to physics/Interstitials/GFS/GFS_time_vary_pre.fv3.meta index 3ec92287a..c6dd95bce 100644 --- a/physics/GFS_time_vary_pre.fv3.meta +++ b/physics/Interstitials/GFS/GFS_time_vary_pre.fv3.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = GFS_time_vary_pre type = scheme - dependencies = funcphys.f90,machine.F + relative_path = ../../ + dependencies = tools/funcphys.f90,hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/GFS_time_vary_pre.scm.F90 b/physics/Interstitials/GFS/GFS_time_vary_pre.scm.F90 similarity index 100% rename from physics/GFS_time_vary_pre.scm.F90 rename to physics/Interstitials/GFS/GFS_time_vary_pre.scm.F90 diff --git a/physics/GFS_time_vary_pre.scm.meta b/physics/Interstitials/GFS/GFS_time_vary_pre.scm.meta similarity index 98% rename from physics/GFS_time_vary_pre.scm.meta rename to physics/Interstitials/GFS/GFS_time_vary_pre.scm.meta index 20708c51e..af9afcdfe 100644 --- a/physics/GFS_time_vary_pre.scm.meta +++ b/physics/Interstitials/GFS/GFS_time_vary_pre.scm.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = GFS_time_vary_pre type = scheme - dependencies = funcphys.f90,machine.F + relative_path = ../../ + dependencies = tools/funcphys.f90,hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/aerinterp.F90 b/physics/Interstitials/GFS/aerinterp.F90 similarity index 100% rename from physics/aerinterp.F90 rename to physics/Interstitials/GFS/aerinterp.F90 diff --git a/physics/cnvc90.f b/physics/Interstitials/GFS/cnvc90.f similarity index 100% rename from physics/cnvc90.f rename to physics/Interstitials/GFS/cnvc90.f diff --git a/physics/cnvc90.meta b/physics/Interstitials/GFS/cnvc90.meta similarity index 98% rename from physics/cnvc90.meta rename to physics/Interstitials/GFS/cnvc90.meta index 9728266d4..bbf161eb5 100644 --- a/physics/cnvc90.meta +++ b/physics/Interstitials/GFS/cnvc90.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = cnvc90 type = scheme - dependencies = + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/dcyc2t3.f b/physics/Interstitials/GFS/dcyc2t3.f similarity index 100% rename from physics/dcyc2t3.f rename to physics/Interstitials/GFS/dcyc2t3.f diff --git a/physics/dcyc2t3.meta b/physics/Interstitials/GFS/dcyc2t3.meta similarity index 99% rename from physics/dcyc2t3.meta rename to physics/Interstitials/GFS/dcyc2t3.meta index 65b05f4b3..95b3f341b 100644 --- a/physics/dcyc2t3.meta +++ b/physics/Interstitials/GFS/dcyc2t3.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = dcyc2t3 type = scheme - dependencies = machine.F,physcons.F90 + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/gcycle.F90 b/physics/Interstitials/GFS/gcycle.F90 similarity index 100% rename from physics/gcycle.F90 rename to physics/Interstitials/GFS/gcycle.F90 diff --git a/physics/iccn_def.F b/physics/Interstitials/GFS/iccn_def.F similarity index 100% rename from physics/iccn_def.F rename to physics/Interstitials/GFS/iccn_def.F diff --git a/physics/iccninterp.F90 b/physics/Interstitials/GFS/iccninterp.F90 similarity index 100% rename from physics/iccninterp.F90 rename to physics/Interstitials/GFS/iccninterp.F90 diff --git a/physics/maximum_hourly_diagnostics.F90 b/physics/Interstitials/GFS/maximum_hourly_diagnostics.F90 similarity index 100% rename from physics/maximum_hourly_diagnostics.F90 rename to physics/Interstitials/GFS/maximum_hourly_diagnostics.F90 diff --git a/physics/maximum_hourly_diagnostics.meta b/physics/Interstitials/GFS/maximum_hourly_diagnostics.meta similarity index 99% rename from physics/maximum_hourly_diagnostics.meta rename to physics/Interstitials/GFS/maximum_hourly_diagnostics.meta index e9d0876d2..0c2d1bcbe 100644 --- a/physics/maximum_hourly_diagnostics.meta +++ b/physics/Interstitials/GFS/maximum_hourly_diagnostics.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = maximum_hourly_diagnostics type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/phys_tend.F90 b/physics/Interstitials/GFS/phys_tend.F90 similarity index 100% rename from physics/phys_tend.F90 rename to physics/Interstitials/GFS/phys_tend.F90 diff --git a/physics/phys_tend.meta b/physics/Interstitials/GFS/phys_tend.meta similarity index 98% rename from physics/phys_tend.meta rename to physics/Interstitials/GFS/phys_tend.meta index 0f78af20b..d2a7bcf6b 100644 --- a/physics/phys_tend.meta +++ b/physics/Interstitials/GFS/phys_tend.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = phys_tend type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/scm_sfc_flux_spec.F90 b/physics/Interstitials/GFS/scm_sfc_flux_spec.F90 similarity index 100% rename from physics/scm_sfc_flux_spec.F90 rename to physics/Interstitials/GFS/scm_sfc_flux_spec.F90 diff --git a/physics/scm_sfc_flux_spec.meta b/physics/Interstitials/GFS/scm_sfc_flux_spec.meta similarity index 99% rename from physics/scm_sfc_flux_spec.meta rename to physics/Interstitials/GFS/scm_sfc_flux_spec.meta index 52722f1c4..85bf403ad 100644 --- a/physics/scm_sfc_flux_spec.meta +++ b/physics/Interstitials/GFS/scm_sfc_flux_spec.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = scm_sfc_flux_spec type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/sfcsub.F b/physics/Interstitials/GFS/sfcsub.F similarity index 100% rename from physics/sfcsub.F rename to physics/Interstitials/GFS/sfcsub.F diff --git a/physics/sgscloud_radpost.F90 b/physics/Interstitials/GFS/sgscloud_radpost.F90 similarity index 100% rename from physics/sgscloud_radpost.F90 rename to physics/Interstitials/GFS/sgscloud_radpost.F90 diff --git a/physics/sgscloud_radpost.meta b/physics/Interstitials/GFS/sgscloud_radpost.meta similarity index 98% rename from physics/sgscloud_radpost.meta rename to physics/Interstitials/GFS/sgscloud_radpost.meta index 6ad91d496..046531a0a 100644 --- a/physics/sgscloud_radpost.meta +++ b/physics/Interstitials/GFS/sgscloud_radpost.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sgscloud_radpost type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/sgscloud_radpre.F90 b/physics/Interstitials/GFS/sgscloud_radpre.F90 similarity index 100% rename from physics/sgscloud_radpre.F90 rename to physics/Interstitials/GFS/sgscloud_radpre.F90 diff --git a/physics/sgscloud_radpre.meta b/physics/Interstitials/GFS/sgscloud_radpre.meta similarity index 98% rename from physics/sgscloud_radpre.meta rename to physics/Interstitials/GFS/sgscloud_radpre.meta index d5341bcd4..c9fd5950c 100644 --- a/physics/sgscloud_radpre.meta +++ b/physics/Interstitials/GFS/sgscloud_radpre.meta @@ -1,7 +1,10 @@ [ccpp-table-properties] name = sgscloud_radpre type = scheme - dependencies = funcphys.f90,iounitdef.f,machine.F,module_bfmicrophysics.f,physcons.F90,radcons.f90,radiation_clouds.f,module_mp_thompson.F90 + relative_path = ../../ + dependencies = tools/funcphys.f90,Radiation/iounitdef.f,hooks/machine.F,hooks/physcons.F90 + dependencies = hooks/physcons.F90,Radiation/RRTMG/radcons.f90 + dependencies = Radiation/radiation_clouds.f,MP/Thompson/module_mp_thompson.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/clm_lake.f90 b/physics/Land/CLM_lake/clm_lake.f90 similarity index 100% rename from physics/clm_lake.f90 rename to physics/Land/CLM_lake/clm_lake.f90 diff --git a/physics/clm_lake.meta b/physics/Land/CLM_lake/clm_lake.meta similarity index 99% rename from physics/clm_lake.meta rename to physics/Land/CLM_lake/clm_lake.meta index bbaaded16..49564f66c 100644 --- a/physics/clm_lake.meta +++ b/physics/Land/CLM_lake/clm_lake.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = clm_lake type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/flake.F90 b/physics/Land/Flake/flake.F90 similarity index 100% rename from physics/flake.F90 rename to physics/Land/Flake/flake.F90 diff --git a/physics/flake_driver.F90 b/physics/Land/Flake/flake_driver.F90 similarity index 100% rename from physics/flake_driver.F90 rename to physics/Land/Flake/flake_driver.F90 diff --git a/physics/flake_driver.meta b/physics/Land/Flake/flake_driver.meta similarity index 99% rename from physics/flake_driver.meta rename to physics/Land/Flake/flake_driver.meta index e665dc962..8b295bc27 100644 --- a/physics/flake_driver.meta +++ b/physics/Land/Flake/flake_driver.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = flake_driver type = scheme - dependencies = flake.F90,machine.F + dependencies = ../../hooks/machine.F,flake.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/lsm_noah.f b/physics/Land/Noah/lsm_noah.f similarity index 100% rename from physics/lsm_noah.f rename to physics/Land/Noah/lsm_noah.f diff --git a/physics/lsm_noah.meta b/physics/Land/Noah/lsm_noah.meta similarity index 99% rename from physics/lsm_noah.meta rename to physics/Land/Noah/lsm_noah.meta index e059a22c6..2dc612d5b 100644 --- a/physics/lsm_noah.meta +++ b/physics/Land/Noah/lsm_noah.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = lsm_noah type = scheme - dependencies = funcphys.f90,machine.F,set_soilveg.f,sflx.f,surface_perturbation.F90 + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F + dependencies = ../set_soilveg.f,sflx.f,surface_perturbation.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/sflx.f b/physics/Land/Noah/sflx.f similarity index 100% rename from physics/sflx.f rename to physics/Land/Noah/sflx.f diff --git a/physics/surface_perturbation.F90 b/physics/Land/Noah/surface_perturbation.F90 similarity index 100% rename from physics/surface_perturbation.F90 rename to physics/Land/Noah/surface_perturbation.F90 diff --git a/physics/module_sf_noahmp_glacier.F90 b/physics/Land/Noahmp/module_sf_noahmp_glacier.F90 similarity index 100% rename from physics/module_sf_noahmp_glacier.F90 rename to physics/Land/Noahmp/module_sf_noahmp_glacier.F90 diff --git a/physics/module_sf_noahmplsm.F90 b/physics/Land/Noahmp/module_sf_noahmplsm.F90 similarity index 100% rename from physics/module_sf_noahmplsm.F90 rename to physics/Land/Noahmp/module_sf_noahmplsm.F90 diff --git a/physics/noahmp_tables.f90 b/physics/Land/Noahmp/noahmp_tables.f90 similarity index 100% rename from physics/noahmp_tables.f90 rename to physics/Land/Noahmp/noahmp_tables.f90 diff --git a/physics/noahmpdrv.F90 b/physics/Land/Noahmp/noahmpdrv.F90 similarity index 100% rename from physics/noahmpdrv.F90 rename to physics/Land/Noahmp/noahmpdrv.F90 diff --git a/physics/noahmpdrv.meta b/physics/Land/Noahmp/noahmpdrv.meta similarity index 99% rename from physics/noahmpdrv.meta rename to physics/Land/Noahmp/noahmpdrv.meta index 820da5740..55a787cd7 100644 --- a/physics/noahmpdrv.meta +++ b/physics/Land/Noahmp/noahmpdrv.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = noahmpdrv type = scheme - dependencies = funcphys.f90,machine.F,sfc_diff.f,module_sf_noahmp_glacier.F90,module_sf_noahmplsm.F90,noahmp_tables.f90,set_soilveg.f + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,module_sf_noahmp_glacier.F90,module_sf_noahmplsm.F90,noahmp_tables.f90,../set_soilveg.f ######################################################################## [ccpp-arg-table] diff --git a/physics/noahmptable.tbl b/physics/Land/Noahmp/noahmptable.tbl similarity index 100% rename from physics/noahmptable.tbl rename to physics/Land/Noahmp/noahmptable.tbl diff --git a/physics/lsm_ruc.F90 b/physics/Land/RUC/lsm_ruc.F90 similarity index 100% rename from physics/lsm_ruc.F90 rename to physics/Land/RUC/lsm_ruc.F90 diff --git a/physics/lsm_ruc.meta b/physics/Land/RUC/lsm_ruc.meta similarity index 99% rename from physics/lsm_ruc.meta rename to physics/Land/RUC/lsm_ruc.meta index 34a5b8a8b..f02d6de67 100644 --- a/physics/lsm_ruc.meta +++ b/physics/Land/RUC/lsm_ruc.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = lsm_ruc type = scheme - dependencies = machine.F,module_sf_ruclsm.F90,module_soil_pre.F90,namelist_soilveg_ruc.F90,set_soilveg_ruc.F90 + dependencies = ../../hooks/machine.F,module_sf_ruclsm.F90,module_soil_pre.F90,namelist_soilveg_ruc.F90,set_soilveg_ruc.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/module_sf_ruclsm.F90 b/physics/Land/RUC/module_sf_ruclsm.F90 similarity index 100% rename from physics/module_sf_ruclsm.F90 rename to physics/Land/RUC/module_sf_ruclsm.F90 diff --git a/physics/module_soil_pre.F90 b/physics/Land/RUC/module_soil_pre.F90 similarity index 100% rename from physics/module_soil_pre.F90 rename to physics/Land/RUC/module_soil_pre.F90 diff --git a/physics/namelist_soilveg_ruc.F90 b/physics/Land/RUC/namelist_soilveg_ruc.F90 similarity index 100% rename from physics/namelist_soilveg_ruc.F90 rename to physics/Land/RUC/namelist_soilveg_ruc.F90 diff --git a/physics/set_soilveg_ruc.F90 b/physics/Land/RUC/set_soilveg_ruc.F90 similarity index 100% rename from physics/set_soilveg_ruc.F90 rename to physics/Land/RUC/set_soilveg_ruc.F90 diff --git a/physics/namelist_soilveg.f b/physics/Land/namelist_soilveg.f similarity index 100% rename from physics/namelist_soilveg.f rename to physics/Land/namelist_soilveg.f diff --git a/physics/set_soilveg.f b/physics/Land/set_soilveg.f similarity index 100% rename from physics/set_soilveg.f rename to physics/Land/set_soilveg.f diff --git a/physics/module_MP_FER_HIRES.F90 b/physics/MP/Ferrier_Aligo/module_MP_FER_HIRES.F90 similarity index 100% rename from physics/module_MP_FER_HIRES.F90 rename to physics/MP/Ferrier_Aligo/module_MP_FER_HIRES.F90 diff --git a/physics/mp_fer_hires.F90 b/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 similarity index 100% rename from physics/mp_fer_hires.F90 rename to physics/MP/Ferrier_Aligo/mp_fer_hires.F90 diff --git a/physics/mp_fer_hires.meta b/physics/MP/Ferrier_Aligo/mp_fer_hires.meta similarity index 99% rename from physics/mp_fer_hires.meta rename to physics/MP/Ferrier_Aligo/mp_fer_hires.meta index 9f7c63d4d..0f7be213e 100644 --- a/physics/mp_fer_hires.meta +++ b/physics/MP/Ferrier_Aligo/mp_fer_hires.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mp_fer_hires type = scheme - dependencies = machine.F,module_MP_FER_HIRES.F90 + dependencies = ../../hooks/machine.F,module_MP_FER_HIRES.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/GFDL_parse_tracers.F90 b/physics/MP/GFDL/GFDL_parse_tracers.F90 similarity index 100% rename from physics/GFDL_parse_tracers.F90 rename to physics/MP/GFDL/GFDL_parse_tracers.F90 diff --git a/physics/fv_sat_adj.F90 b/physics/MP/GFDL/fv_sat_adj.F90 similarity index 100% rename from physics/fv_sat_adj.F90 rename to physics/MP/GFDL/fv_sat_adj.F90 diff --git a/physics/fv_sat_adj.meta b/physics/MP/GFDL/fv_sat_adj.meta similarity index 99% rename from physics/fv_sat_adj.meta rename to physics/MP/GFDL/fv_sat_adj.meta index 5cdc96358..8c3c9be42 100644 --- a/physics/fv_sat_adj.meta +++ b/physics/MP/GFDL/fv_sat_adj.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = fv_sat_adj type = scheme - dependencies = machine.F,module_gfdl_cloud_microphys.F90,module_mp_radar.F90,multi_gases.F90,physcons.F90 + dependencies = ../../hooks/machine.F,../../hooks/physcons.F90,module_gfdl_cloud_microphys.F90,multi_gases.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/gfdl_cloud_microphys.F90 b/physics/MP/GFDL/gfdl_cloud_microphys.F90 similarity index 100% rename from physics/gfdl_cloud_microphys.F90 rename to physics/MP/GFDL/gfdl_cloud_microphys.F90 diff --git a/physics/gfdl_cloud_microphys.meta b/physics/MP/GFDL/gfdl_cloud_microphys.meta similarity index 99% rename from physics/gfdl_cloud_microphys.meta rename to physics/MP/GFDL/gfdl_cloud_microphys.meta index 5e752b473..35b216d4a 100644 --- a/physics/gfdl_cloud_microphys.meta +++ b/physics/MP/GFDL/gfdl_cloud_microphys.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = gfdl_cloud_microphys type = scheme - dependencies = machine.F,module_mp_radar.F90,module_gfdl_cloud_microphys.F90 + dependencies = ../../hooks/machine.F,module_gfdl_cloud_microphys.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/gfdl_sfc_layer.F90 b/physics/MP/GFDL/gfdl_sfc_layer.F90 similarity index 100% rename from physics/gfdl_sfc_layer.F90 rename to physics/MP/GFDL/gfdl_sfc_layer.F90 diff --git a/physics/gfdl_sfc_layer.meta b/physics/MP/GFDL/gfdl_sfc_layer.meta similarity index 99% rename from physics/gfdl_sfc_layer.meta rename to physics/MP/GFDL/gfdl_sfc_layer.meta index f1c7a4ce2..a64fe277c 100644 --- a/physics/gfdl_sfc_layer.meta +++ b/physics/MP/GFDL/gfdl_sfc_layer.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = gfdl_sfc_layer type = scheme - dependencies = machine.F,module_sf_exchcoef.f90,namelist_soilveg_ruc.F90,noahmp_tables.f90 + dependencies = ../../hooks/machine.F,../SFC_Layer/module_sf_exchcoef.f90,../../Land/RUC/namelist_soilveg_ruc.F90,../../Land/Noahmp/noahmp_tables.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/module_gfdl_cloud_microphys.F90 b/physics/MP/GFDL/module_gfdl_cloud_microphys.F90 similarity index 100% rename from physics/module_gfdl_cloud_microphys.F90 rename to physics/MP/GFDL/module_gfdl_cloud_microphys.F90 diff --git a/physics/module_sf_exchcoef.f90 b/physics/MP/GFDL/module_sf_exchcoef.f90 similarity index 100% rename from physics/module_sf_exchcoef.f90 rename to physics/MP/GFDL/module_sf_exchcoef.f90 diff --git a/physics/multi_gases.F90 b/physics/MP/GFDL/multi_gases.F90 similarity index 100% rename from physics/multi_gases.F90 rename to physics/MP/GFDL/multi_gases.F90 diff --git a/physics/aer_cloud.F b/physics/MP/Morrison_Gettelman/aer_cloud.F similarity index 100% rename from physics/aer_cloud.F rename to physics/MP/Morrison_Gettelman/aer_cloud.F diff --git a/physics/aerclm_def.F b/physics/MP/Morrison_Gettelman/aerclm_def.F similarity index 100% rename from physics/aerclm_def.F rename to physics/MP/Morrison_Gettelman/aerclm_def.F diff --git a/physics/cldmacro.F b/physics/MP/Morrison_Gettelman/cldmacro.F similarity index 100% rename from physics/cldmacro.F rename to physics/MP/Morrison_Gettelman/cldmacro.F diff --git a/physics/cldwat2m_micro.F b/physics/MP/Morrison_Gettelman/cldwat2m_micro.F similarity index 100% rename from physics/cldwat2m_micro.F rename to physics/MP/Morrison_Gettelman/cldwat2m_micro.F diff --git a/physics/m_micro.F90 b/physics/MP/Morrison_Gettelman/m_micro.F90 similarity index 100% rename from physics/m_micro.F90 rename to physics/MP/Morrison_Gettelman/m_micro.F90 diff --git a/physics/m_micro.meta b/physics/MP/Morrison_Gettelman/m_micro.meta similarity index 99% rename from physics/m_micro.meta rename to physics/MP/Morrison_Gettelman/m_micro.meta index a9b5ec4db..4b6df18c7 100644 --- a/physics/m_micro.meta +++ b/physics/MP/Morrison_Gettelman/m_micro.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = m_micro type = scheme - dependencies = aer_cloud.F,aerclm_def.F,cldmacro.F,cldwat2m_micro.F,machine.F,micro_mg_utils.F90,micro_mg2_0.F90,micro_mg3_0.F90,physcons.F90,wv_saturation.F,machine.F + dependencies = ../../hooks/machine.F,../../hooks/physcons.F90,aer_cloud.F,aerclm_def.F,cldmacro.F,cldwat2m_micro.F,micro_mg_utils.F90,micro_mg2_0.F90,micro_mg3_0.F90,wv_saturation.F ######################################################################## [ccpp-arg-table] diff --git a/physics/m_micro_post.F90 b/physics/MP/Morrison_Gettelman/m_micro_post.F90 similarity index 100% rename from physics/m_micro_post.F90 rename to physics/MP/Morrison_Gettelman/m_micro_post.F90 diff --git a/physics/m_micro_post.meta b/physics/MP/Morrison_Gettelman/m_micro_post.meta similarity index 99% rename from physics/m_micro_post.meta rename to physics/MP/Morrison_Gettelman/m_micro_post.meta index 684ac3f21..88a4325e7 100644 --- a/physics/m_micro_post.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = m_micro_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/m_micro_pre.F90 b/physics/MP/Morrison_Gettelman/m_micro_pre.F90 similarity index 100% rename from physics/m_micro_pre.F90 rename to physics/MP/Morrison_Gettelman/m_micro_pre.F90 diff --git a/physics/m_micro_pre.meta b/physics/MP/Morrison_Gettelman/m_micro_pre.meta similarity index 99% rename from physics/m_micro_pre.meta rename to physics/MP/Morrison_Gettelman/m_micro_pre.meta index 7ac592833..b8cd2ac32 100644 --- a/physics/m_micro_pre.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = m_micro_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/micro_mg2_0.F90 b/physics/MP/Morrison_Gettelman/micro_mg2_0.F90 similarity index 100% rename from physics/micro_mg2_0.F90 rename to physics/MP/Morrison_Gettelman/micro_mg2_0.F90 diff --git a/physics/micro_mg3_0.F90 b/physics/MP/Morrison_Gettelman/micro_mg3_0.F90 similarity index 100% rename from physics/micro_mg3_0.F90 rename to physics/MP/Morrison_Gettelman/micro_mg3_0.F90 diff --git a/physics/micro_mg_utils.F90 b/physics/MP/Morrison_Gettelman/micro_mg_utils.F90 similarity index 100% rename from physics/micro_mg_utils.F90 rename to physics/MP/Morrison_Gettelman/micro_mg_utils.F90 diff --git a/physics/wv_saturation.F b/physics/MP/Morrison_Gettelman/wv_saturation.F similarity index 100% rename from physics/wv_saturation.F rename to physics/MP/Morrison_Gettelman/wv_saturation.F diff --git a/physics/module_mp_nssl_2mom.F90 b/physics/MP/NSSL/module_mp_nssl_2mom.F90 similarity index 100% rename from physics/module_mp_nssl_2mom.F90 rename to physics/MP/NSSL/module_mp_nssl_2mom.F90 diff --git a/physics/mp_nssl.F90 b/physics/MP/NSSL/mp_nssl.F90 similarity index 100% rename from physics/mp_nssl.F90 rename to physics/MP/NSSL/mp_nssl.F90 diff --git a/physics/mp_nssl.meta b/physics/MP/NSSL/mp_nssl.meta similarity index 99% rename from physics/mp_nssl.meta rename to physics/MP/NSSL/mp_nssl.meta index 6bbf92c73..ff7c82223 100644 --- a/physics/mp_nssl.meta +++ b/physics/MP/NSSL/mp_nssl.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mp_nssl type = scheme - dependencies = machine.F,module_mp_nssl_2mom.F90 + dependencies = ../../hooks/machine.F,module_mp_nssl_2mom.F90 [ccpp-arg-table] name = mp_nssl_init diff --git a/physics/module_mp_radar.F90 b/physics/MP/Thompson/module_mp_radar.F90 similarity index 100% rename from physics/module_mp_radar.F90 rename to physics/MP/Thompson/module_mp_radar.F90 diff --git a/physics/module_mp_thompson.F90 b/physics/MP/Thompson/module_mp_thompson.F90 similarity index 100% rename from physics/module_mp_thompson.F90 rename to physics/MP/Thompson/module_mp_thompson.F90 diff --git a/physics/module_mp_thompson_make_number_concentrations.F90 b/physics/MP/Thompson/module_mp_thompson_make_number_concentrations.F90 similarity index 100% rename from physics/module_mp_thompson_make_number_concentrations.F90 rename to physics/MP/Thompson/module_mp_thompson_make_number_concentrations.F90 diff --git a/physics/mp_thompson.F90 b/physics/MP/Thompson/mp_thompson.F90 similarity index 100% rename from physics/mp_thompson.F90 rename to physics/MP/Thompson/mp_thompson.F90 diff --git a/physics/mp_thompson.meta b/physics/MP/Thompson/mp_thompson.meta similarity index 99% rename from physics/mp_thompson.meta rename to physics/MP/Thompson/mp_thompson.meta index 691698281..c3795e10e 100644 --- a/physics/mp_thompson.meta +++ b/physics/MP/Thompson/mp_thompson.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mp_thompson type = scheme - dependencies = machine.F,module_mp_radar.F90,module_mp_thompson.F90,module_mp_thompson_make_number_concentrations.F90 + dependencies = ../../hooks/machine.F,module_mp_radar.F90,module_mp_thompson.F90,module_mp_thompson_make_number_concentrations.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/mp_thompson_post.F90 b/physics/MP/Thompson/mp_thompson_post.F90 similarity index 100% rename from physics/mp_thompson_post.F90 rename to physics/MP/Thompson/mp_thompson_post.F90 diff --git a/physics/mp_thompson_post.meta b/physics/MP/Thompson/mp_thompson_post.meta similarity index 98% rename from physics/mp_thompson_post.meta rename to physics/MP/Thompson/mp_thompson_post.meta index 82b035e99..43e89b29c 100644 --- a/physics/mp_thompson_post.meta +++ b/physics/MP/Thompson/mp_thompson_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mp_thompson_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/mp_thompson_pre.F90 b/physics/MP/Thompson/mp_thompson_pre.F90 similarity index 100% rename from physics/mp_thompson_pre.F90 rename to physics/MP/Thompson/mp_thompson_pre.F90 diff --git a/physics/mp_thompson_pre.meta b/physics/MP/Thompson/mp_thompson_pre.meta similarity index 97% rename from physics/mp_thompson_pre.meta rename to physics/MP/Thompson/mp_thompson_pre.meta index 12e812bb3..563eb2809 100644 --- a/physics/mp_thompson_pre.meta +++ b/physics/MP/Thompson/mp_thompson_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mp_thompson_pre type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/zhaocarr_gscond.f b/physics/MP/Zhao_Carr/zhaocarr_gscond.f similarity index 100% rename from physics/zhaocarr_gscond.f rename to physics/MP/Zhao_Carr/zhaocarr_gscond.f diff --git a/physics/zhaocarr_gscond.meta b/physics/MP/Zhao_Carr/zhaocarr_gscond.meta similarity index 98% rename from physics/zhaocarr_gscond.meta rename to physics/MP/Zhao_Carr/zhaocarr_gscond.meta index 493397722..ed57ca909 100644 --- a/physics/zhaocarr_gscond.meta +++ b/physics/MP/Zhao_Carr/zhaocarr_gscond.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = zhaocarr_gscond type = scheme - dependencies = funcphys.f90,machine.F,physcons.F90 + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,../../hooks/physcons.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/zhaocarr_precpd.f b/physics/MP/Zhao_Carr/zhaocarr_precpd.f similarity index 100% rename from physics/zhaocarr_precpd.f rename to physics/MP/Zhao_Carr/zhaocarr_precpd.f diff --git a/physics/zhaocarr_precpd.meta b/physics/MP/Zhao_Carr/zhaocarr_precpd.meta similarity index 98% rename from physics/zhaocarr_precpd.meta rename to physics/MP/Zhao_Carr/zhaocarr_precpd.meta index 67f1a530b..86e6c7d67 100644 --- a/physics/zhaocarr_precpd.meta +++ b/physics/MP/Zhao_Carr/zhaocarr_precpd.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = zhaocarr_precpd type = scheme - dependencies = funcphys.f90,machine.F,physcons.F90 + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,../../hooks/physcons.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/calpreciptype.f90 b/physics/MP/calpreciptype.f90 similarity index 100% rename from physics/calpreciptype.f90 rename to physics/MP/calpreciptype.f90 diff --git a/physics/gfs_phy_tracer_config.F b/physics/NOTUSED/gfs_phy_tracer_config.F similarity index 100% rename from physics/gfs_phy_tracer_config.F rename to physics/NOTUSED/gfs_phy_tracer_config.F diff --git a/physics/gocart_tracer_config_stub.f b/physics/NOTUSED/gocart_tracer_config_stub.f similarity index 100% rename from physics/gocart_tracer_config_stub.f rename to physics/NOTUSED/gocart_tracer_config_stub.f diff --git a/physics/rrtmg_lw_pre.F90 b/physics/NOTUSED/rrtmg_lw_pre.F90 similarity index 100% rename from physics/rrtmg_lw_pre.F90 rename to physics/NOTUSED/rrtmg_lw_pre.F90 diff --git a/physics/rrtmg_lw_pre.meta b/physics/NOTUSED/rrtmg_lw_pre.meta similarity index 100% rename from physics/rrtmg_lw_pre.meta rename to physics/NOTUSED/rrtmg_lw_pre.meta diff --git a/physics/hedmf.f b/physics/PBL/HEDMF/hedmf.f similarity index 100% rename from physics/hedmf.f rename to physics/PBL/HEDMF/hedmf.f diff --git a/physics/hedmf.meta b/physics/PBL/HEDMF/hedmf.meta similarity index 99% rename from physics/hedmf.meta rename to physics/PBL/HEDMF/hedmf.meta index c2d873065..be0c83741 100644 --- a/physics/hedmf.meta +++ b/physics/PBL/HEDMF/hedmf.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = hedmf type = scheme - dependencies = funcphys.f90,machine.F,mfpbl.f,physcons.F90,tridi.f + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,../../hooks/physcons.F90,../mfpbl.f,../tridi.f ######################################################################## [ccpp-arg-table] diff --git a/physics/module_BL_MYJPBL.F90 b/physics/PBL/MYJ/module_BL_MYJPBL.F90 similarity index 100% rename from physics/module_BL_MYJPBL.F90 rename to physics/PBL/MYJ/module_BL_MYJPBL.F90 diff --git a/physics/myjpbl_wrapper.F90 b/physics/PBL/MYJ/myjpbl_wrapper.F90 similarity index 100% rename from physics/myjpbl_wrapper.F90 rename to physics/PBL/MYJ/myjpbl_wrapper.F90 diff --git a/physics/myjpbl_wrapper.meta b/physics/PBL/MYJ/myjpbl_wrapper.meta similarity index 99% rename from physics/myjpbl_wrapper.meta rename to physics/PBL/MYJ/myjpbl_wrapper.meta index 427088b86..281396eed 100644 --- a/physics/myjpbl_wrapper.meta +++ b/physics/PBL/MYJ/myjpbl_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = myjpbl_wrapper type = scheme - dependencies = module_BL_MYJPBL.F90 + dependencies = ../../hooks/machine.F,module_BL_MYJPBL.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/bl_mynn_common.f90 b/physics/PBL/MYNN_EDMF/bl_mynn_common.f90 similarity index 100% rename from physics/bl_mynn_common.f90 rename to physics/PBL/MYNN_EDMF/bl_mynn_common.f90 diff --git a/physics/module_bl_mynn.F90 b/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 similarity index 100% rename from physics/module_bl_mynn.F90 rename to physics/PBL/MYNN_EDMF/module_bl_mynn.F90 diff --git a/physics/mynnedmf_wrapper.F90 b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 similarity index 100% rename from physics/mynnedmf_wrapper.F90 rename to physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 diff --git a/physics/mynnedmf_wrapper.meta b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta similarity index 99% rename from physics/mynnedmf_wrapper.meta rename to physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta index ec4706aba..8e88d9620 100644 --- a/physics/mynnedmf_wrapper.meta +++ b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mynnedmf_wrapper type = scheme - dependencies = machine.F,module_bl_mynn.F90,physcons.F90,bl_mynn_common.f90 + dependencies = ../../hooks/machine.F,module_bl_mynn.F90,bl_mynn_common.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/mfscu.f b/physics/PBL/SATMEDMF/mfscu.f similarity index 100% rename from physics/mfscu.f rename to physics/PBL/SATMEDMF/mfscu.f diff --git a/physics/mfscuq.f b/physics/PBL/SATMEDMF/mfscuq.f similarity index 100% rename from physics/mfscuq.f rename to physics/PBL/SATMEDMF/mfscuq.f diff --git a/physics/satmedmfvdif.F b/physics/PBL/SATMEDMF/satmedmfvdif.F similarity index 100% rename from physics/satmedmfvdif.F rename to physics/PBL/SATMEDMF/satmedmfvdif.F diff --git a/physics/satmedmfvdif.meta b/physics/PBL/SATMEDMF/satmedmfvdif.meta similarity index 99% rename from physics/satmedmfvdif.meta rename to physics/PBL/SATMEDMF/satmedmfvdif.meta index 3609ed50f..b94e74d6c 100644 --- a/physics/satmedmfvdif.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdif.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = satmedmfvdif type = scheme - dependencies = funcphys.f90,machine.F,mfpblt.f,mfscu.f,tridi.f + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,../mfpblt.f,mfscu.f,../tridi.f ######################################################################## [ccpp-arg-table] diff --git a/physics/satmedmfvdifq.F b/physics/PBL/SATMEDMF/satmedmfvdifq.F similarity index 100% rename from physics/satmedmfvdifq.F rename to physics/PBL/SATMEDMF/satmedmfvdifq.F diff --git a/physics/satmedmfvdifq.meta b/physics/PBL/SATMEDMF/satmedmfvdifq.meta similarity index 99% rename from physics/satmedmfvdifq.meta rename to physics/PBL/SATMEDMF/satmedmfvdifq.meta index b6680dccb..ff718f138 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = satmedmfvdifq type = scheme - dependencies = funcphys.f90,machine.F,mfpbltq.f,mfscuq.f,tridi.f + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,../mfpbltq.f,mfscuq.f,../tridi.f ######################################################################## [ccpp-arg-table] diff --git a/physics/moninshoc.f b/physics/PBL/SHOC/moninshoc.f similarity index 100% rename from physics/moninshoc.f rename to physics/PBL/SHOC/moninshoc.f diff --git a/physics/moninshoc.meta b/physics/PBL/SHOC/moninshoc.meta similarity index 99% rename from physics/moninshoc.meta rename to physics/PBL/SHOC/moninshoc.meta index dca5736f5..474689ea0 100644 --- a/physics/moninshoc.meta +++ b/physics/PBL/SHOC/moninshoc.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = moninshoc type = scheme - dependencies = funcphys.f90,machine.F,mfpbl.f,tridi.f + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,../mfpbl.f,../tridi.f ######################################################################## [ccpp-arg-table] diff --git a/physics/shoc.F90 b/physics/PBL/SHOC/shoc.F90 similarity index 100% rename from physics/shoc.F90 rename to physics/PBL/SHOC/shoc.F90 diff --git a/physics/shoc.meta b/physics/PBL/SHOC/shoc.meta similarity index 99% rename from physics/shoc.meta rename to physics/PBL/SHOC/shoc.meta index 984c6aec5..a1550ce11 100644 --- a/physics/shoc.meta +++ b/physics/PBL/SHOC/shoc.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = shoc type = scheme - dependencies = funcphys.f90,machine.F + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/ysuvdif.F90 b/physics/PBL/YSU/ysuvdif.F90 similarity index 100% rename from physics/ysuvdif.F90 rename to physics/PBL/YSU/ysuvdif.F90 diff --git a/physics/ysuvdif.meta b/physics/PBL/YSU/ysuvdif.meta similarity index 99% rename from physics/ysuvdif.meta rename to physics/PBL/YSU/ysuvdif.meta index 0007197bd..20e96a92d 100644 --- a/physics/ysuvdif.meta +++ b/physics/PBL/YSU/ysuvdif.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ysuvdif type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/mfpbl.f b/physics/PBL/mfpbl.f similarity index 100% rename from physics/mfpbl.f rename to physics/PBL/mfpbl.f diff --git a/physics/mfpblt.f b/physics/PBL/mfpblt.f similarity index 100% rename from physics/mfpblt.f rename to physics/PBL/mfpblt.f diff --git a/physics/mfpbltq.f b/physics/PBL/mfpbltq.f similarity index 100% rename from physics/mfpbltq.f rename to physics/PBL/mfpbltq.f diff --git a/physics/shinhongvdif.F90 b/physics/PBL/saYSU/shinhongvdif.F90 similarity index 100% rename from physics/shinhongvdif.F90 rename to physics/PBL/saYSU/shinhongvdif.F90 diff --git a/physics/shinhongvdif.meta b/physics/PBL/saYSU/shinhongvdif.meta similarity index 99% rename from physics/shinhongvdif.meta rename to physics/PBL/saYSU/shinhongvdif.meta index dcd3b96cd..8b1d48605 100644 --- a/physics/shinhongvdif.meta +++ b/physics/PBL/saYSU/shinhongvdif.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = shinhongvdif type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/tridi.f b/physics/PBL/tridi.f similarity index 100% rename from physics/tridi.f rename to physics/PBL/tridi.f diff --git a/physics/iounitdef.f b/physics/Radiation/RRTMG/iounitdef.f similarity index 100% rename from physics/iounitdef.f rename to physics/Radiation/RRTMG/iounitdef.f diff --git a/physics/module_bfmicrophysics.f b/physics/Radiation/RRTMG/module_bfmicrophysics.f similarity index 100% rename from physics/module_bfmicrophysics.f rename to physics/Radiation/RRTMG/module_bfmicrophysics.f diff --git a/physics/rad_sw_pre.F90 b/physics/Radiation/RRTMG/rad_sw_pre.F90 similarity index 100% rename from physics/rad_sw_pre.F90 rename to physics/Radiation/RRTMG/rad_sw_pre.F90 diff --git a/physics/rad_sw_pre.meta b/physics/Radiation/RRTMG/rad_sw_pre.meta similarity index 96% rename from physics/rad_sw_pre.meta rename to physics/Radiation/RRTMG/rad_sw_pre.meta index ccbdbf74b..9d14c6ffc 100644 --- a/physics/rad_sw_pre.meta +++ b/physics/Radiation/RRTMG/rad_sw_pre.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rad_sw_pre type = scheme - dependencies = iounitdef.f,machine.F + dependencies = iounitdef.f,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/radcons.f90 b/physics/Radiation/RRTMG/radcons.f90 similarity index 100% rename from physics/radcons.f90 rename to physics/Radiation/RRTMG/radcons.f90 diff --git a/physics/radlw_datatb.f b/physics/Radiation/RRTMG/radlw_datatb.f similarity index 100% rename from physics/radlw_datatb.f rename to physics/Radiation/RRTMG/radlw_datatb.f diff --git a/physics/radlw_main.F90 b/physics/Radiation/RRTMG/radlw_main.F90 similarity index 100% rename from physics/radlw_main.F90 rename to physics/Radiation/RRTMG/radlw_main.F90 diff --git a/physics/radlw_main.meta b/physics/Radiation/RRTMG/radlw_main.meta similarity index 99% rename from physics/radlw_main.meta rename to physics/Radiation/RRTMG/radlw_main.meta index 3dccc97b3..f7c80fb20 100644 --- a/physics/radlw_main.meta +++ b/physics/Radiation/RRTMG/radlw_main.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmg_lw type = scheme - dependencies = machine.F,mersenne_twister.f,physcons.F90,radlw_datatb.f,radlw_param.f + dependencies = ../../hooks/machine.F,../mersenne_twister.f,../../hooks/physcons.F90,radlw_datatb.f,radlw_param.f ######################################################################## [ccpp-arg-table] diff --git a/physics/radlw_param.f b/physics/Radiation/RRTMG/radlw_param.f similarity index 100% rename from physics/radlw_param.f rename to physics/Radiation/RRTMG/radlw_param.f diff --git a/physics/radlw_param.meta b/physics/Radiation/RRTMG/radlw_param.meta similarity index 100% rename from physics/radlw_param.meta rename to physics/Radiation/RRTMG/radlw_param.meta diff --git a/physics/radsw_datatb.f b/physics/Radiation/RRTMG/radsw_datatb.f similarity index 100% rename from physics/radsw_datatb.f rename to physics/Radiation/RRTMG/radsw_datatb.f diff --git a/physics/radsw_main.F90 b/physics/Radiation/RRTMG/radsw_main.F90 similarity index 100% rename from physics/radsw_main.F90 rename to physics/Radiation/RRTMG/radsw_main.F90 diff --git a/physics/radsw_main.meta b/physics/Radiation/RRTMG/radsw_main.meta similarity index 99% rename from physics/radsw_main.meta rename to physics/Radiation/RRTMG/radsw_main.meta index 1edb6fcac..2169a26f0 100644 --- a/physics/radsw_main.meta +++ b/physics/Radiation/RRTMG/radsw_main.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmg_sw type = scheme - dependencies = machine.F,mersenne_twister.f,physcons.F90,radsw_datatb.f,radsw_param.f + dependencies = ../../hooks/machine.F,../mersenne_twister.f,../../hooks/physcons.F90,radsw_datatb.f,radsw_param.f ######################################################################## [ccpp-arg-table] diff --git a/physics/radsw_param.f b/physics/Radiation/RRTMG/radsw_param.f similarity index 100% rename from physics/radsw_param.f rename to physics/Radiation/RRTMG/radsw_param.f diff --git a/physics/radsw_param.meta b/physics/Radiation/RRTMG/radsw_param.meta similarity index 100% rename from physics/radsw_param.meta rename to physics/Radiation/RRTMG/radsw_param.meta diff --git a/physics/rrtmg_lw_cloud_optics.F90 b/physics/Radiation/RRTMG/rrtmg_lw_cloud_optics.F90 similarity index 100% rename from physics/rrtmg_lw_cloud_optics.F90 rename to physics/Radiation/RRTMG/rrtmg_lw_cloud_optics.F90 diff --git a/physics/rrtmg_lw_post.F90 b/physics/Radiation/RRTMG/rrtmg_lw_post.F90 similarity index 100% rename from physics/rrtmg_lw_post.F90 rename to physics/Radiation/RRTMG/rrtmg_lw_post.F90 diff --git a/physics/rrtmg_lw_post.meta b/physics/Radiation/RRTMG/rrtmg_lw_post.meta similarity index 99% rename from physics/rrtmg_lw_post.meta rename to physics/Radiation/RRTMG/rrtmg_lw_post.meta index 7f219c24f..6ed7c2365 100644 --- a/physics/rrtmg_lw_post.meta +++ b/physics/Radiation/RRTMG/rrtmg_lw_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmg_lw_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/rrtmg_sw_cloud_optics.F90 b/physics/Radiation/RRTMG/rrtmg_sw_cloud_optics.F90 similarity index 100% rename from physics/rrtmg_sw_cloud_optics.F90 rename to physics/Radiation/RRTMG/rrtmg_sw_cloud_optics.F90 diff --git a/physics/rrtmg_sw_post.F90 b/physics/Radiation/RRTMG/rrtmg_sw_post.F90 similarity index 100% rename from physics/rrtmg_sw_post.F90 rename to physics/Radiation/RRTMG/rrtmg_sw_post.F90 diff --git a/physics/rrtmg_sw_post.meta b/physics/Radiation/RRTMG/rrtmg_sw_post.meta similarity index 99% rename from physics/rrtmg_sw_post.meta rename to physics/Radiation/RRTMG/rrtmg_sw_post.meta index 6a9f4efb5..9914051ce 100644 --- a/physics/rrtmg_sw_post.meta +++ b/physics/Radiation/RRTMG/rrtmg_sw_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmg_sw_post type = scheme - dependencies = machine.F,radsw_param.f + dependencies = ../../hooks/machine.F,radsw_param.f ######################################################################## [ccpp-arg-table] diff --git a/physics/rrtmgp_aerosol_optics.F90 b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 similarity index 100% rename from physics/rrtmgp_aerosol_optics.F90 rename to physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.F90 diff --git a/physics/rrtmgp_aerosol_optics.meta b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta similarity index 98% rename from physics/rrtmgp_aerosol_optics.meta rename to physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta index cc9eb1cc2..0847877d6 100644 --- a/physics/rrtmgp_aerosol_optics.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmgp_aerosol_optics type = scheme - dependencies = iounitdef.f,machine.F,radiation_aerosols.f,radiation_tools.F90 + dependencies = ../iounitdef.f,../../hooks/machine.F,../radiation_aerosols.f,../radiation_tools.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/rrtmgp_lw_cloud_optics.F90 b/physics/Radiation/RRTMGP/rrtmgp_lw_cloud_optics.F90 similarity index 100% rename from physics/rrtmgp_lw_cloud_optics.F90 rename to physics/Radiation/RRTMGP/rrtmgp_lw_cloud_optics.F90 diff --git a/physics/rrtmgp_lw_gas_optics.F90 b/physics/Radiation/RRTMGP/rrtmgp_lw_gas_optics.F90 similarity index 100% rename from physics/rrtmgp_lw_gas_optics.F90 rename to physics/Radiation/RRTMGP/rrtmgp_lw_gas_optics.F90 diff --git a/physics/rrtmgp_lw_main.F90 b/physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 similarity index 100% rename from physics/rrtmgp_lw_main.F90 rename to physics/Radiation/RRTMGP/rrtmgp_lw_main.F90 diff --git a/physics/rrtmgp_lw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta similarity index 98% rename from physics/rrtmgp_lw_main.meta rename to physics/Radiation/RRTMGP/rrtmgp_lw_main.meta index fd96eb14b..011376985 100644 --- a/physics/rrtmgp_lw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta @@ -1,12 +1,13 @@ [ccpp-table-properties] name = rrtmgp_lw_main type = scheme - dependencies = machine.F,radiation_tools.F90,GFS_rrtmgp_pre.F90,rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90 + dependencies = ../../hooks/machine.F,../radiation_tools.F90,../mersenne_twister.f + dependencies = rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90,rte-rrtmgp/extensions/mo_fluxes_byband.F90 dependencies = rte-rrtmgp/rte/mo_rte_kind.F90,rte-rrtmgp/rrtmgp/mo_gas_concentrations.F90,rte-rrtmgp/rte/mo_optical_props.F90 dependencies = rte-rrtmgp/rte/mo_source_functions.F90,rte-rrtmgp/rte/mo_rte_lw.F90,rte-rrtmgp/rte/mo_fluxes.F90 dependencies = rte-rrtmgp/rte/kernels/mo_fluxes_broadband_kernels.F90, rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90 - dependencies = mersenne_twister.f,rrtmgp_sampling.F90,rte-rrtmgp/extensions/mo_fluxes_byband.F90 - dependencies = rrtmgp_lw_gas_optics.F90, rrtmgp_lw_cloud_optics.F90 + dependencies = rrtmgp_lw_gas_optics.F90, rrtmgp_lw_cloud_optics.F90,rrtmgp_sampling.F90 + dependencies = ../../GFS/GFS_rrtmgp_pre.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/rrtmgp_sampling.F90 b/physics/Radiation/RRTMGP/rrtmgp_sampling.F90 similarity index 100% rename from physics/rrtmgp_sampling.F90 rename to physics/Radiation/RRTMGP/rrtmgp_sampling.F90 diff --git a/physics/rrtmgp_sw_cloud_optics.F90 b/physics/Radiation/RRTMGP/rrtmgp_sw_cloud_optics.F90 similarity index 100% rename from physics/rrtmgp_sw_cloud_optics.F90 rename to physics/Radiation/RRTMGP/rrtmgp_sw_cloud_optics.F90 diff --git a/physics/rrtmgp_sw_gas_optics.F90 b/physics/Radiation/RRTMGP/rrtmgp_sw_gas_optics.F90 similarity index 100% rename from physics/rrtmgp_sw_gas_optics.F90 rename to physics/Radiation/RRTMGP/rrtmgp_sw_gas_optics.F90 diff --git a/physics/rrtmgp_sw_main.F90 b/physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 similarity index 100% rename from physics/rrtmgp_sw_main.F90 rename to physics/Radiation/RRTMGP/rrtmgp_sw_main.F90 diff --git a/physics/rrtmgp_sw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta similarity index 98% rename from physics/rrtmgp_sw_main.meta rename to physics/Radiation/RRTMGP/rrtmgp_sw_main.meta index dbb93a5df..932e2195e 100644 --- a/physics/rrtmgp_sw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta @@ -1,12 +1,13 @@ [ccpp-table-properties] name = rrtmgp_sw_main type = scheme - dependencies = machine.F,radiation_tools.F90,GFS_rrtmgp_pre.F90,rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90 + dependencies = ../../hooks/machine.F,../radiation_tools.F90,../mersenne_twister.f + dependencies = rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90,rte-rrtmgp/extensions/mo_fluxes_byband.F90 dependencies = rte-rrtmgp/rte/mo_rte_kind.F90,rte-rrtmgp/rrtmgp/mo_gas_concentrations.F90,rte-rrtmgp/rte/mo_optical_props.F90 dependencies = rte-rrtmgp/rte/mo_rte_sw.F90,rte-rrtmgp/rte/mo_fluxes.F90 dependencies = rte-rrtmgp/rte/kernels/mo_fluxes_broadband_kernels.F90, rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90 - dependencies = mersenne_twister.f,rrtmgp_sampling.F90,rte-rrtmgp/extensions/mo_fluxes_byband.F90 - dependencies = rrtmgp_sw_gas_optics.F90, rrtmgp_sw_cloud_optics.F90 + dependencies = rrtmgp_sw_gas_optics.F90, rrtmgp_sw_cloud_optics.F90,rrtmgp_sampling.F90 + dependencies = ../../GFS/GFS_rrtmgp_pre.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/mersenne_twister.f b/physics/Radiation/mersenne_twister.f similarity index 100% rename from physics/mersenne_twister.f rename to physics/Radiation/mersenne_twister.f diff --git a/physics/radiation_aerosols.f b/physics/Radiation/radiation_aerosols.f similarity index 100% rename from physics/radiation_aerosols.f rename to physics/Radiation/radiation_aerosols.f diff --git a/physics/radiation_astronomy.f b/physics/Radiation/radiation_astronomy.f similarity index 100% rename from physics/radiation_astronomy.f rename to physics/Radiation/radiation_astronomy.f diff --git a/physics/radiation_cloud_overlap.F90 b/physics/Radiation/radiation_cloud_overlap.F90 similarity index 100% rename from physics/radiation_cloud_overlap.F90 rename to physics/Radiation/radiation_cloud_overlap.F90 diff --git a/physics/radiation_clouds.f b/physics/Radiation/radiation_clouds.f similarity index 100% rename from physics/radiation_clouds.f rename to physics/Radiation/radiation_clouds.f diff --git a/physics/radiation_gases.f b/physics/Radiation/radiation_gases.f similarity index 100% rename from physics/radiation_gases.f rename to physics/Radiation/radiation_gases.f diff --git a/physics/radiation_surface.f b/physics/Radiation/radiation_surface.f similarity index 100% rename from physics/radiation_surface.f rename to physics/Radiation/radiation_surface.f diff --git a/physics/radiation_tools.F90 b/physics/Radiation/radiation_tools.F90 similarity index 100% rename from physics/radiation_tools.F90 rename to physics/Radiation/radiation_tools.F90 diff --git a/physics/date_def.f b/physics/SFC_Layer/GFS_sfc/date_def.f similarity index 100% rename from physics/date_def.f rename to physics/SFC_Layer/GFS_sfc/date_def.f diff --git a/physics/module_nst_model.f90 b/physics/SFC_Layer/GFS_sfc/module_nst_model.f90 similarity index 100% rename from physics/module_nst_model.f90 rename to physics/SFC_Layer/GFS_sfc/module_nst_model.f90 diff --git a/physics/module_nst_parameters.f90 b/physics/SFC_Layer/GFS_sfc/module_nst_parameters.f90 similarity index 100% rename from physics/module_nst_parameters.f90 rename to physics/SFC_Layer/GFS_sfc/module_nst_parameters.f90 diff --git a/physics/module_nst_water_prop.f90 b/physics/SFC_Layer/GFS_sfc/module_nst_water_prop.f90 similarity index 100% rename from physics/module_nst_water_prop.f90 rename to physics/SFC_Layer/GFS_sfc/module_nst_water_prop.f90 diff --git a/physics/sfc_cice.f b/physics/SFC_Layer/GFS_sfc/sfc_cice.f similarity index 100% rename from physics/sfc_cice.f rename to physics/SFC_Layer/GFS_sfc/sfc_cice.f diff --git a/physics/sfc_cice.meta b/physics/SFC_Layer/GFS_sfc/sfc_cice.meta similarity index 99% rename from physics/sfc_cice.meta rename to physics/SFC_Layer/GFS_sfc/sfc_cice.meta index 796fb2f5d..52fa28a3d 100644 --- a/physics/sfc_cice.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_cice.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = sfc_cice type = scheme - dependencies = machine.F + relative_path = ../../ + dependencies = hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_diag.f b/physics/SFC_Layer/GFS_sfc/sfc_diag.f similarity index 100% rename from physics/sfc_diag.f rename to physics/SFC_Layer/GFS_sfc/sfc_diag.f diff --git a/physics/sfc_diag.meta b/physics/SFC_Layer/GFS_sfc/sfc_diag.meta similarity index 99% rename from physics/sfc_diag.meta rename to physics/SFC_Layer/GFS_sfc/sfc_diag.meta index a16290b58..6a82c2c61 100644 --- a/physics/sfc_diag.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_diag.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = sfc_diag type = scheme - dependencies = funcphys.f90,machine.F + relative_path = ../../ + dependencies = tools/funcphys.f90,hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_diag_post.F90 b/physics/SFC_Layer/GFS_sfc/sfc_diag_post.F90 similarity index 100% rename from physics/sfc_diag_post.F90 rename to physics/SFC_Layer/GFS_sfc/sfc_diag_post.F90 diff --git a/physics/sfc_diag_post.meta b/physics/SFC_Layer/GFS_sfc/sfc_diag_post.meta similarity index 98% rename from physics/sfc_diag_post.meta rename to physics/SFC_Layer/GFS_sfc/sfc_diag_post.meta index c50d3c4dc..8c74e2154 100644 --- a/physics/sfc_diag_post.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_diag_post.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = sfc_diag_post type = scheme - dependencies = machine.F + relative_path = ../../ + dependencies = hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_diff.f b/physics/SFC_Layer/GFS_sfc/sfc_diff.f similarity index 100% rename from physics/sfc_diff.f rename to physics/SFC_Layer/GFS_sfc/sfc_diff.f diff --git a/physics/sfc_diff.meta b/physics/SFC_Layer/GFS_sfc/sfc_diff.meta similarity index 99% rename from physics/sfc_diff.meta rename to physics/SFC_Layer/GFS_sfc/sfc_diff.meta index eb30b8c50..b9f0c4f84 100644 --- a/physics/sfc_diff.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_diff.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = sfc_diff type = scheme - dependencies = machine.F + relative_path = ../../ + dependencies = hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_nst.f b/physics/SFC_Layer/GFS_sfc/sfc_nst.f similarity index 100% rename from physics/sfc_nst.f rename to physics/SFC_Layer/GFS_sfc/sfc_nst.f diff --git a/physics/sfc_nst.meta b/physics/SFC_Layer/GFS_sfc/sfc_nst.meta similarity index 99% rename from physics/sfc_nst.meta rename to physics/SFC_Layer/GFS_sfc/sfc_nst.meta index dc35ec959..131daaab0 100644 --- a/physics/sfc_nst.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_nst.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sfc_nst type = scheme - dependencies = date_def.f,funcphys.f90,machine.F,module_nst_model.f90,module_nst_parameters.f90,module_nst_water_prop.f90 + dependencies = date_def.f,../../tools/funcphys.f90,../../hooks/machine.F,module_nst_model.f90,module_nst_parameters.f90,module_nst_water_prop.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_nst_post.f b/physics/SFC_Layer/GFS_sfc/sfc_nst_post.f similarity index 100% rename from physics/sfc_nst_post.f rename to physics/SFC_Layer/GFS_sfc/sfc_nst_post.f diff --git a/physics/sfc_nst_post.meta b/physics/SFC_Layer/GFS_sfc/sfc_nst_post.meta similarity index 98% rename from physics/sfc_nst_post.meta rename to physics/SFC_Layer/GFS_sfc/sfc_nst_post.meta index 7f66118e9..caa487384 100644 --- a/physics/sfc_nst_post.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_nst_post.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = sfc_nst_post type = scheme - dependencies = machine.F,module_nst_parameters.f90,module_nst_water_prop.f90 + dependencies = ../../hooks/machine.F,module_nst_parameters.f90,module_nst_water_prop.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_nst_pre.f b/physics/SFC_Layer/GFS_sfc/sfc_nst_pre.f similarity index 100% rename from physics/sfc_nst_pre.f rename to physics/SFC_Layer/GFS_sfc/sfc_nst_pre.f diff --git a/physics/sfc_nst_pre.meta b/physics/SFC_Layer/GFS_sfc/sfc_nst_pre.meta similarity index 97% rename from physics/sfc_nst_pre.meta rename to physics/SFC_Layer/GFS_sfc/sfc_nst_pre.meta index 88788ff5c..e9cdef0d1 100644 --- a/physics/sfc_nst_pre.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_nst_pre.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = sfc_nst_pre type = scheme - dependencies = machine.F,module_nst_parameters.f90,module_nst_water_prop.f90 + dependencies = ../../hooks/machine.F,module_nst_parameters.f90,module_nst_water_prop.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_ocean.F b/physics/SFC_Layer/GFS_sfc/sfc_ocean.F similarity index 100% rename from physics/sfc_ocean.F rename to physics/SFC_Layer/GFS_sfc/sfc_ocean.F diff --git a/physics/sfc_ocean.meta b/physics/SFC_Layer/GFS_sfc/sfc_ocean.meta similarity index 99% rename from physics/sfc_ocean.meta rename to physics/SFC_Layer/GFS_sfc/sfc_ocean.meta index 15812e723..ea575a071 100644 --- a/physics/sfc_ocean.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_ocean.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sfc_ocean type = scheme - dependencies = funcphys.f90,machine.F + dependencies = ../../tools/funcphys.f90,../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/sfc_sice.f b/physics/SFC_Layer/GFS_sfc/sfc_sice.f similarity index 100% rename from physics/sfc_sice.f rename to physics/SFC_Layer/GFS_sfc/sfc_sice.f diff --git a/physics/sfc_sice.meta b/physics/SFC_Layer/GFS_sfc/sfc_sice.meta similarity index 99% rename from physics/sfc_sice.meta rename to physics/SFC_Layer/GFS_sfc/sfc_sice.meta index 75aab21a4..7277c0511 100644 --- a/physics/sfc_sice.meta +++ b/physics/SFC_Layer/GFS_sfc/sfc_sice.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = sfc_sice type = scheme - dependencies = funcphys.f90,machine.F + relative_path = ../../ + dependencies = tools/funcphys.f90,hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/module_SF_JSFC.F90 b/physics/SFC_Layer/MYJ/module_SF_JSFC.F90 similarity index 100% rename from physics/module_SF_JSFC.F90 rename to physics/SFC_Layer/MYJ/module_SF_JSFC.F90 diff --git a/physics/myjsfc_wrapper.F90 b/physics/SFC_Layer/MYJ/myjsfc_wrapper.F90 similarity index 100% rename from physics/myjsfc_wrapper.F90 rename to physics/SFC_Layer/MYJ/myjsfc_wrapper.F90 diff --git a/physics/myjsfc_wrapper.meta b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta similarity index 99% rename from physics/myjsfc_wrapper.meta rename to physics/SFC_Layer/MYJ/myjsfc_wrapper.meta index 40b6b78f3..9805db619 100644 --- a/physics/myjsfc_wrapper.meta +++ b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = myjsfc_wrapper type = scheme - dependencies = module_SF_JSFC.F90 + dependencies = ../../hooks/machine.f,module_SF_JSFC.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/module_sf_mynn.F90 b/physics/SFC_Layer/MYNN/module_sf_mynn.F90 similarity index 100% rename from physics/module_sf_mynn.F90 rename to physics/SFC_Layer/MYNN/module_sf_mynn.F90 diff --git a/physics/mynnsfc_wrapper.F90 b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 similarity index 100% rename from physics/mynnsfc_wrapper.F90 rename to physics/SFC_Layer/MYNN/mynnsfc_wrapper.F90 diff --git a/physics/mynnsfc_wrapper.meta b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta similarity index 99% rename from physics/mynnsfc_wrapper.meta rename to physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta index d89cc5d35..a76df3790 100644 --- a/physics/mynnsfc_wrapper.meta +++ b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mynnsfc_wrapper type = scheme - dependencies = machine.F,module_sf_mynn.F90 + dependencies = ../../hooks/machine.F,module_sf_mynn.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/h2o_def.f b/physics/h2o_photo/h2o_def.f similarity index 100% rename from physics/h2o_def.f rename to physics/h2o_photo/h2o_def.f diff --git a/physics/h2o_def.meta b/physics/h2o_photo/h2o_def.meta similarity index 94% rename from physics/h2o_def.meta rename to physics/h2o_photo/h2o_def.meta index 17f0f8779..3bb9bf94d 100644 --- a/physics/h2o_def.meta +++ b/physics/h2o_photo/h2o_def.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = h2o_def type = module - dependencies = machine.F + dependencies = ../../hooks/machine.F [ccpp-arg-table] name = h2o_def diff --git a/physics/h2ointerp.f90 b/physics/h2o_photo/h2ointerp.f90 similarity index 100% rename from physics/h2ointerp.f90 rename to physics/h2o_photo/h2ointerp.f90 diff --git a/physics/h2ophys.f b/physics/h2o_photo/h2ophys.f similarity index 100% rename from physics/h2ophys.f rename to physics/h2o_photo/h2ophys.f diff --git a/physics/h2ophys.meta b/physics/h2o_photo/h2ophys.meta similarity index 98% rename from physics/h2ophys.meta rename to physics/h2o_photo/h2ophys.meta index afe50bda1..d8a9eabab 100644 --- a/physics/h2ophys.meta +++ b/physics/h2o_photo/h2ophys.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = h2ophys type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/machine.F b/physics/hooks/machine.F similarity index 100% rename from physics/machine.F rename to physics/hooks/machine.F diff --git a/physics/machine.meta b/physics/hooks/machine.meta similarity index 100% rename from physics/machine.meta rename to physics/hooks/machine.meta diff --git a/physics/physcons.F90 b/physics/hooks/physcons.F90 similarity index 100% rename from physics/physcons.F90 rename to physics/hooks/physcons.F90 diff --git a/physics/ozinterp.f90 b/physics/o3_photo/ozinterp.f90 similarity index 100% rename from physics/ozinterp.f90 rename to physics/o3_photo/ozinterp.f90 diff --git a/physics/ozne_def.f b/physics/o3_photo/ozne_def.f similarity index 100% rename from physics/ozne_def.f rename to physics/o3_photo/ozne_def.f diff --git a/physics/ozne_def.meta b/physics/o3_photo/ozne_def.meta similarity index 95% rename from physics/ozne_def.meta rename to physics/o3_photo/ozne_def.meta index 3cad9c14d..3123892bb 100644 --- a/physics/ozne_def.meta +++ b/physics/o3_photo/ozne_def.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ozne_def type = module - dependencies = machine.F + dependencies = ../../hooks/machine.F [ccpp-arg-table] name = ozne_def diff --git a/physics/ozphys.f b/physics/o3_photo/ozphys.f similarity index 100% rename from physics/ozphys.f rename to physics/o3_photo/ozphys.f diff --git a/physics/ozphys.meta b/physics/o3_photo/ozphys.meta similarity index 99% rename from physics/ozphys.meta rename to physics/o3_photo/ozphys.meta index 485e2a491..631dcb332 100644 --- a/physics/ozphys.meta +++ b/physics/o3_photo/ozphys.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ozphys type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/ozphys_2015.f b/physics/o3_photo/ozphys_2015.f similarity index 100% rename from physics/ozphys_2015.f rename to physics/o3_photo/ozphys_2015.f diff --git a/physics/ozphys_2015.meta b/physics/o3_photo/ozphys_2015.meta similarity index 99% rename from physics/ozphys_2015.meta rename to physics/o3_photo/ozphys_2015.meta index 8bce7defe..7da8cdf27 100644 --- a/physics/ozphys_2015.meta +++ b/physics/o3_photo/ozphys_2015.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ozphys_2015 type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/rte-rrtmgp b/physics/rte-rrtmgp deleted file mode 160000 index 0dc54f5ec..000000000 --- a/physics/rte-rrtmgp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0dc54f5ecaeb1e1e342efd1e02d0bcd41737bde2 diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.meta b/physics/smoke_dust/rrfs_smoke_postpbl.meta index 50f7afae7..339f6ca03 100755 --- a/physics/smoke_dust/rrfs_smoke_postpbl.meta +++ b/physics/smoke_dust/rrfs_smoke_postpbl.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_postpbl type = scheme - dependencies = dep_dry_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90 + dependencies = machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index bf2fddd60..5bf86c6bd 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_wrapper type = scheme - dependencies = dep_dry_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90 + dependencies = machine.F,dep_dry_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/funcphys.f90 b/physics/tools/funcphys.f90 similarity index 100% rename from physics/funcphys.f90 rename to physics/tools/funcphys.f90 diff --git a/physics/get_phi_fv3.F90 b/physics/tools/get_phi_fv3.F90 similarity index 100% rename from physics/get_phi_fv3.F90 rename to physics/tools/get_phi_fv3.F90 diff --git a/physics/get_phi_fv3.meta b/physics/tools/get_phi_fv3.meta similarity index 97% rename from physics/get_phi_fv3.meta rename to physics/tools/get_phi_fv3.meta index cbca14080..5c162c746 100644 --- a/physics/get_phi_fv3.meta +++ b/physics/tools/get_phi_fv3.meta @@ -2,7 +2,7 @@ [ccpp-table-properties] name = get_phi_fv3 type = scheme - dependencies = machine.F,physcons.F90 + dependencies = ../hooks/machine.F,../hooks/physcons.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/get_prs_fv3.F90 b/physics/tools/get_prs_fv3.F90 similarity index 100% rename from physics/get_prs_fv3.F90 rename to physics/tools/get_prs_fv3.F90 diff --git a/physics/get_prs_fv3.meta b/physics/tools/get_prs_fv3.meta similarity index 98% rename from physics/get_prs_fv3.meta rename to physics/tools/get_prs_fv3.meta index c26f5c308..4cdad7566 100644 --- a/physics/get_prs_fv3.meta +++ b/physics/tools/get_prs_fv3.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = get_prs_fv3 type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] From 53eda4d0e2af5d8ded2182b08fd9fbafa1b55114 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 5 Sep 2023 15:11:58 +0000 Subject: [PATCH 040/249] Address comments from review. --- physics/CONV/{CCC => C3}/cu_c3_deep.F90 | 0 physics/CONV/{CCC => C3}/cu_c3_driver.F90 | 0 physics/CONV/{CCC => C3}/cu_c3_driver.meta | 0 physics/CONV/{CCC => C3}/cu_c3_driver_post.F90 | 0 physics/CONV/{CCC => C3}/cu_c3_driver_post.meta | 0 physics/CONV/{CCC => C3}/cu_c3_driver_pre.F90 | 0 physics/CONV/{CCC => C3}/cu_c3_driver_pre.meta | 0 physics/CONV/{CCC => C3}/cu_c3_sh.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_post.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_pre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_pre.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_post.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_pre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_pre.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_post.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_pre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_pre.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_common.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_post.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_pre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_pre.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_post.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_pre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_pre.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_cloud_diagnostics.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_cloud_diagnostics.meta | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_debug.F90 | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_debug.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.fv3.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.fv3.meta | 2 +- .../{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.scm.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.scm.meta | 2 +- .../{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.fv3.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.fv3.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.scm.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.scm.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_radiation_surface.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_radiation_surface.meta | 2 +- .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_post.F90 | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_post.meta | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_pre.F90 | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_pre.meta | 2 +- .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_setup.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_setup.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_mp.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_mp.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_overlap.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_overlap.meta | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_post.meta | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_pre.F90 | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_pre.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_setup.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_setup.meta | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_stochastics.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_stochastics.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_1.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_1.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_2.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_2.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_3.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_3.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_4.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_4.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_5.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_5.meta | 0 .../GFS_suite_interstitial_phys_reset.F90 | 0 .../GFS_suite_interstitial_phys_reset.meta | 0 .../GFS_suite_interstitial_rad_reset.F90 | 0 .../GFS_suite_interstitial_rad_reset.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_reset.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_reset.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_update.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_update.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_inter.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_inter.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_post.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_pre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_pre.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_post.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_post.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_pre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_pre.meta | 0 .../GFS_surface_loop_control_part1.F90 | 0 .../GFS_surface_loop_control_part1.meta | 0 .../GFS_surface_loop_control_part2.F90 | 0 .../GFS_surface_loop_control_part2.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.fv3.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.fv3.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.scm.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.scm.meta | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/aerinterp.F90 | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/cnvc90.f | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/cnvc90.meta | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/dcyc2t3.f | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/dcyc2t3.meta | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/gcycle.F90 | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/iccn_def.F | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/iccninterp.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/maximum_hourly_diagnostics.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/maximum_hourly_diagnostics.meta | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/phys_tend.F90 | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/phys_tend.meta | 0 .../{GFS => UFS_SCM_NEPTUNE}/scm_sfc_flux_spec.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/scm_sfc_flux_spec.meta | 0 physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/sfcsub.F | 0 .../{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpost.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpost.meta | 0 .../Interstitials/{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpre.F90 | 0 .../{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpre.meta | 0 physics/{MP => SFC_Layer}/GFDL/gfdl_sfc_layer.F90 | 0 physics/{MP => SFC_Layer}/GFDL/gfdl_sfc_layer.meta | 3 ++- physics/SFC_Layer/{GFS_sfc => UFS}/date_def.f | 0 physics/SFC_Layer/{GFS_sfc => UFS}/module_nst_model.f90 | 0 physics/SFC_Layer/{GFS_sfc => UFS}/module_nst_parameters.f90 | 0 physics/SFC_Layer/{GFS_sfc => UFS}/module_nst_water_prop.f90 | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag.f | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag.meta | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag_post.F90 | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag_post.meta | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diff.f | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diff.meta | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst.f | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst.meta | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_post.f | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_post.meta | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_pre.f | 0 physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_pre.meta | 0 physics/{Land/CLM_lake => SFC_Models/Lake/CLM}/clm_lake.f90 | 0 physics/{Land/CLM_lake => SFC_Models/Lake/CLM}/clm_lake.meta | 0 physics/{Land => SFC_Models/Lake}/Flake/flake.F90 | 0 physics/{Land => SFC_Models/Lake}/Flake/flake_driver.F90 | 0 physics/{Land => SFC_Models/Lake}/Flake/flake_driver.meta | 0 physics/{ => SFC_Models}/Land/Noah/lsm_noah.f | 0 physics/{ => SFC_Models}/Land/Noah/lsm_noah.meta | 0 physics/{ => SFC_Models}/Land/Noah/sflx.f | 0 physics/{ => SFC_Models}/Land/Noah/surface_perturbation.F90 | 0 .../{ => SFC_Models}/Land/Noahmp/module_sf_noahmp_glacier.F90 | 0 physics/{ => SFC_Models}/Land/Noahmp/module_sf_noahmplsm.F90 | 0 physics/{ => SFC_Models}/Land/Noahmp/noahmp_tables.f90 | 0 physics/{ => SFC_Models}/Land/Noahmp/noahmpdrv.F90 | 0 physics/{ => SFC_Models}/Land/Noahmp/noahmpdrv.meta | 0 physics/{ => SFC_Models}/Land/Noahmp/noahmptable.tbl | 0 physics/{ => SFC_Models}/Land/RUC/lsm_ruc.F90 | 0 physics/{ => SFC_Models}/Land/RUC/lsm_ruc.meta | 0 physics/{ => SFC_Models}/Land/RUC/module_sf_ruclsm.F90 | 0 physics/{ => SFC_Models}/Land/RUC/module_soil_pre.F90 | 0 physics/{ => SFC_Models}/Land/RUC/namelist_soilveg_ruc.F90 | 0 physics/{ => SFC_Models}/Land/RUC/set_soilveg_ruc.F90 | 0 physics/{ => SFC_Models}/Land/namelist_soilveg.f | 0 physics/{ => SFC_Models}/Land/set_soilveg.f | 0 .../{SFC_Layer/GFS_sfc => SFC_Models/Ocean/UFS}/sfc_ocean.F | 0 .../{SFC_Layer/GFS_sfc => SFC_Models/Ocean/UFS}/sfc_ocean.meta | 0 .../{SFC_Layer/GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_cice.f | 0 .../GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_cice.meta | 0 .../{SFC_Layer/GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_sice.f | 0 .../GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_sice.meta | 0 163 files changed, 6 insertions(+), 5 deletions(-) rename physics/CONV/{CCC => C3}/cu_c3_deep.F90 (100%) rename physics/CONV/{CCC => C3}/cu_c3_driver.F90 (100%) rename physics/CONV/{CCC => C3}/cu_c3_driver.meta (100%) rename physics/CONV/{CCC => C3}/cu_c3_driver_post.F90 (100%) rename physics/CONV/{CCC => C3}/cu_c3_driver_post.meta (100%) rename physics/CONV/{CCC => C3}/cu_c3_driver_pre.F90 (100%) rename physics/CONV/{CCC => C3}/cu_c3_driver_pre.meta (100%) rename physics/CONV/{CCC => C3}/cu_c3_sh.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_DCNV_generic_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_GWD_generic_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_MP_generic_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_common.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_PBL_generic_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_SCNV_generic_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_cloud_diagnostics.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_cloud_diagnostics.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_debug.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_debug.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.fv3.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.fv3.meta (99%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.scm.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_phys_time_vary.scm.meta (99%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.fv3.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.fv3.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.scm.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rad_time_vary.scm.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_radiation_surface.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_radiation_surface.meta (99%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_pre.meta (99%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_setup.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmg_setup.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_mp.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_mp.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_overlap.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_cloud_overlap.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_setup.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_rrtmgp_setup.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_stochastics.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_stochastics.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_1.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_1.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_2.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_2.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_3.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_3.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_4.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_4.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_5.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_5.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_phys_reset.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_phys_reset.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_rad_reset.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_interstitial_rad_reset.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_reset.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_reset.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_update.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_suite_stateout_update.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_inter.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_inter.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_composites_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_post.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_post.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_pre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_generic_pre.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_loop_control_part1.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_loop_control_part1.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_loop_control_part2.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_surface_loop_control_part2.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.fv3.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.fv3.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.scm.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/GFS_time_vary_pre.scm.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/aerinterp.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/cnvc90.f (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/cnvc90.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/dcyc2t3.f (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/dcyc2t3.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/gcycle.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/iccn_def.F (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/iccninterp.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/maximum_hourly_diagnostics.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/maximum_hourly_diagnostics.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/phys_tend.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/phys_tend.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/scm_sfc_flux_spec.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/scm_sfc_flux_spec.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/sfcsub.F (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpost.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpost.meta (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpre.F90 (100%) rename physics/Interstitials/{GFS => UFS_SCM_NEPTUNE}/sgscloud_radpre.meta (100%) rename physics/{MP => SFC_Layer}/GFDL/gfdl_sfc_layer.F90 (100%) rename physics/{MP => SFC_Layer}/GFDL/gfdl_sfc_layer.meta (99%) rename physics/SFC_Layer/{GFS_sfc => UFS}/date_def.f (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/module_nst_model.f90 (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/module_nst_parameters.f90 (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/module_nst_water_prop.f90 (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag.f (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag.meta (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag_post.F90 (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diag_post.meta (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diff.f (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_diff.meta (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst.f (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst.meta (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_post.f (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_post.meta (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_pre.f (100%) rename physics/SFC_Layer/{GFS_sfc => UFS}/sfc_nst_pre.meta (100%) rename physics/{Land/CLM_lake => SFC_Models/Lake/CLM}/clm_lake.f90 (100%) rename physics/{Land/CLM_lake => SFC_Models/Lake/CLM}/clm_lake.meta (100%) rename physics/{Land => SFC_Models/Lake}/Flake/flake.F90 (100%) rename physics/{Land => SFC_Models/Lake}/Flake/flake_driver.F90 (100%) rename physics/{Land => SFC_Models/Lake}/Flake/flake_driver.meta (100%) rename physics/{ => SFC_Models}/Land/Noah/lsm_noah.f (100%) rename physics/{ => SFC_Models}/Land/Noah/lsm_noah.meta (100%) rename physics/{ => SFC_Models}/Land/Noah/sflx.f (100%) rename physics/{ => SFC_Models}/Land/Noah/surface_perturbation.F90 (100%) rename physics/{ => SFC_Models}/Land/Noahmp/module_sf_noahmp_glacier.F90 (100%) rename physics/{ => SFC_Models}/Land/Noahmp/module_sf_noahmplsm.F90 (100%) rename physics/{ => SFC_Models}/Land/Noahmp/noahmp_tables.f90 (100%) rename physics/{ => SFC_Models}/Land/Noahmp/noahmpdrv.F90 (100%) rename physics/{ => SFC_Models}/Land/Noahmp/noahmpdrv.meta (100%) rename physics/{ => SFC_Models}/Land/Noahmp/noahmptable.tbl (100%) rename physics/{ => SFC_Models}/Land/RUC/lsm_ruc.F90 (100%) rename physics/{ => SFC_Models}/Land/RUC/lsm_ruc.meta (100%) rename physics/{ => SFC_Models}/Land/RUC/module_sf_ruclsm.F90 (100%) rename physics/{ => SFC_Models}/Land/RUC/module_soil_pre.F90 (100%) rename physics/{ => SFC_Models}/Land/RUC/namelist_soilveg_ruc.F90 (100%) rename physics/{ => SFC_Models}/Land/RUC/set_soilveg_ruc.F90 (100%) rename physics/{ => SFC_Models}/Land/namelist_soilveg.f (100%) rename physics/{ => SFC_Models}/Land/set_soilveg.f (100%) rename physics/{SFC_Layer/GFS_sfc => SFC_Models/Ocean/UFS}/sfc_ocean.F (100%) rename physics/{SFC_Layer/GFS_sfc => SFC_Models/Ocean/UFS}/sfc_ocean.meta (100%) rename physics/{SFC_Layer/GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_cice.f (100%) rename physics/{SFC_Layer/GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_cice.meta (100%) rename physics/{SFC_Layer/GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_sice.f (100%) rename physics/{SFC_Layer/GFS_sfc => SFC_Models/SeaIce/CICE}/sfc_sice.meta (100%) diff --git a/physics/CONV/CCC/cu_c3_deep.F90 b/physics/CONV/C3/cu_c3_deep.F90 similarity index 100% rename from physics/CONV/CCC/cu_c3_deep.F90 rename to physics/CONV/C3/cu_c3_deep.F90 diff --git a/physics/CONV/CCC/cu_c3_driver.F90 b/physics/CONV/C3/cu_c3_driver.F90 similarity index 100% rename from physics/CONV/CCC/cu_c3_driver.F90 rename to physics/CONV/C3/cu_c3_driver.F90 diff --git a/physics/CONV/CCC/cu_c3_driver.meta b/physics/CONV/C3/cu_c3_driver.meta similarity index 100% rename from physics/CONV/CCC/cu_c3_driver.meta rename to physics/CONV/C3/cu_c3_driver.meta diff --git a/physics/CONV/CCC/cu_c3_driver_post.F90 b/physics/CONV/C3/cu_c3_driver_post.F90 similarity index 100% rename from physics/CONV/CCC/cu_c3_driver_post.F90 rename to physics/CONV/C3/cu_c3_driver_post.F90 diff --git a/physics/CONV/CCC/cu_c3_driver_post.meta b/physics/CONV/C3/cu_c3_driver_post.meta similarity index 100% rename from physics/CONV/CCC/cu_c3_driver_post.meta rename to physics/CONV/C3/cu_c3_driver_post.meta diff --git a/physics/CONV/CCC/cu_c3_driver_pre.F90 b/physics/CONV/C3/cu_c3_driver_pre.F90 similarity index 100% rename from physics/CONV/CCC/cu_c3_driver_pre.F90 rename to physics/CONV/C3/cu_c3_driver_pre.F90 diff --git a/physics/CONV/CCC/cu_c3_driver_pre.meta b/physics/CONV/C3/cu_c3_driver_pre.meta similarity index 100% rename from physics/CONV/CCC/cu_c3_driver_pre.meta rename to physics/CONV/C3/cu_c3_driver_pre.meta diff --git a/physics/CONV/CCC/cu_c3_sh.F90 b/physics/CONV/C3/cu_c3_sh.F90 similarity index 100% rename from physics/CONV/CCC/cu_c3_sh.F90 rename to physics/CONV/C3/cu_c3_sh.F90 diff --git a/physics/Interstitials/GFS/GFS_DCNV_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_DCNV_generic_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.F90 diff --git a/physics/Interstitials/GFS/GFS_DCNV_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_DCNV_generic_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta diff --git a/physics/Interstitials/GFS/GFS_DCNV_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_DCNV_generic_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_DCNV_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_DCNV_generic_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta diff --git a/physics/Interstitials/GFS/GFS_GWD_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_GWD_generic_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.F90 diff --git a/physics/Interstitials/GFS/GFS_GWD_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_GWD_generic_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta diff --git a/physics/Interstitials/GFS/GFS_GWD_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_GWD_generic_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_GWD_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_GWD_generic_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta diff --git a/physics/Interstitials/GFS/GFS_MP_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_MP_generic_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 diff --git a/physics/Interstitials/GFS/GFS_MP_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_MP_generic_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta diff --git a/physics/Interstitials/GFS/GFS_MP_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_MP_generic_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_MP_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_MP_generic_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.meta diff --git a/physics/Interstitials/GFS/GFS_PBL_generic_common.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_common.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_PBL_generic_common.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_common.F90 diff --git a/physics/Interstitials/GFS/GFS_PBL_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_PBL_generic_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.F90 diff --git a/physics/Interstitials/GFS/GFS_PBL_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_PBL_generic_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta diff --git a/physics/Interstitials/GFS/GFS_PBL_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_PBL_generic_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_PBL_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_PBL_generic_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta diff --git a/physics/Interstitials/GFS/GFS_SCNV_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_SCNV_generic_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.F90 diff --git a/physics/Interstitials/GFS/GFS_SCNV_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_SCNV_generic_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta diff --git a/physics/Interstitials/GFS/GFS_SCNV_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_SCNV_generic_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_SCNV_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_SCNV_generic_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta diff --git a/physics/Interstitials/GFS/GFS_cloud_diagnostics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_cloud_diagnostics.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.F90 diff --git a/physics/Interstitials/GFS/GFS_cloud_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_cloud_diagnostics.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta diff --git a/physics/Interstitials/GFS/GFS_debug.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_debug.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.F90 diff --git a/physics/Interstitials/GFS/GFS_debug.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_debug.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta diff --git a/physics/Interstitials/GFS/GFS_phys_time_vary.fv3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_phys_time_vary.fv3.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 diff --git a/physics/Interstitials/GFS/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta similarity index 99% rename from physics/Interstitials/GFS/GFS_phys_time_vary.fv3.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta index 45125385c..2aec034fd 100644 --- a/physics/Interstitials/GFS/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta @@ -6,7 +6,7 @@ dependencies = Interstitials/GFS/gcycle.F90,Interstitials/GFS/iccn_def.F,Interstitials/GFS/iccninterp.F90,Interstitials/GFS/sfcsub.F dependencies = Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 - dependencies = Land/namelist_soilveg.f,Land/set_soilveg.f,Land/Noahmp/noahmp_tables.f90 + dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 dependencies = o3_photo/ozinterp.f90,o3_photo/ozne_def.f dependencies = h2o_photo/h2o_def.f,h2o_photo/h2ointerp.f90 dependencies = GWD/cires_tauamf_data.F90 diff --git a/physics/Interstitials/GFS/GFS_phys_time_vary.scm.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_phys_time_vary.scm.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 diff --git a/physics/Interstitials/GFS/GFS_phys_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta similarity index 99% rename from physics/Interstitials/GFS/GFS_phys_time_vary.scm.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta index 84f22aede..d033c889b 100644 --- a/physics/Interstitials/GFS/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta @@ -6,7 +6,7 @@ dependencies = Interstitials/GFS/iccn_def.F,Interstitials/GFS/iccninterp.F90,Interstitials/GFS/sfcsub.F dependencies = Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 - dependencies = Land/namelist_soilveg.f,Land/set_soilveg.f,Land/Noahmp/noahmp_tables.f90 + dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 dependencies = o3_photo/ozinterp.f90,o3_photo/ozne_def.f dependencies = h2o_photo/h2o_def.f,h2o_photo/h2ointerp.f90 dependencies = GWD/cires_tauamf_data.F90 diff --git a/physics/Interstitials/GFS/GFS_rad_time_vary.fv3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rad_time_vary.fv3.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.F90 diff --git a/physics/Interstitials/GFS/GFS_rad_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rad_time_vary.fv3.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta diff --git a/physics/Interstitials/GFS/GFS_rad_time_vary.scm.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rad_time_vary.scm.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.F90 diff --git a/physics/Interstitials/GFS/GFS_rad_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rad_time_vary.scm.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta diff --git a/physics/Interstitials/GFS/GFS_radiation_surface.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_radiation_surface.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 diff --git a/physics/Interstitials/GFS/GFS_radiation_surface.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta similarity index 99% rename from physics/Interstitials/GFS/GFS_radiation_surface.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta index c18b81d9f..79837d0bf 100644 --- a/physics/Interstitials/GFS/GFS_radiation_surface.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta @@ -3,7 +3,7 @@ type = scheme relative_path = ../../ dependencies = Radiation/iounitdef.f,Radiation/radiation_surface.f - dependencies = Land/RUC/set_soilveg_ruc.F90,Land/RUC/namelist_soilveg_ruc.F90 + dependencies = SFC_Models/Land/RUC/set_soilveg_ruc.F90,SFC_Models/Land/RUC/namelist_soilveg_ruc.F90 dependencies = hooks/machine.F ######################################################################## diff --git a/physics/Interstitials/GFS/GFS_rrtmg_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmg_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmg_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmg_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta diff --git a/physics/Interstitials/GFS/GFS_rrtmg_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmg_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmg_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta similarity index 99% rename from physics/Interstitials/GFS/GFS_rrtmg_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta index e0e67c8f5..af95daf52 100644 --- a/physics/Interstitials/GFS/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta @@ -7,7 +7,7 @@ dependencies = Radiation/iounitdef.f,Radiation/RRTMG/radcons.f90,Radiation/radiation_aerosols.f dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_clouds.f,Radiation/radiation_gases.f dependencies = Radiation/radlw_param.f,Radiation/radsw_param.f,Radiation/radiation_cloud_overlap.F90 - dependencies = Land/Noah/surface_perturbation.F90 + dependencies = SFC_Models/Land/Noah/surface_perturbation.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/Interstitials/GFS/GFS_rrtmg_setup.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmg_setup.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmg_setup.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmg_setup.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_cloud_mp.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_cloud_overlap.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_setup.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_setup.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.F90 diff --git a/physics/Interstitials/GFS/GFS_rrtmgp_setup.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_rrtmgp_setup.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta diff --git a/physics/Interstitials/GFS/GFS_stochastics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_stochastics.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.F90 diff --git a/physics/Interstitials/GFS/GFS_stochastics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_stochastics.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.meta diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_1.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_1.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_1.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_1.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_1.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_1.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_1.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_1.meta diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_2.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_2.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_2.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_2.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_3.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_3.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_4.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_4.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_4.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_4.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_5.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_5.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_5.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_5.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_5.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_5.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_5.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_5.meta diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_phys_reset.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_phys_reset.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_phys_reset.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_phys_reset.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_phys_reset.meta diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_rad_reset.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_rad_reset.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_rad_reset.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_interstitial_rad_reset.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_rad_reset.meta diff --git a/physics/Interstitials/GFS/GFS_suite_stateout_reset.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_reset.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_stateout_reset.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_reset.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_stateout_reset.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_reset.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_stateout_reset.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_reset.meta diff --git a/physics/Interstitials/GFS/GFS_suite_stateout_update.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_stateout_update.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.F90 diff --git a/physics/Interstitials/GFS/GFS_suite_stateout_update.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_suite_stateout_update.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta diff --git a/physics/Interstitials/GFS/GFS_surface_composites_inter.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_inter.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_composites_inter.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_inter.F90 diff --git a/physics/Interstitials/GFS/GFS_surface_composites_inter.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_inter.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_composites_inter.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_inter.meta diff --git a/physics/Interstitials/GFS/GFS_surface_composites_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_composites_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 diff --git a/physics/Interstitials/GFS/GFS_surface_composites_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_composites_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta diff --git a/physics/Interstitials/GFS/GFS_surface_composites_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_composites_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_surface_composites_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_composites_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta diff --git a/physics/Interstitials/GFS/GFS_surface_generic_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_generic_post.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.F90 diff --git a/physics/Interstitials/GFS/GFS_surface_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_generic_post.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.meta diff --git a/physics/Interstitials/GFS/GFS_surface_generic_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_generic_pre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 diff --git a/physics/Interstitials/GFS/GFS_surface_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_generic_pre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta diff --git a/physics/Interstitials/GFS/GFS_surface_loop_control_part1.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_loop_control_part1.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.F90 diff --git a/physics/Interstitials/GFS/GFS_surface_loop_control_part1.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_loop_control_part1.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.meta diff --git a/physics/Interstitials/GFS/GFS_surface_loop_control_part2.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_loop_control_part2.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.F90 diff --git a/physics/Interstitials/GFS/GFS_surface_loop_control_part2.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_surface_loop_control_part2.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.meta diff --git a/physics/Interstitials/GFS/GFS_time_vary_pre.fv3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_time_vary_pre.fv3.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.F90 diff --git a/physics/Interstitials/GFS/GFS_time_vary_pre.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_time_vary_pre.fv3.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.meta diff --git a/physics/Interstitials/GFS/GFS_time_vary_pre.scm.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.F90 similarity index 100% rename from physics/Interstitials/GFS/GFS_time_vary_pre.scm.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.F90 diff --git a/physics/Interstitials/GFS/GFS_time_vary_pre.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.meta similarity index 100% rename from physics/Interstitials/GFS/GFS_time_vary_pre.scm.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.meta diff --git a/physics/Interstitials/GFS/aerinterp.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/aerinterp.F90 similarity index 100% rename from physics/Interstitials/GFS/aerinterp.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/aerinterp.F90 diff --git a/physics/Interstitials/GFS/cnvc90.f b/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.f similarity index 100% rename from physics/Interstitials/GFS/cnvc90.f rename to physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.f diff --git a/physics/Interstitials/GFS/cnvc90.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta similarity index 100% rename from physics/Interstitials/GFS/cnvc90.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta diff --git a/physics/Interstitials/GFS/dcyc2t3.f b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f similarity index 100% rename from physics/Interstitials/GFS/dcyc2t3.f rename to physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f diff --git a/physics/Interstitials/GFS/dcyc2t3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta similarity index 100% rename from physics/Interstitials/GFS/dcyc2t3.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta diff --git a/physics/Interstitials/GFS/gcycle.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 similarity index 100% rename from physics/Interstitials/GFS/gcycle.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 diff --git a/physics/Interstitials/GFS/iccn_def.F b/physics/Interstitials/UFS_SCM_NEPTUNE/iccn_def.F similarity index 100% rename from physics/Interstitials/GFS/iccn_def.F rename to physics/Interstitials/UFS_SCM_NEPTUNE/iccn_def.F diff --git a/physics/Interstitials/GFS/iccninterp.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90 similarity index 100% rename from physics/Interstitials/GFS/iccninterp.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90 diff --git a/physics/Interstitials/GFS/maximum_hourly_diagnostics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 similarity index 100% rename from physics/Interstitials/GFS/maximum_hourly_diagnostics.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 diff --git a/physics/Interstitials/GFS/maximum_hourly_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta similarity index 100% rename from physics/Interstitials/GFS/maximum_hourly_diagnostics.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta diff --git a/physics/Interstitials/GFS/phys_tend.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/phys_tend.F90 similarity index 100% rename from physics/Interstitials/GFS/phys_tend.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/phys_tend.F90 diff --git a/physics/Interstitials/GFS/phys_tend.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/phys_tend.meta similarity index 100% rename from physics/Interstitials/GFS/phys_tend.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/phys_tend.meta diff --git a/physics/Interstitials/GFS/scm_sfc_flux_spec.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.F90 similarity index 100% rename from physics/Interstitials/GFS/scm_sfc_flux_spec.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.F90 diff --git a/physics/Interstitials/GFS/scm_sfc_flux_spec.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.meta similarity index 100% rename from physics/Interstitials/GFS/scm_sfc_flux_spec.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.meta diff --git a/physics/Interstitials/GFS/sfcsub.F b/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F similarity index 100% rename from physics/Interstitials/GFS/sfcsub.F rename to physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F diff --git a/physics/Interstitials/GFS/sgscloud_radpost.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpost.F90 similarity index 100% rename from physics/Interstitials/GFS/sgscloud_radpost.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpost.F90 diff --git a/physics/Interstitials/GFS/sgscloud_radpost.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpost.meta similarity index 100% rename from physics/Interstitials/GFS/sgscloud_radpost.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpost.meta diff --git a/physics/Interstitials/GFS/sgscloud_radpre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 similarity index 100% rename from physics/Interstitials/GFS/sgscloud_radpre.F90 rename to physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 diff --git a/physics/Interstitials/GFS/sgscloud_radpre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta similarity index 100% rename from physics/Interstitials/GFS/sgscloud_radpre.meta rename to physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta diff --git a/physics/MP/GFDL/gfdl_sfc_layer.F90 b/physics/SFC_Layer/GFDL/gfdl_sfc_layer.F90 similarity index 100% rename from physics/MP/GFDL/gfdl_sfc_layer.F90 rename to physics/SFC_Layer/GFDL/gfdl_sfc_layer.F90 diff --git a/physics/MP/GFDL/gfdl_sfc_layer.meta b/physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta similarity index 99% rename from physics/MP/GFDL/gfdl_sfc_layer.meta rename to physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta index a64fe277c..b0d613eed 100644 --- a/physics/MP/GFDL/gfdl_sfc_layer.meta +++ b/physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = gfdl_sfc_layer type = scheme - dependencies = ../../hooks/machine.F,../SFC_Layer/module_sf_exchcoef.f90,../../Land/RUC/namelist_soilveg_ruc.F90,../../Land/Noahmp/noahmp_tables.f90 + relative_path = ../../ + dependencies = hooks/machine.F,SFC_Layer/module_sf_exchcoef.f90,SFC_Models/Land/RUC/namelist_soilveg_ruc.F90,Land/Noahmp/noahmp_tables.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Layer/GFS_sfc/date_def.f b/physics/SFC_Layer/UFS/date_def.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/date_def.f rename to physics/SFC_Layer/UFS/date_def.f diff --git a/physics/SFC_Layer/GFS_sfc/module_nst_model.f90 b/physics/SFC_Layer/UFS/module_nst_model.f90 similarity index 100% rename from physics/SFC_Layer/GFS_sfc/module_nst_model.f90 rename to physics/SFC_Layer/UFS/module_nst_model.f90 diff --git a/physics/SFC_Layer/GFS_sfc/module_nst_parameters.f90 b/physics/SFC_Layer/UFS/module_nst_parameters.f90 similarity index 100% rename from physics/SFC_Layer/GFS_sfc/module_nst_parameters.f90 rename to physics/SFC_Layer/UFS/module_nst_parameters.f90 diff --git a/physics/SFC_Layer/GFS_sfc/module_nst_water_prop.f90 b/physics/SFC_Layer/UFS/module_nst_water_prop.f90 similarity index 100% rename from physics/SFC_Layer/GFS_sfc/module_nst_water_prop.f90 rename to physics/SFC_Layer/UFS/module_nst_water_prop.f90 diff --git a/physics/SFC_Layer/GFS_sfc/sfc_diag.f b/physics/SFC_Layer/UFS/sfc_diag.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_diag.f rename to physics/SFC_Layer/UFS/sfc_diag.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_diag.meta b/physics/SFC_Layer/UFS/sfc_diag.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_diag.meta rename to physics/SFC_Layer/UFS/sfc_diag.meta diff --git a/physics/SFC_Layer/GFS_sfc/sfc_diag_post.F90 b/physics/SFC_Layer/UFS/sfc_diag_post.F90 similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_diag_post.F90 rename to physics/SFC_Layer/UFS/sfc_diag_post.F90 diff --git a/physics/SFC_Layer/GFS_sfc/sfc_diag_post.meta b/physics/SFC_Layer/UFS/sfc_diag_post.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_diag_post.meta rename to physics/SFC_Layer/UFS/sfc_diag_post.meta diff --git a/physics/SFC_Layer/GFS_sfc/sfc_diff.f b/physics/SFC_Layer/UFS/sfc_diff.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_diff.f rename to physics/SFC_Layer/UFS/sfc_diff.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_diff.meta b/physics/SFC_Layer/UFS/sfc_diff.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_diff.meta rename to physics/SFC_Layer/UFS/sfc_diff.meta diff --git a/physics/SFC_Layer/GFS_sfc/sfc_nst.f b/physics/SFC_Layer/UFS/sfc_nst.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_nst.f rename to physics/SFC_Layer/UFS/sfc_nst.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_nst.meta b/physics/SFC_Layer/UFS/sfc_nst.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_nst.meta rename to physics/SFC_Layer/UFS/sfc_nst.meta diff --git a/physics/SFC_Layer/GFS_sfc/sfc_nst_post.f b/physics/SFC_Layer/UFS/sfc_nst_post.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_nst_post.f rename to physics/SFC_Layer/UFS/sfc_nst_post.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_nst_post.meta b/physics/SFC_Layer/UFS/sfc_nst_post.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_nst_post.meta rename to physics/SFC_Layer/UFS/sfc_nst_post.meta diff --git a/physics/SFC_Layer/GFS_sfc/sfc_nst_pre.f b/physics/SFC_Layer/UFS/sfc_nst_pre.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_nst_pre.f rename to physics/SFC_Layer/UFS/sfc_nst_pre.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_nst_pre.meta b/physics/SFC_Layer/UFS/sfc_nst_pre.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_nst_pre.meta rename to physics/SFC_Layer/UFS/sfc_nst_pre.meta diff --git a/physics/Land/CLM_lake/clm_lake.f90 b/physics/SFC_Models/Lake/CLM/clm_lake.f90 similarity index 100% rename from physics/Land/CLM_lake/clm_lake.f90 rename to physics/SFC_Models/Lake/CLM/clm_lake.f90 diff --git a/physics/Land/CLM_lake/clm_lake.meta b/physics/SFC_Models/Lake/CLM/clm_lake.meta similarity index 100% rename from physics/Land/CLM_lake/clm_lake.meta rename to physics/SFC_Models/Lake/CLM/clm_lake.meta diff --git a/physics/Land/Flake/flake.F90 b/physics/SFC_Models/Lake/Flake/flake.F90 similarity index 100% rename from physics/Land/Flake/flake.F90 rename to physics/SFC_Models/Lake/Flake/flake.F90 diff --git a/physics/Land/Flake/flake_driver.F90 b/physics/SFC_Models/Lake/Flake/flake_driver.F90 similarity index 100% rename from physics/Land/Flake/flake_driver.F90 rename to physics/SFC_Models/Lake/Flake/flake_driver.F90 diff --git a/physics/Land/Flake/flake_driver.meta b/physics/SFC_Models/Lake/Flake/flake_driver.meta similarity index 100% rename from physics/Land/Flake/flake_driver.meta rename to physics/SFC_Models/Lake/Flake/flake_driver.meta diff --git a/physics/Land/Noah/lsm_noah.f b/physics/SFC_Models/Land/Noah/lsm_noah.f similarity index 100% rename from physics/Land/Noah/lsm_noah.f rename to physics/SFC_Models/Land/Noah/lsm_noah.f diff --git a/physics/Land/Noah/lsm_noah.meta b/physics/SFC_Models/Land/Noah/lsm_noah.meta similarity index 100% rename from physics/Land/Noah/lsm_noah.meta rename to physics/SFC_Models/Land/Noah/lsm_noah.meta diff --git a/physics/Land/Noah/sflx.f b/physics/SFC_Models/Land/Noah/sflx.f similarity index 100% rename from physics/Land/Noah/sflx.f rename to physics/SFC_Models/Land/Noah/sflx.f diff --git a/physics/Land/Noah/surface_perturbation.F90 b/physics/SFC_Models/Land/Noah/surface_perturbation.F90 similarity index 100% rename from physics/Land/Noah/surface_perturbation.F90 rename to physics/SFC_Models/Land/Noah/surface_perturbation.F90 diff --git a/physics/Land/Noahmp/module_sf_noahmp_glacier.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmp_glacier.F90 similarity index 100% rename from physics/Land/Noahmp/module_sf_noahmp_glacier.F90 rename to physics/SFC_Models/Land/Noahmp/module_sf_noahmp_glacier.F90 diff --git a/physics/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 similarity index 100% rename from physics/Land/Noahmp/module_sf_noahmplsm.F90 rename to physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 diff --git a/physics/Land/Noahmp/noahmp_tables.f90 b/physics/SFC_Models/Land/Noahmp/noahmp_tables.f90 similarity index 100% rename from physics/Land/Noahmp/noahmp_tables.f90 rename to physics/SFC_Models/Land/Noahmp/noahmp_tables.f90 diff --git a/physics/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 similarity index 100% rename from physics/Land/Noahmp/noahmpdrv.F90 rename to physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 diff --git a/physics/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta similarity index 100% rename from physics/Land/Noahmp/noahmpdrv.meta rename to physics/SFC_Models/Land/Noahmp/noahmpdrv.meta diff --git a/physics/Land/Noahmp/noahmptable.tbl b/physics/SFC_Models/Land/Noahmp/noahmptable.tbl similarity index 100% rename from physics/Land/Noahmp/noahmptable.tbl rename to physics/SFC_Models/Land/Noahmp/noahmptable.tbl diff --git a/physics/Land/RUC/lsm_ruc.F90 b/physics/SFC_Models/Land/RUC/lsm_ruc.F90 similarity index 100% rename from physics/Land/RUC/lsm_ruc.F90 rename to physics/SFC_Models/Land/RUC/lsm_ruc.F90 diff --git a/physics/Land/RUC/lsm_ruc.meta b/physics/SFC_Models/Land/RUC/lsm_ruc.meta similarity index 100% rename from physics/Land/RUC/lsm_ruc.meta rename to physics/SFC_Models/Land/RUC/lsm_ruc.meta diff --git a/physics/Land/RUC/module_sf_ruclsm.F90 b/physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90 similarity index 100% rename from physics/Land/RUC/module_sf_ruclsm.F90 rename to physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90 diff --git a/physics/Land/RUC/module_soil_pre.F90 b/physics/SFC_Models/Land/RUC/module_soil_pre.F90 similarity index 100% rename from physics/Land/RUC/module_soil_pre.F90 rename to physics/SFC_Models/Land/RUC/module_soil_pre.F90 diff --git a/physics/Land/RUC/namelist_soilveg_ruc.F90 b/physics/SFC_Models/Land/RUC/namelist_soilveg_ruc.F90 similarity index 100% rename from physics/Land/RUC/namelist_soilveg_ruc.F90 rename to physics/SFC_Models/Land/RUC/namelist_soilveg_ruc.F90 diff --git a/physics/Land/RUC/set_soilveg_ruc.F90 b/physics/SFC_Models/Land/RUC/set_soilveg_ruc.F90 similarity index 100% rename from physics/Land/RUC/set_soilveg_ruc.F90 rename to physics/SFC_Models/Land/RUC/set_soilveg_ruc.F90 diff --git a/physics/Land/namelist_soilveg.f b/physics/SFC_Models/Land/namelist_soilveg.f similarity index 100% rename from physics/Land/namelist_soilveg.f rename to physics/SFC_Models/Land/namelist_soilveg.f diff --git a/physics/Land/set_soilveg.f b/physics/SFC_Models/Land/set_soilveg.f similarity index 100% rename from physics/Land/set_soilveg.f rename to physics/SFC_Models/Land/set_soilveg.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_ocean.F b/physics/SFC_Models/Ocean/UFS/sfc_ocean.F similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_ocean.F rename to physics/SFC_Models/Ocean/UFS/sfc_ocean.F diff --git a/physics/SFC_Layer/GFS_sfc/sfc_ocean.meta b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_ocean.meta rename to physics/SFC_Models/Ocean/UFS/sfc_ocean.meta diff --git a/physics/SFC_Layer/GFS_sfc/sfc_cice.f b/physics/SFC_Models/SeaIce/CICE/sfc_cice.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_cice.f rename to physics/SFC_Models/SeaIce/CICE/sfc_cice.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_cice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_cice.meta rename to physics/SFC_Models/SeaIce/CICE/sfc_cice.meta diff --git a/physics/SFC_Layer/GFS_sfc/sfc_sice.f b/physics/SFC_Models/SeaIce/CICE/sfc_sice.f similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_sice.f rename to physics/SFC_Models/SeaIce/CICE/sfc_sice.f diff --git a/physics/SFC_Layer/GFS_sfc/sfc_sice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta similarity index 100% rename from physics/SFC_Layer/GFS_sfc/sfc_sice.meta rename to physics/SFC_Models/SeaIce/CICE/sfc_sice.meta From f0117dfcf75a5fd0ea74383ae2b0f36c3df9d48e Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Thu, 12 Oct 2023 16:27:32 +0000 Subject: [PATCH 041/249] Changes in RUC LSM: 1. adding a heat source from fires. It is icontrolled by a flag and not turned on yet. Needs more testing. 2. Adding output of surface paramteres: leaf area index (LAI), wilting point and soil field capacity. --- physics/lsm_ruc.F90 | 105 ++++++++++++++++++++++++----------- physics/lsm_ruc.meta | 17 +++++- physics/module_sf_ruclsm.F90 | 29 +++++++++- 3 files changed, 115 insertions(+), 36 deletions(-) diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index 665fe6d14..d3754b68c 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -359,6 +359,7 @@ subroutine lsm_ruc_run & ! inputs & qsurf_ice, gflux_ice, evap_ice, ep1d_ice, hflx_ice, & & cm_ice, ch_ice, snowfallac_ice, acsnow_ice, snowmt_ice, & & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & + & add_fire_heat_flux, fire_heat_flux_out, & ! --- out & rhosnf, sbsno, & & cmm_lnd, chh_lnd, cmm_ice, chh_ice, & @@ -381,7 +382,7 @@ subroutine lsm_ruc_run & ! inputs real (kind_phys), dimension(:), intent(in) :: oro, sigma real (kind_phys), dimension(:), intent(in) :: & - & t1, sigmaf, laixy, dlwflx, dswsfc, tg3, & + & t1, sigmaf, dlwflx, dswsfc, tg3, & & coszen, prsl1, wind, shdmin, shdmax, & & sfalb_lnd_bck, snoalb, zf, qc, q1, & ! for land @@ -417,7 +418,7 @@ 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, & + & canopy, trans, smcwlt2, smcref2, laixy, & ! for land & weasd_lnd, snwdph_lnd, tskin_lnd, & & tsurf_lnd, z0rl_lnd, tsnow_lnd, & @@ -430,6 +431,8 @@ subroutine lsm_ruc_run & ! inputs ! --- in real (kind_phys), dimension(:), intent(in) :: & & rainnc, rainc, ice, snow, graupel, rhonewsn1 + real (kind_phys), dimension(:), intent(in) :: fire_heat_flux_out + logical, intent(in) :: add_fire_heat_flux ! --- in/out: ! --- on RUC levels real (kind_phys), dimension(:,:), intent(inout) :: & @@ -505,12 +508,13 @@ subroutine lsm_ruc_run & ! inputs & solnet_lnd, sfcexc, & & runoff1, runoff2, acrunoff, semis_bck, & & sfcems_lnd, hfx_lnd, shdfac, shdmin1d, shdmax1d, & + & fire_heat_flux1d, & & sneqv_lnd, snoalb1d_lnd, snowh_lnd, snoh_lnd, tsnav_lnd, & & snomlt_lnd, sncovr_lnd, soilw, soilm, ssoil_lnd, & & soilt_lnd, tbot, & & xlai, swdn, z0_lnd, znt_lnd, rhosnfr, infiltr, & - & precipfr, snfallac_lnd, acsn_lnd, & - & qsfc_lnd, qsg_lnd, qvg_lnd, qcg_lnd, soilt1_lnd, chklowq + & precipfr, snfallac_lnd, acsn_lnd, soilt1_lnd, chklowq, & + & qsfc_lnd, qsg_lnd, qvg_lnd, qcg_lnd, smcwlt, smcref ! ice real (kind_phys),dimension (im,1) :: & & albbck_ice, alb_ice, chs_ice, flhc_ice, flqc_ice, & @@ -540,7 +544,7 @@ subroutine lsm_ruc_run & ! inputs integer :: l, k, i, j, fractional_seaice, ilst real (kind_phys) :: dm, cimin(im) logical :: flag(im), flag_ice(im), flag_ice_uncoupled(im) - logical :: rdlai2d, myj, frpcpn + logical :: myj, frpcpn logical :: debug_print !-- diagnostic point @@ -645,15 +649,38 @@ subroutine lsm_ruc_run & ! inputs nsoil = lsoil_ruc do i = 1, im ! i - horizontal loop - ! reassign smcref2 and smcwlt2 to RUC values - if(.not. land(i)) then - !water and sea ice - smcref2 (i) = one - smcwlt2 (i) = zero + ! reassign smcref2 and smcwlt2 to RUC values at kdt=1 + if(kdt == 1) then + if(.not. land(i)) then + !water and sea ice + smcref (i,1) = one + smcwlt (i,1) = zero + xlai (i,1) = zero + else + !land + smcref (i,1) = REFSMC(stype(i)) + smcwlt (i,1) = WLTSMC(stype(i)) + + !-- rdlai is .true. when the LAI data is available in the INPUT/sfc_data.nc on cold-start + if(rdlai) then + xlai(i,1) = laixy(i) + else + xlai(i,1) = LAITBL(vtype(i)) + endif + endif else - !land - smcref2 (i) = REFSMC(stype(i)) - smcwlt2 (i) = WLTSMC(stype(i)) + !-- if kdt > 1, parameters with sub-grid heterogeneity + if(.not. land(i)) then + !water and sea ice + smcref (i,1) = one + smcwlt (i,1) = zero + xlai (i,1) = zero + else + !land + smcref (i,1) = smcref2 (i) + smcwlt (i,1) = smcwlt2 (i) + xlai (i,1) = laixy (i) + endif endif enddo @@ -813,10 +840,6 @@ subroutine lsm_ruc_run & ! inputs ffrozp(i,j) = real(nint(srflag(i)),kind_phys) endif - !-- rdlai is .false. when the LAI data is not available in the - ! - INPUT/sfc_data.nc - - rdlai2d = rdlai conflx2(i,1,j) = zf(i) * 2._kind_phys ! factor 2. is needed to get the height of ! atm. forcing inside RUC LSM (inherited @@ -843,14 +866,15 @@ subroutine lsm_ruc_run & ! inputs !!\n \a graupelncv - time-step graupel (\f$kg m^{-2} \f$) !!\n \a snowncv - time-step snow (\f$kg m^{-2} \f$) !!\n \a precipfr - time-step precipitation in solid form (\f$kg m^{-2} \f$) -!!\n \a shdfac - areal fractional coverage of green vegetation (0.0-1.0) -!!\n \a shdmin - minimum areal fractional coverage of green vegetation -> !shdmin1d -!!\n \a shdmax - maximum areal fractional coverage of green vegetation -> !shdmax1d +!!\n \a shdfac - areal fractional coverage of green vegetation (0.0-100.%) +!!\n \a shdmin - minimum areal fractional coverage of green vegetation in % -> !shdmin1d +!!\n \a shdmax - maximum areal fractional coverage of green vegetation in % -> !shdmax1d !!\n \a tbot - bottom soil temperature (local yearly-mean sfc air temp) lwdn(i,j) = dlwflx(i) !..downward lw flux at sfc in w/m2 swdn(i,j) = dswsfc(i) !..downward sw flux at sfc in w/m2 + ! all precip input to RUC LSM is in [mm] !prcp(i,j) = rhoh2o * tprcp(i) ! tprcp in [m] - convective plus explicit !raincv(i,j) = rhoh2o * rainc(i) ! total time-step convective precip @@ -918,17 +942,12 @@ subroutine lsm_ruc_run & ! inputs write (0,*)'MODIS landuse is not available' endif - if(rdlai2d) then - xlai(i,j) = laixy(i) - else - xlai(i,j) = zero - endif - semis_bck(i,j) = semisbase(i) ! --- units % shdfac(i,j) = sigmaf(i)*100._kind_phys shdmin1d(i,j) = shdmin(i)*100._kind_phys shdmax1d(i,j) = shdmax(i)*100._kind_phys + fire_heat_flux1d(i,j) = fire_heat_flux_out(i) ! JLS if (land(i)) then ! at least some land in the grid cell @@ -976,6 +995,12 @@ subroutine lsm_ruc_run & ! inputs snoalb1d_lnd(i,j) = snoalb(i) albbck_lnd(i,j) = min(0.9_kind_phys,albbcksol(i)) !sfalb_lnd_bck(i) + IF ( add_fire_heat_flux .and. fire_heat_flux_out(i) > 0) then ! JLS + ! limit albedo and greenness in the areas affected by the fire + albbck_lnd(i,j) = min(0.1_kind_phys,albbck_lnd(i,j)) + shdfac(i,j) = min(50._kind_phys,shdfac(i,j)) ! % + ENDIF + !-- spp_lsm if (spp_lsm == 1) then @@ -1163,7 +1188,7 @@ subroutine lsm_ruc_run & ! inputs & wet(i,j), cmc(i,j), shdfac(i,j), alb_lnd(i,j), znt_lnd(i,j), & & z0_lnd(i,j), snoalb1d_lnd(i,j), albbck_lnd(i,j), & & xlai(i,j), landusef(i,:,j), nlcat, & - & soilctop(i,:,j), nscat, & + & soilctop(i,:,j), nscat, smcwlt(i,j), smcref(i,j), & & qsfc_lnd(i,j), qsg_lnd(i,j), qvg_lnd(i,j), qcg_lnd(i,j), & & dew_lnd(i,j), soilt1_lnd(i,j), & & tsnav_lnd(i,j), tbot(i,j), vtype_lnd(i,j), stype_lnd(i,j), & @@ -1178,8 +1203,9 @@ subroutine lsm_ruc_run & ! inputs & infiltr(i,j), runoff1(i,j), runoff2(i,j), acrunoff(i,j), & & sfcexc(i,j), acceta(i,j), ssoil_lnd(i,j), & & snfallac_lnd(i,j), acsn_lnd(i,j), snomlt_lnd(i,j), & - & smfrsoil(i,:,j),keepfrsoil(i,:,j), .false., & - & shdmin1d(i,j), shdmax1d(i,j), rdlai2d, & + & smfrsoil(i,:,j),keepfrsoil(i,:,j), & + & add_fire_heat_flux,fire_heat_flux1d(i,j), .false., & + & shdmin1d(i,j), shdmax1d(i,j), rdlai, & & ims,ime, jms,jme, kms,kme, & & its,ite, jts,jte, kts,kte, errmsg, errflg ) if(debug_print) then @@ -1218,7 +1244,7 @@ subroutine lsm_ruc_run & ! inputs 'ssoil(i,j) =',ssoil_lnd(i,j), & 'snfallac(i,j) =',snfallac_lnd(i,j), & 'acsn_lnd(i,j) =',acsn_lnd(i,j), & - 'snomlt(i,j) =',snomlt_lnd(i,j) + 'snomlt(i,j) =',snomlt_lnd(i,j),'xlai(i,j) =',xlai(i,j) endif endif @@ -1289,6 +1315,10 @@ subroutine lsm_ruc_run & ! inputs ! --- ... unit conversion (from m to mm) snwdph_lnd(i) = snowh_lnd(i,j) * rhoh2o + laixy(i) = xlai(i,j) + smcwlt2(i) = smcwlt(i,j) + smcref2(i) = smcref(i,j) + canopy(i) = cmc(i,j) ! mm weasd_lnd(i) = sneqv_lnd(i,j) ! mm sncovr1_lnd(i) = sncovr_lnd(i,j) @@ -1318,6 +1348,7 @@ subroutine lsm_ruc_run & ! inputs write (0,*)'LAND -i,j,stype_lnd,vtype_lnd',i,j,stype_lnd(i,j),vtype_lnd(i,j) write (0,*)'i,j,tsurf_lnd(i)',i,j,tsurf_lnd(i) write (0,*)'kdt,iter,stsoil(i,:,j)',kdt,iter,stsoil(i,:,j) + write (0,*)'laixy(i)',laixy(i) endif endif ! end of land @@ -1449,7 +1480,7 @@ subroutine lsm_ruc_run & ! inputs & wet_ice(i,j), cmc(i,j), shdfac(i,j), alb_ice(i,j), & & znt_ice(i,j), z0_ice(i,j), snoalb1d_ice(i,j), & & albbck_ice(i,j), xlai(i,j),landusef(i,:,j), nlcat, & - & soilctop(i,:,j), nscat, & + & soilctop(i,:,j), nscat, smcwlt(i,j), smcref(i,j), & & qsfc_ice(i,j), qsg_ice(i,j), qvg_ice(i,j), qcg_ice(i,j), & & dew_ice(i,j), soilt1_ice(i,j), & & tsnav_ice(i,j), tbot(i,j), vtype_ice(i,j), stype_ice(i,j), & @@ -1464,8 +1495,9 @@ subroutine lsm_ruc_run & ! inputs & infiltr(i,j), runoff1(i,j), runoff2(i,j), acrunoff(i,j), & & sfcexc(i,j), acceta(i,j), ssoil_ice(i,j), & & snfallac_ice(i,j), acsn_ice(i,j), snomlt_ice(i,j), & - & smfrice(i,:,j),keepfrice(i,:,j), .false., & - & shdmin1d(i,j), shdmax1d(i,j), rdlai2d, & + & smfrice(i,:,j),keepfrice(i,:,j), & + & add_fire_heat_flux,fire_heat_flux1d(i,j), .false., & + & shdmin1d(i,j), shdmax1d(i,j), rdlai, & & ims,ime, jms,jme, kms,kme, & & its,ite, jts,jte, kts,kte, & & errmsg, errflg) @@ -1502,6 +1534,10 @@ subroutine lsm_ruc_run & ! inputs albivis_ice(i) = sfalb_ice(i) albinir_ice(i) = sfalb_ice(i) + laixy(i) = zero + smcwlt2(i) = zero + smcref2(i) = one + stm(i) = 3.e3_kind_phys ! kg m-2 do k = 1, lsoil_ruc tsice(i,k) = stsice(i,k,j) @@ -1517,6 +1553,7 @@ subroutine lsm_ruc_run & ! inputs write (0,*)'ICE - i,j,stype_ice,vtype_ice)',i,j,stype_ice(i,j),vtype_ice(i,j) write (0,*)'i,j,tsurf_ice(i)',i,j,tsurf_ice(i) write (0,*)'kdt,iter,stsice(i,:,j)',kdt,iter,stsice(i,:,j) + write (0,*)'laixy(i)',laixy(i) endif endif ! ice @@ -1762,6 +1799,8 @@ subroutine rucinit (lsm_cold_start, im, lsoil_ruc, lsoil, & ! in tbot(i,j) = tg3(i) ivgtyp(i,j) = vtype(i) isltyp(i,j) = stype(i) + if(isltyp(i,j)==0) isltyp(i,j)=14 + if(ivgtyp(i,j)==0) ivgtyp(i,j)=17 if (landfrac(i) > zero .or. fice(i) > zero) then !-- land or ice tsk(i,j) = tskin_lnd(i) diff --git a/physics/lsm_ruc.meta b/physics/lsm_ruc.meta index 34a5b8a8b..4cc6a9419 100644 --- a/physics/lsm_ruc.meta +++ b/physics/lsm_ruc.meta @@ -813,7 +813,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = in + intent = inout [dlwflx] standard_name = surface_downwelling_longwave_flux long_name = surface downwelling longwave flux at current time @@ -1747,6 +1747,21 @@ dimensions = () type = logical intent = in +[add_fire_heat_flux] + standard_name = flag_for_fire_heat_flux + long_name = flag to add fire heat flux to LSM + units = flag + dimensions = () + type = logical + intent = in +[fire_heat_flux_out] + standard_name = surface_fire_heat_flux + long_name = heat flux of fire at the surface + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 160127e43..2bb29d440 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -97,6 +97,7 @@ SUBROUTINE LSMRUC(xlat,xlon, & MAVAIL,CANWAT,VEGFRA, & ALB,ZNT,Z0,SNOALB,ALBBCK,LAI, & landusef, nlcat, soilctop, nscat, & + smcwlt, smcref, & QSFC,QSG,QVG,QCG,DEW,SOILT1,TSNAV, & TBOT,IVGTYP,ISLTYP,XLAND, & ISWATER,ISICE,XICE,XICE_THRESHOLD, & @@ -107,6 +108,7 @@ SUBROUTINE LSMRUC(xlat,xlon, & RUNOFF1,RUNOFF2,ACRUNOFF,SFCEXC, & SFCEVP,GRDFLX,SNOWFALLAC,ACSNOW,SNOM, & SMFR3D,KEEPFR3DFLAG, & + add_fire_heat_flux,fire_heat_flux, & myj,shdmin,shdmax,rdlai2d, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte, & @@ -239,6 +241,8 @@ SUBROUTINE LSMRUC(xlat,xlon, & real (kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN ):: SHDMIN real (kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN ):: hgt real (kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN ):: stdev + LOGICAL, intent(in) :: add_fire_heat_flux + real (kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN ):: fire_heat_flux LOGICAL, intent(in) :: rdlai2d real (kind_phys), DIMENSION( 1:nsl), INTENT(IN ) :: ZS @@ -252,6 +256,8 @@ SUBROUTINE LSMRUC(xlat,xlon, & SNOALB, & ALB, & LAI, & + SMCWLT, & + SMCREF, & EMISS, & EMISBCK, & MAVAIL, & @@ -757,6 +763,8 @@ SUBROUTINE LSMRUC(xlat,xlon, & !-- update background emissivity for land points, can have vegetation mosaic effect EMISBCK(I,J) = EMISSL(I,J) + smcwlt(i,j) = wilt + smcref(i,j) = ref IF (debug_print ) THEN if(init)then @@ -961,6 +969,7 @@ SUBROUTINE LSMRUC(xlat,xlon, & snoalb(i,j),albbck(i,j),lai(i,j), & hgt(i,j),stdev(i,j), & !new myj,seaice(i,j),isice, & + add_fire_heat_flux,fire_heat_flux(i,j), & !--- soil fixed fields QWRTZ, & rhocs,dqm,qmin,ref, & @@ -1212,6 +1221,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia QKMS,TKMS,PC,MAVAIL,CST,VEGFRA,ALB,ZNT, & ALB_SNOW,ALB_SNOW_FREE,lai,hgt,stdev, & MYJ,SEAICE,ISICE, & + add_fire_heat_flux,fire_heat_flux, & QWRTZ,rhocs,dqm,qmin,ref,wilt,psis,bclh,ksat, & !--- soil fixed fields sat,cn,zsmain,zshalf,DTDZS,DTDZS2,tbq, & cp,rovcp,g0,lv,stbolt,cw,c1sn,c2sn, & !--- constants @@ -1256,7 +1266,9 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia SEAICE, & RHO, & QKMS, & - TKMS + TKMS, & + fire_heat_flux + LOGICAL, INTENT(IN ) :: add_fire_heat_flux INTEGER, INTENT(IN ) :: IVGTYP, ISLTYP !--- 2-D variables @@ -1813,6 +1825,10 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia UPFLUX = T3 *SOILT XINET = EMISS_snowfree*(GLW-UPFLUX) RNET = GSWnew + XINET + IF ( add_fire_heat_flux ) then ! JLS + RNET = RNET + fire_heat_flux + ENDIF + IF (debug_print ) THEN print *,'Fractional snow - snowfrac=',snowfrac print *,'Snowfrac<1 GSWin,GSWnew -',GSWin,GSWnew,'SOILT, RNET',soilt,rnet @@ -1933,6 +1949,9 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia if (SEAICE .LT. 0.5_kind_phys) then ! LAND + IF ( add_fire_heat_flux ) then ! JLS + RNET = RNET + fire_heat_flux + ENDIF if(snow_mosaic==one)then snfr=one else @@ -2049,6 +2068,9 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia eeta = eetas*(one-snowfrac) + eeta*snowfrac qfx = qfxs*(one-snowfrac) + qfx*snowfrac hfx = hfxs*(one-snowfrac) + hfx*snowfrac + !IF ( add_fire_heat_flux ) then ! JLS + ! hfx = hfx + fire_heat_flux + !ENDIF s = ss*(one-snowfrac) + s*snowfrac evapl = evapls*(one-snowfrac) sublim = sublim*snowfrac @@ -2094,6 +2116,9 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia eeta = eetas*(one-snowfrac) + eeta*snowfrac qfx = qfxs*(one-snowfrac) + qfx*snowfrac hfx = hfxs*(one-snowfrac) + hfx*snowfrac + !IF ( add_fire_heat_flux ) then ! JLS + ! hfx = hfx + fire_heat_flux + !ENDIF s = ss*(one-snowfrac) + s*snowfrac prcpl = prcpls*(one-snowfrac) + prcpl*snowfrac fltot = fltots*(one-snowfrac) + fltot*snowfrac @@ -6611,7 +6636,7 @@ SUBROUTINE TRANSF( debug_print, & /(REF-WILT)*DID ENDIF !-- uncomment next line for non-linear root distribution -! TRANF(k)=part(k) + TRANF(k)=part(k) END DO ! For LAI> 3 => transpiration at potential rate (F.Tardieu, 2013) From 876a1ac17df62f40a936418da7f22b15923bc10c Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Thu, 12 Oct 2023 19:34:14 +0000 Subject: [PATCH 042/249] Fire heat flux computation is added to the smoke-dust code. --- physics/smoke_dust/module_plumerise1.F90 | 4 ++++ physics/smoke_dust/module_smoke_plumerise.F90 | 12 ++++++++++-- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 13 ++++++++++--- physics/smoke_dust/rrfs_smoke_wrapper.meta | 8 ++++++++ 4 files changed, 32 insertions(+), 5 deletions(-) diff --git a/physics/smoke_dust/module_plumerise1.F90 b/physics/smoke_dust/module_plumerise1.F90 index 3c23faa6a..189bf981a 100755 --- a/physics/smoke_dust/module_plumerise1.F90 +++ b/physics/smoke_dust/module_plumerise1.F90 @@ -38,6 +38,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & t_phy,q_vap, & ! RAR: moist is replaced with q_vap rho_phy,vvel,u_phy,v_phy,p_phy, & z_at_w,z,g,con_cp,con_rd, & ! scale_fire_emiss is part of config_flags + fire_heat_flux,dxy, & plume_frp, k_min, k_max, & ! RAR: ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & @@ -66,6 +67,8 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & real(kind=kind_phys), INTENT(IN ) :: g, con_cp, con_rd real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: ebb_smoke real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(OUT ) :: flam_frac + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(OUT ) :: fire_heat_flux + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: dxy ! real(kind=kind_phys), DIMENSION( ims:ime, 1, jms:jme ), & ! INTENT(IN ) :: ebu_in @@ -184,6 +187,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & !num_ebu, eburn_in, eburn_out, & u_in, v_in, w_in, theta_in ,pi_in, & rho_phyin, qv_in, zmid, z_lev, & + fire_heat_flux(i,j),dxy(i,j), & plume_frp(i,j,1), k_min(i,j), & k_max(i,j), dbg_opt, g, con_cp, & con_rd, cpor, errmsg, errflg ) diff --git a/physics/smoke_dust/module_smoke_plumerise.F90 b/physics/smoke_dust/module_smoke_plumerise.F90 index 61be06181..9c0dfa49d 100755 --- a/physics/smoke_dust/module_smoke_plumerise.F90 +++ b/physics/smoke_dust/module_smoke_plumerise.F90 @@ -28,6 +28,7 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & ! firesize,mean_fct, & ! nspecies,eburn_in,eburn_out, & up,vp,wp,theta,pp,dn0,rv,zt_rams,zm_rams, & + fire_heat_flux, dxy, & frp_inst,k1,k2, dbg_opt, g, cp, rgas, & cpor, errmsg, errflg ) @@ -43,6 +44,9 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & integer :: ng,m1,m2,m3,ia,iz,ja,jz,ibcon,mynum,i,j,k,imm,ixx,ispc !,nspecies + real(kind=kind_phys), intent(in) :: dxy + real(kind=kind_phys), intent(out) :: fire_heat_flux ! JLS + INTEGER, INTENT (OUT) :: k1,k2 character(*), intent(inout) :: errmsg integer, intent(inout) :: errflg @@ -106,6 +110,7 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & IF (frp_inst Date: Thu, 12 Oct 2023 21:31:36 +0000 Subject: [PATCH 043/249] Fix the segmentation fault error in computing fire heat flux. --- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index f9b15a494..e6a398363 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -353,10 +353,10 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte, errmsg, errflg ) if(errflg/=0) return - end if - do i = its,ite + do i = its,ite fire_heat_flux_out(i) = min(max(0.,fire_heat_flux(i,1)),50000.) ! JLS - W m-2 [0 - 10,000] - enddo + enddo + end if ! -- add biomass burning emissions at every timestep if (addsmoke_flag == 1) then call add_emis_burn(dt,dz8w,rho_phy,rel_hum,chem, & From 4e45989d1f6f78bb05aa789289d4cebebe9217b7 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Mon, 16 Oct 2023 09:46:45 -0400 Subject: [PATCH 044/249] Code update for HR4_roughness --- physics/sfc_diff.f | 43 +++++++++++++++++++++++++++++-------------- 1 file changed, 29 insertions(+), 14 deletions(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 6e834537a..561a087c4 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -348,12 +348,26 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) tvs = half * (tsurf_wat(i)+tskin_wat(i))/prsik1(i) & * virtfac endif - - z0 = 0.01_kp * z0rl_wat(i) - z0max = max(zmin, min(z0,z1(i))) -! ustar_wat(i) = sqrt(grav * z0 / charnock) +! wind10m = sqrt(u10m(i)*u10m(i)+v10m(i)*v10m(i)) +! + if (sfc_z0_type == -1) then ! using wave model derived momentum roughness + tem1 = 0.11 * vis / ustar_wat(i) + z0 = tem1 + 0.01_kp * z0rl_wav(i) + if (redrag) then + z0max = max(min(z0, z0s_max),1.0e-7_kp) + else + z0max = max(min(z0,0.1_kp), 1.0e-7_kp) + endif + z0rl_wat(i) = 100.0_kp * z0max ! cm + else + z0 = 0.01_kp * z0rl_wat(i) + z0max = max(zmin, min(z0,z1(i))) + endif +! +! ustar_wat(i) = sqrt(grav * z0 / charnock) +! !** test xubin's new z0 ! ztmax = z0max @@ -423,17 +437,18 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0rl_wat(i) = 1.0e-4_kp endif - elseif (z0rl_wav(i) <= 1.0e-7_kp .or. & - & z0rl_wav(i) > 1.0_kp) then -! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i) - tem1 = 0.11 * vis / ustar_wat(i) - z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i) +! elseif (z0rl_wav(i) <= 1.0e-7_kp .or. & +! & z0rl_wav(i) > 1.0_kp) then +!! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i) +! tem1 = 0.11 * vis / ustar_wat(i) +! z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i) + +! if (redrag) then +! z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max),1.0e-7_kp) +! else +! z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.0e-7_kp) +! endif - if (redrag) then - z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max),1.0e-7_kp) - else - z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.0e-7_kp) - endif endif endif ! end of if(open ocean) From 3debf89fdc94111624f0b99da71e605418824183 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Mon, 16 Oct 2023 10:45:21 -0400 Subject: [PATCH 045/249] Code update for HR4_roughness --- physics/sfc_diff.f | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 561a087c4..d56308b79 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -437,18 +437,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0rl_wat(i) = 1.0e-4_kp endif -! elseif (z0rl_wav(i) <= 1.0e-7_kp .or. & -! & z0rl_wav(i) > 1.0_kp) then -!! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i) -! tem1 = 0.11 * vis / ustar_wat(i) -! z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i) - -! if (redrag) then -! z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max),1.0e-7_kp) -! else -! z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.0e-7_kp) -! endif - endif endif ! end of if(open ocean) From c2b130113acf235e7c5e65bfd5f97ca2e8e3a3d7 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Mon, 16 Oct 2023 10:55:07 -0400 Subject: [PATCH 046/249] Code update for HR4_roughness --- physics/sfc_diff.f | 2 -- 1 file changed, 2 deletions(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index d56308b79..b28daef3b 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -366,8 +366,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0max = max(zmin, min(z0,z1(i))) endif ! -! ustar_wat(i) = sqrt(grav * z0 / charnock) -! !** test xubin's new z0 ! ztmax = z0max From 16e640eca60eeadb77078c2cf251f99fd7a8f469 Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Mon, 16 Oct 2023 19:25:15 +0000 Subject: [PATCH 047/249] updates from HFIP dev branch --- physics/GFS_debug.F90 | 4 +- physics/module_bl_mynn.F90 | 1579 ++++++++++++++++---------------- physics/module_mp_thompson.F90 | 19 +- physics/module_sf_mynn.F90 | 6 +- physics/mynnedmf_wrapper.F90 | 13 +- physics/mynnedmf_wrapper.meta | 21 +- 6 files changed, 845 insertions(+), 797 deletions(-) diff --git a/physics/GFS_debug.F90 b/physics/GFS_debug.F90 index fe63c1cea..ed26b795f 100644 --- a/physics/GFS_debug.F90 +++ b/physics/GFS_debug.F90 @@ -747,9 +747,9 @@ subroutine GFS_diagtoscreen_run (Model, Statein, Stateout, Sfcprop, Coupling, call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_thl ', Diag%det_thl) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%det_sqv ', Diag%det_sqv) end if - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%nupdraft ', Diag%nupdraft) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%maxwidth ', Diag%maxwidth) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%maxMF ', Diag%maxMF) - call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%ktop_plume ', Diag%ktop_plume) + call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%ztop_plume ', Diag%ztop_plume) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%exch_h ', Diag%exch_h) call print_var(mpirank, omprank, blkno, Grid%xlat_d, Grid%xlon_d, 'Diag%exch_m ', Diag%exch_m) end if diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index ec6b5700d..943a5c81d 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -1,5 +1,5 @@ !>\file module_bl_mynn.F90 -!! This file contains the entity of MYNN-EDMF PBL scheme. +! This file contains the entity of MYNN-EDMF PBL scheme. ! ********************************************************************** ! * An improved Mellor-Yamada turbulence closure model * ! * * @@ -256,11 +256,11 @@ MODULE module_bl_mynn !=================================================================== ! From here on, these are MYNN-specific parameters: ! The parameters below depend on stability functions of module_sf_mynn. - real(kind_phys), PARAMETER :: cphm_st=5.0, cphm_unst=16.0, & + real(kind_phys), parameter :: cphm_st=5.0, cphm_unst=16.0, & cphh_st=5.0, cphh_unst=16.0 ! Closure constants - real(kind_phys), PARAMETER :: & + real(kind_phys), parameter :: & &pr = 0.74, & &g1 = 0.235, & ! NN2009 = 0.235 &b1 = 24.0, & @@ -275,7 +275,7 @@ MODULE module_bl_mynn &a2 = a1*( g1-c1 )/( g1*pr ), & &g2 = b2/b1*( 1.0-c3 ) +2.0*a1/b1*( 3.0-2.0*c2 ) - real(kind_phys), PARAMETER :: & + real(kind_phys), parameter :: & &cc2 = 1.0-c2, & &cc3 = 1.0-c3, & &e1c = 3.0*a2*b2*cc3, & @@ -286,15 +286,15 @@ MODULE module_bl_mynn ! Constants for min tke in elt integration (qmin), max z/L in els (zmax), ! and factor for eddy viscosity for TKE (Kq = Sqfac*Km): - real(kind_phys), PARAMETER :: qmin=0.0, zmax=1.0, Sqfac=3.0 + real(kind_phys), parameter :: qmin=0.0, zmax=1.0, Sqfac=3.0 ! Note that the following mixing-length constants are now specified in mym_length ! &cns=3.5, alp1=0.23, alp2=0.3, alp3=3.0, alp4=10.0, alp5=0.2 - real(kind_phys), PARAMETER :: gpw=5./3., qcgmin=1.e-8, qkemin=1.e-12 - real(kind_phys), PARAMETER :: tliq = 269. !all hydrometeors are liquid when T > tliq + real(kind_phys), parameter :: gpw=5./3., qcgmin=1.e-8, qkemin=1.e-12 + real(kind_phys), parameter :: tliq = 269. !all hydrometeors are liquid when T > tliq ! Constants for cloud PDF (mym_condensation) - real(kind_phys), PARAMETER :: rr2=0.7071068, rrp=0.3989423 + real(kind_phys), parameter :: rr2=0.7071068, rrp=0.3989423 !>Use Canuto/Kitamura mod (remove Ric and negative TKE) (1:yes, 0:no) !!For more info, see Canuto et al. (2008 JAS) and Kitamura (Journal of the @@ -304,35 +304,35 @@ MODULE module_bl_mynn !!(above) back to NN2009 values (see commented out lines next to the !!parameters above). This only removes the negative TKE problem !!but does not necessarily improve performance - neutral impact. - real(kind_phys), PARAMETER :: CKmod=1. + real(kind_phys), parameter :: CKmod=1. !>Use Ito et al. (2015, BLM) scale-aware (0: no, 1: yes). Note that this also has impacts !!on the cloud PDF and mass-flux scheme, using Honnert et al. (2011) similarity function !!for TKE in the upper PBL/cloud layer. - real(kind_phys), PARAMETER :: scaleaware=1. + real(kind_phys), parameter :: scaleaware=1. !>Of the following the options, use one OR the other, not both. !>Adding top-down diffusion driven by cloud-top radiative cooling - INTEGER, PARAMETER :: bl_mynn_topdown = 0 + integer, parameter :: bl_mynn_topdown = 0 !>Option to activate downdrafts, from Elynn Wu (0: deactive, 1: active) - INTEGER, PARAMETER :: bl_mynn_edmf_dd = 0 + integer, parameter :: bl_mynn_edmf_dd = 0 !>Option to activate heating due to dissipation of TKE (to activate, set to 1.0) - INTEGER, PARAMETER :: dheat_opt = 1 + integer, parameter :: dheat_opt = 1 !Option to activate environmental subsidence in mass-flux scheme - LOGICAL, PARAMETER :: env_subs = .false. + logical, parameter :: env_subs = .false. !Option to switch flux-profile relationship for surface (from Puhales et al. 2020) !0: use original Dyer-Hicks, 1: use Cheng-Brustaert and Blended COARE - INTEGER, PARAMETER :: bl_mynn_stfunc = 1 + integer, parameter :: bl_mynn_stfunc = 1 !option to print out more stuff for debugging purposes - LOGICAL, PARAMETER :: debug_code = .false. - INTEGER, PARAMETER :: idbg = 23 !specific i-point to write out + logical, parameter :: debug_code = .false. + integer, parameter :: idbg = 23 !specific i-point to write out ! Used in WRF-ARW module_physics_init.F - INTEGER :: mynn_level + integer :: mynn_level CONTAINS @@ -388,7 +388,8 @@ SUBROUTINE mynn_bl_driver( & &edmf_thl,edmf_ent,edmf_qc, & &sub_thl3D,sub_sqv3D, & &det_thl3D,det_sqv3D, & - &nupdraft,maxMF,ktop_plume, & + &maxwidth,maxMF,ztop_plume, & + &ktop_plume, & &spp_pbl,pattern_spp_pbl, & &rthraten, & &FLAG_QC,FLAG_QI,FLAG_QNC, & @@ -401,30 +402,30 @@ SUBROUTINE mynn_bl_driver( & !------------------------------------------------------------------- - INTEGER, INTENT(in) :: initflag + integer, intent(in) :: initflag !INPUT NAMELIST OPTIONS: - LOGICAL, INTENT(in) :: restart,cycling - INTEGER, INTENT(in) :: tke_budget - INTEGER, INTENT(in) :: bl_mynn_cloudpdf - INTEGER, INTENT(in) :: bl_mynn_mixlength - INTEGER, INTENT(in) :: bl_mynn_edmf - LOGICAL, INTENT(in) :: bl_mynn_tkeadvect - INTEGER, INTENT(in) :: bl_mynn_edmf_mom - INTEGER, INTENT(in) :: bl_mynn_edmf_tke - INTEGER, INTENT(in) :: bl_mynn_mixscalars - INTEGER, INTENT(in) :: bl_mynn_output - INTEGER, INTENT(in) :: bl_mynn_cloudmix - INTEGER, INTENT(in) :: bl_mynn_mixqt - INTEGER, INTENT(in) :: icloud_bl - real(kind_phys), INTENT(in) :: closure - - LOGICAL, INTENT(in) :: FLAG_QI,FLAG_QNI,FLAG_QC,FLAG_QNC,& + logical, intent(in) :: restart,cycling + integer, intent(in) :: tke_budget + integer, intent(in) :: bl_mynn_cloudpdf + integer, intent(in) :: bl_mynn_mixlength + integer, intent(in) :: bl_mynn_edmf + logical, intent(in) :: bl_mynn_tkeadvect + integer, intent(in) :: bl_mynn_edmf_mom + integer, intent(in) :: bl_mynn_edmf_tke + integer, intent(in) :: bl_mynn_mixscalars + integer, intent(in) :: bl_mynn_output + integer, intent(in) :: bl_mynn_cloudmix + integer, intent(in) :: bl_mynn_mixqt + integer, intent(in) :: icloud_bl + real(kind_phys), intent(in) :: closure + + logical, intent(in) :: FLAG_QI,FLAG_QNI,FLAG_QC,FLAG_QNC,& FLAG_QNWFA,FLAG_QNIFA,FLAG_QNBCA, & FLAG_OZONE,FLAG_QS - LOGICAL, INTENT(IN) :: mix_chem,enh_mix,rrfs_sd,smoke_dbg + logical, intent(in) :: mix_chem,enh_mix,rrfs_sd,smoke_dbg - INTEGER, INTENT(in) :: & + integer, intent(in) :: & & IDS,IDE,JDS,JDE,KDS,KDE & &,IMS,IME,JMS,JME,KMS,KME & &,ITS,ITE,JTS,JTE,KTS,KTE @@ -444,81 +445,82 @@ SUBROUTINE mynn_bl_driver( & ! to prevent a crash on Cheyenne. Do not change it back without testing if the code runs ! on Cheyenne with the GNU compiler. - real(kind_phys), INTENT(in) :: delt - real(kind_phys), DIMENSION(:), INTENT(in) :: dx - real(kind_phys), DIMENSION(:,:), INTENT(in) :: dz, & + real(kind_phys), intent(in) :: delt + real(kind_phys), dimension(:), intent(in) :: dx + real(kind_phys), dimension(:,:), intent(in) :: dz, & &u,v,w,th,sqv3D,p,exner,rho,T3D - real(kind_phys), DIMENSION(:,:), INTENT(in) :: & + real(kind_phys), dimension(:,:), intent(in) :: & &sqc3D,sqi3D,sqs3D,qni,qnc,qnwfa,qnifa,qnbca - real(kind_phys), DIMENSION(:,:), INTENT(in):: ozone - real(kind_phys), DIMENSION(:), INTENT(in):: ust, & + real(kind_phys), dimension(:,:), intent(in):: ozone + real(kind_phys), dimension(:), intent(in):: ust, & &ch,qsfc,ps,wspd - real(kind_phys), DIMENSION(:,:), INTENT(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & &Qke,Tsq,Qsq,Cov,qke_adv - real(kind_phys), DIMENSION(:,:), INTENT(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & &rublten,rvblten,rthblten,rqvblten,rqcblten, & &rqiblten,rqsblten,rqniblten,rqncblten, & &rqnwfablten,rqnifablten,rqnbcablten - real(kind_phys), DIMENSION(:,:), INTENT(inout) :: dozone - real(kind_phys), DIMENSION(:,:), INTENT(in) :: rthraten + real(kind_phys), dimension(:,:), intent(inout) :: dozone + real(kind_phys), dimension(:,:), intent(in) :: rthraten - real(kind_phys), DIMENSION(:,:), INTENT(out) :: exch_h,exch_m - real(kind_phys), DIMENSION(:), INTENT(in) :: xland, & + real(kind_phys), dimension(:,:), intent(out) :: exch_h,exch_m + real(kind_phys), dimension(:), intent(in) :: xland, & &ts,znt,hfx,qfx,uoce,voce !These 10 arrays are only allocated when bl_mynn_output > 0 - real(kind_phys), DIMENSION(:,:), INTENT(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & & edmf_a,edmf_w,edmf_qt,edmf_thl,edmf_ent,edmf_qc, & & sub_thl3D,sub_sqv3D,det_thl3D,det_sqv3D -! real, DIMENSION(IMS:IME,KMS:KME) :: & +! real, dimension(ims:ime,kms:kme) :: & ! & edmf_a_dd,edmf_w_dd,edmf_qt_dd,edmf_thl_dd,edmf_ent_dd,edmf_qc_dd - real(kind_phys), DIMENSION(:), INTENT(inout) :: Pblh - real(kind_phys), DIMENSION(:), INTENT(inout) :: rmol + real(kind_phys), dimension(:), intent(inout) :: Pblh + real(kind_phys), dimension(:), intent(inout) :: rmol - real(kind_phys), DIMENSION(IMS:IME) :: psig_bl,psig_shcu + real(kind_phys), dimension(ims:ime) :: psig_bl,psig_shcu - INTEGER,DIMENSION(:),INTENT(INOUT) :: & - &KPBL,nupdraft,ktop_plume + integer,dimension(:),intent(INOUT) :: & + &KPBL,ktop_plume - real(kind_phys), DIMENSION(:), INTENT(out) :: maxmf + real(kind_phys), dimension(:), intent(out) :: & + &maxmf,maxwidth,ztop_plume - real(kind_phys), DIMENSION(:,:), INTENT(inout) :: el_pbl + real(kind_phys), dimension(:,:), intent(inout) :: el_pbl - real(kind_phys), DIMENSION(:,:), INTENT(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & &qWT,qSHEAR,qBUOY,qDISS,dqke ! 3D budget arrays are not allocated when tke_budget == 0 ! 1D (local) budget arrays are used for passing between subroutines. - real(kind_phys), DIMENSION(kts:kte) :: & + real(kind_phys), dimension(kts:kte) :: & &qwt1,qshear1,qbuoy1,qdiss1,dqke1,diss_heat - real(kind_phys), DIMENSION(:,:), intent(out) :: Sh3D,Sm3D + real(kind_phys), dimension(:,:), intent(out) :: Sh3D,Sm3D - real(kind_phys), DIMENSION(:,:), INTENT(inout) :: & + real(kind_phys), dimension(:,:), intent(inout) :: & &qc_bl,qi_bl,cldfra_bl - real(kind_phys), DIMENSION(KTS:KTE) :: qc_bl1D,qi_bl1D, & + real(kind_phys), dimension(kts:kte) :: qc_bl1D,qi_bl1D, & &cldfra_bl1D,qc_bl1D_old,qi_bl1D_old,cldfra_bl1D_old ! smoke/chemical arrays - INTEGER, INTENT(IN ) :: nchem, kdvel, ndvel - real(kind_phys), DIMENSION(:,:,:), INTENT(INOUT) :: chem3d - real(kind_phys), DIMENSION(:,:), INTENT(IN) :: vdep - real(kind_phys), DIMENSION(:), INTENT(IN) :: frp,EMIS_ANT_NO + integer, intent(IN ) :: nchem, kdvel, ndvel + real(kind_phys), dimension(:,:,:), intent(INOUT) :: chem3d + real(kind_phys), dimension(:,:), intent(IN) :: vdep + real(kind_phys), dimension(:), intent(IN) :: frp,EMIS_ANT_NO !local - real(kind_phys), DIMENSION(kts:kte ,nchem) :: chem1 - real(kind_phys), DIMENSION(kts:kte+1,nchem) :: s_awchem1 - real(kind_phys), DIMENSION(ndvel) :: vd1 - INTEGER :: ic + real(kind_phys), dimension(kts:kte ,nchem) :: chem1 + real(kind_phys), dimension(kts:kte+1,nchem) :: s_awchem1 + real(kind_phys), dimension(ndvel) :: vd1 + integer :: ic !local vars - INTEGER :: ITF,JTF,KTF, IMD,JMD - INTEGER :: i,j,k,kproblem - real(kind_phys), DIMENSION(KTS:KTE) :: & + integer :: ITF,JTF,KTF, IMD,JMD + integer :: i,j,k,kproblem + real(kind_phys), dimension(kts:kte) :: & &thl,tl,qv1,qc1,qi1,qs1,sqw, & &el, dfm, dfh, dfq, tcd, qcd, pdk, pdt, pdq, pdc, & &vt, vq, sgm - real(kind_phys), DIMENSION(KTS:KTE) :: & + real(kind_phys), dimension(kts:kte) :: & &thetav,sh,sm,u1,v1,w1,p1, & &ex1,dz1,th1,tk1,rho1,qke1,tsq1,qsq1,cov1, & &sqv,sqi,sqc,sqs, & @@ -527,45 +529,45 @@ SUBROUTINE mynn_bl_driver( & &qnbca1,dqnwfa1,dqnifa1,dqnbca1,dozone1 !mass-flux variables - real(kind_phys), DIMENSION(KTS:KTE) :: & + real(kind_phys), dimension(kts:kte) :: & &dth1mf,dqv1mf,dqc1mf,du1mf,dv1mf - real(kind_phys), DIMENSION(KTS:KTE) :: & + real(kind_phys), dimension(kts:kte) :: & &edmf_a1,edmf_w1,edmf_qt1,edmf_thl1, & &edmf_ent1,edmf_qc1 - real(kind_phys), DIMENSION(KTS:KTE) :: & + real(kind_phys), dimension(kts:kte) :: & &edmf_a_dd1,edmf_w_dd1,edmf_qt_dd1,edmf_thl_dd1, & &edmf_ent_dd1,edmf_qc_dd1 - real(kind_phys), DIMENSION(KTS:KTE) :: & + real(kind_phys), dimension(kts:kte) :: & &sub_thl,sub_sqv,sub_u,sub_v, & &det_thl,det_sqv,det_sqc,det_u,det_v - real(kind_phys), DIMENSION(KTS:KTE+1) :: & + real(kind_phys), dimension(kts:kte+1) :: & &s_aw1,s_awthl1,s_awqt1, & &s_awqv1,s_awqc1,s_awu1,s_awv1,s_awqke1, & &s_awqnc1,s_awqni1,s_awqnwfa1,s_awqnifa1, & &s_awqnbca1 - real(kind_phys), DIMENSION(KTS:KTE+1) :: & + real(kind_phys), dimension(kts:kte+1) :: & &sd_aw1,sd_awthl1,sd_awqt1, & &sd_awqv1,sd_awqc1,sd_awu1,sd_awv1,sd_awqke1 - real(kind_phys), DIMENSION(KTS:KTE+1) :: zw + real(kind_phys), dimension(kts:kte+1) :: zw real(kind_phys) :: cpm,sqcg,flt,fltv,flq,flqv,flqc, & &pmz,phh,exnerg,zet,phi_m, & &afk,abk,ts_decay, qc_bl2, qi_bl2, & - &th_sfc,ztop_plume,wsp + &th_sfc,wsp !top-down diffusion - real(kind_phys), DIMENSION(ITS:ITE) :: maxKHtopdown - real(kind_phys), DIMENSION(KTS:KTE) :: KHtopdown,TKEprodTD + real(kind_phys), dimension(ITS:ITE) :: maxKHtopdown + real(kind_phys), dimension(kts:kte) :: KHtopdown,TKEprodTD - LOGICAL :: INITIALIZE_QKE,problem + logical :: INITIALIZE_QKE,problem ! Stochastic fields - INTEGER, INTENT(IN) :: spp_pbl - real(kind_phys), DIMENSION(:,:), INTENT(IN) :: pattern_spp_pbl - real(kind_phys), DIMENSION(KTS:KTE) :: rstoch_col + integer, intent(IN) :: spp_pbl + real(kind_phys), dimension(:,:), intent(IN) :: pattern_spp_pbl + real(kind_phys), dimension(KTS:KTE) :: rstoch_col ! Substepping TKE - INTEGER :: nsub + integer :: nsub real(kind_phys) :: delt2 @@ -629,7 +631,8 @@ SUBROUTINE mynn_bl_driver( & !edmf_qc_dd(its:ite,kts:kte)=0. ENDIF ktop_plume(its:ite)=0 !int - nupdraft(its:ite)=0 !int + ztop_plume(its:ite)=0. + maxwidth(its:ite)=0. maxmf(its:ite)=0. maxKHtopdown(its:ite)=0. @@ -1021,7 +1024,7 @@ SUBROUTINE mynn_bl_driver( & endif s_awchem1 = 0.0 -!> - Call get_pblh() to calculate the hybrid \f$\theta_{vli}-TKE\f$ +!> - Call get_pblh() to calculate the hybrid \f$\theta_{v}-TKE\f$ !! PBL height diagnostic. CALL GET_PBLH(KTS,KTE,PBLH(i),thetav,& & Qke1,zw,dz1,xland(i),KPBL(i)) @@ -1147,8 +1150,8 @@ SUBROUTINE mynn_bl_driver( & &FLAG_QNC,FLAG_QNI, & &FLAG_QNWFA,FLAG_QNIFA,FLAG_QNBCA, & &Psig_shcu(i), & - &nupdraft(i),ktop_plume(i), & - &maxmf(i),ztop_plume, & + &maxwidth(i),ktop_plume(i), & + &maxmf(i),ztop_plume(i), & &spp_pbl,rstoch_col ) endif @@ -1295,27 +1298,27 @@ SUBROUTINE mynn_bl_driver( & &dfm, dfh, dz1, K_m1, K_h1 ) !UPDATE 3D ARRAYS - exch_m(i,:) =k_m1(:) - exch_h(i,:) =k_h1(:) - rublten(i,:) =du1(:) - rvblten(i,:) =dv1(:) - rthblten(i,:)=dth1(:) - rqvblten(i,:)=dqv1(:) + exch_m(i,kts:kte) =k_m1(kts:kte) + exch_h(i,kts:kte) =k_h1(kts:kte) + rublten(i,kts:kte) =du1(kts:kte) + rvblten(i,kts:kte) =dv1(kts:kte) + rthblten(i,kts:kte)=dth1(kts:kte) + rqvblten(i,kts:kte)=dqv1(kts:kte) if (bl_mynn_cloudmix > 0) then - if (flag_qc) rqcblten(i,:)=dqc1(:) - if (flag_qi) rqiblten(i,:)=dqi1(:) - if (flag_qs) rqsblten(i,:)=dqs1(:) + if (flag_qc) rqcblten(i,kts:kte)=dqc1(kts:kte) + if (flag_qi) rqiblten(i,kts:kte)=dqi1(kts:kte) + if (flag_qs) rqsblten(i,kts:kte)=dqs1(kts:kte) else if (flag_qc) rqcblten(i,:)=0. if (flag_qi) rqiblten(i,:)=0. if (flag_qs) rqsblten(i,:)=0. endif if (bl_mynn_cloudmix > 0 .and. bl_mynn_mixscalars > 0) then - if (flag_qnc) rqncblten(i,:) =dqnc1(:) - if (flag_qni) rqniblten(i,:) =dqni1(:) - if (flag_qnwfa) rqnwfablten(i,:)=dqnwfa1(:) - if (flag_qnifa) rqnifablten(i,:)=dqnifa1(:) - if (flag_qnbca) rqnbcablten(i,:)=dqnbca1(:) + if (flag_qnc) rqncblten(i,kts:kte) =dqnc1(kts:kte) + if (flag_qni) rqniblten(i,kts:kte) =dqni1(kts:kte) + if (flag_qnwfa) rqnwfablten(i,kts:kte)=dqnwfa1(kts:kte) + if (flag_qnifa) rqnifablten(i,kts:kte)=dqnifa1(kts:kte) + if (flag_qnbca) rqnbcablten(i,kts:kte)=dqnbca1(kts:kte) else if (flag_qnc) rqncblten(i,:) =0. if (flag_qni) rqniblten(i,:) =0. @@ -1323,19 +1326,19 @@ SUBROUTINE mynn_bl_driver( & if (flag_qnifa) rqnifablten(i,:)=0. if (flag_qnbca) rqnbcablten(i,:)=0. endif - dozone(i,:)=dozone1(:) + dozone(i,kts:kte)=dozone1(kts:kte) if (icloud_bl > 0) then - qc_bl(i,:) =qc_bl1D(:) - qi_bl(i,:) =qi_bl1D(:) - cldfra_bl(i,:)=cldfra_bl1D(:) + qc_bl(i,kts:kte) =qc_bl1D(kts:kte) + qi_bl(i,kts:kte) =qi_bl1D(kts:kte) + cldfra_bl(i,kts:kte)=cldfra_bl1D(kts:kte) endif - el_pbl(i,:)=el(:) - qke(i,:) =qke1(:) - tsq(i,:) =tsq1(:) - qsq(i,:) =qsq1(:) - cov(i,:) =cov1(:) - sh3d(i,:) =sh(:) - sm3d(i,:) =sm(:) + el_pbl(i,kts:kte)=el(kts:kte) + qke(i,kts:kte) =qke1(kts:kte) + tsq(i,kts:kte) =tsq1(kts:kte) + qsq(i,kts:kte) =qsq1(kts:kte) + cov(i,kts:kte) =cov1(kts:kte) + sh3d(i,kts:kte) =sh(kts:kte) + sm3d(i,kts:kte) =sm(kts:kte) if (tke_budget .eq. 1) then !! TKE budget is now given in m**2/s**-3 (Puhales, 2020) @@ -1363,24 +1366,24 @@ SUBROUTINE mynn_bl_driver( & !update updraft/downdraft properties if (bl_mynn_output > 0) then !research mode == 1 if (bl_mynn_edmf > 0) then - edmf_a(i,:) =edmf_a1(:) - edmf_w(i,:) =edmf_w1(:) - edmf_qt(i,:) =edmf_qt1(:) - edmf_thl(i,:) =edmf_thl1(:) - edmf_ent(i,:) =edmf_ent1(:) - edmf_qc(i,:) =edmf_qc1(:) - sub_thl3D(i,:)=sub_thl(:) - sub_sqv3D(i,:)=sub_sqv(:) - det_thl3D(i,:)=det_thl(:) - det_sqv3D(i,:)=det_sqv(:) + edmf_a(i,kts:kte) =edmf_a1(kts:kte) + edmf_w(i,kts:kte) =edmf_w1(kts:kte) + edmf_qt(i,kts:kte) =edmf_qt1(kts:kte) + edmf_thl(i,kts:kte) =edmf_thl1(kts:kte) + edmf_ent(i,kts:kte) =edmf_ent1(kts:kte) + edmf_qc(i,kts:kte) =edmf_qc1(kts:kte) + sub_thl3D(i,kts:kte)=sub_thl(kts:kte) + sub_sqv3D(i,kts:kte)=sub_sqv(kts:kte) + det_thl3D(i,kts:kte)=det_thl(kts:kte) + det_sqv3D(i,kts:kte)=det_sqv(kts:kte) endif !if (bl_mynn_edmf_dd > 0) THEN - ! edmf_a_dd(i,:) =edmf_a_dd1(:) - ! edmf_w_dd(i,:) =edmf_w_dd1(:) - ! edmf_qt_dd(i,:) =edmf_qt_dd1(:) - ! edmf_thl_dd(i,:)=edmf_thl_dd1(:) - ! edmf_ent_dd(i,:)=edmf_ent_dd1(:) - ! edmf_qc_dd(i,:) =edmf_qc_dd1(:) + ! edmf_a_dd(i,kts:kte) =edmf_a_dd1(kts:kte) + ! edmf_w_dd(i,kts:kte) =edmf_w_dd1(kts:kte) + ! edmf_qt_dd(i,kts:kte) =edmf_qt_dd1(kts:kte) + ! edmf_thl_dd(i,kts:kte)=edmf_thl_dd1(kts:kte) + ! edmf_ent_dd(i,kts:kte)=edmf_ent_dd1(kts:kte) + ! edmf_qc_dd(i,kts:kte) =edmf_qc_dd1(kts:kte) !endif endif @@ -1509,27 +1512,27 @@ SUBROUTINE mym_initialize ( & ! !------------------------------------------------------------------- - integer, INTENT(IN) :: kts,kte - integer, INTENT(IN) :: bl_mynn_mixlength - logical, INTENT(IN) :: INITIALIZE_QKE -! real(kind_phys), INTENT(IN) :: ust, rmo, pmz, phh, flt, flq - real(kind_phys), INTENT(IN) :: rmo, Psig_bl, xland - real(kind_phys), INTENT(IN) :: dx, ust, zi - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: dz - real(kind_phys), DIMENSION(kts:kte+1), INTENT(in) :: zw - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: u,v,thl,& + integer, intent(in) :: kts,kte + integer, intent(in) :: bl_mynn_mixlength + logical, intent(in) :: INITIALIZE_QKE +! real(kind_phys), intent(in) :: ust, rmo, pmz, phh, flt, flq + real(kind_phys), intent(in) :: rmo, Psig_bl, xland + real(kind_phys), intent(in) :: dx, ust, zi + real(kind_phys), dimension(kts:kte), intent(in) :: dz + real(kind_phys), dimension(kts:kte+1), intent(in) :: zw + real(kind_phys), dimension(kts:kte), intent(in) :: u,v,thl,& &qw,cldfra_bl1D,edmf_w1,edmf_a1 - real(kind_phys), DIMENSION(kts:kte), INTENT(out) :: tsq,qsq,cov - real(kind_phys), DIMENSION(kts:kte), INTENT(inout) :: el,qke - real(kind_phys), DIMENSION(kts:kte) :: & + real(kind_phys), dimension(kts:kte), intent(out) :: tsq,qsq,cov + real(kind_phys), dimension(kts:kte), intent(inout) :: el,qke + real(kind_phys), dimension(kts:kte) :: & &ql,pdk,pdt,pdq,pdc,dtl,dqw,dtv, & &gm,gh,sm,sh,qkw,vt,vq - INTEGER :: k,l,lmax + integer :: k,l,lmax real(kind_phys):: phm,vkz,elq,elv,b1l,b2l,pmz=1.,phh=1., & &flt=0.,fltv=0.,flq=0.,tmpq - real(kind_phys), DIMENSION(kts:kte) :: theta,thetav - real(kind_phys), DIMENSION(kts:kte) :: rstoch_col - INTEGER ::spp_pbl + real(kind_phys), dimension(kts:kte) :: theta,thetav + real(kind_phys), dimension(kts:kte) :: rstoch_col + integer ::spp_pbl !> - At first ql, vt and vq are set to zero. DO k = kts,kte @@ -1706,17 +1709,17 @@ SUBROUTINE mym_level2 (kts,kte, & ! !------------------------------------------------------------------- - INTEGER, INTENT(IN) :: kts,kte + integer, intent(in) :: kts,kte #ifdef HARDCODE_VERTICAL # define kts 1 # define kte HARDCODE_VERTICAL #endif - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: dz - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: u,v, & + real(kind_phys), dimension(kts:kte), intent(in) :: dz + real(kind_phys), dimension(kts:kte), intent(in) :: u,v, & &thl,qw,ql,vt,vq,thetav - real(kind_phys), DIMENSION(kts:kte), INTENT(out) :: & + real(kind_phys), dimension(kts:kte), intent(out) :: & &dtl,dqw,dtv,gm,gh,sm,sh integer :: k @@ -1844,25 +1847,25 @@ SUBROUTINE mym_length ( & !------------------------------------------------------------------- - INTEGER, INTENT(IN) :: kts,kte + integer, intent(in) :: kts,kte #ifdef HARDCODE_VERTICAL # define kts 1 # define kte HARDCODE_VERTICAL #endif - INTEGER, INTENT(IN) :: bl_mynn_mixlength - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: dz - real(kind_phys), DIMENSION(kts:kte+1), INTENT(in) :: zw - real(kind_phys), INTENT(in) :: rmo,flt,fltv,flq,Psig_bl,xland - real(kind_phys), INTENT(IN) :: dx,zi - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: u1,v1, & + integer, intent(in) :: bl_mynn_mixlength + real(kind_phys), dimension(kts:kte), intent(in) :: dz + real(kind_phys), dimension(kts:kte+1), intent(in) :: zw + real(kind_phys), intent(in) :: rmo,flt,fltv,flq,Psig_bl,xland + real(kind_phys), intent(in) :: dx,zi + real(kind_phys), dimension(kts:kte), intent(in) :: u1,v1, & &qke,vt,vq,cldfra_bl1D,edmf_w1,edmf_a1 - real(kind_phys), DIMENSION(kts:kte), INTENT(out) :: qkw, el - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: dtv + real(kind_phys), dimension(kts:kte), intent(out) :: qkw, el + real(kind_phys), dimension(kts:kte), intent(in) :: dtv real(kind_phys):: elt,vsc - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: theta - real(kind_phys), DIMENSION(kts:kte) :: qtke,elBLmin,elBLavg,thetaw + real(kind_phys), dimension(kts:kte), intent(in) :: theta + real(kind_phys), dimension(kts:kte) :: qtke,elBLmin,elBLavg,thetaw real(kind_phys):: wt,wt2,zi2,h1,h2,hs,elBLmin0,elBLavg0,cldavg ! THE FOLLOWING CONSTANTS ARE IMPORTANT FOR REGULATING THE @@ -1879,22 +1882,22 @@ SUBROUTINE mym_length ( & !THEY ONLY IMPOSE LIMITS ON THE CALCULATION OF THE MIXING LENGTH !SCALES SO THAT THE BOULAC MIXING LENGTH (IN FREE ATMOS) DOES !NOT ENCROACH UPON THE BOUNDARY LAYER MIXING LENGTH (els, elb & elt). - real(kind_phys), PARAMETER :: minzi = 300. !< min mixed-layer height - real(kind_phys), PARAMETER :: maxdz = 750. !< max (half) transition layer depth + real(kind_phys), parameter :: minzi = 300. !< min mixed-layer height + real(kind_phys), parameter :: maxdz = 750. !< max (half) transition layer depth !! =0.3*2500 m PBLH, so the transition !! layer stops growing for PBLHs > 2.5 km. - real(kind_phys), PARAMETER :: mindz = 300. !< 300 !min (half) transition layer depth + real(kind_phys), parameter :: mindz = 300. !< 300 !min (half) transition layer depth !SURFACE LAYER LENGTH SCALE MODS TO REDUCE IMPACT IN UPPER BOUNDARY LAYER - real(kind_phys), PARAMETER :: ZSLH = 100. !< Max height correlated to surface conditions (m) - real(kind_phys), PARAMETER :: CSL = 2. !< CSL = constant of proportionality to L O(1) + real(kind_phys), parameter :: ZSLH = 100. !< Max height correlated to surface conditions (m) + real(kind_phys), parameter :: CSL = 2. !< CSL = constant of proportionality to L O(1) - INTEGER :: i,j,k + integer :: i,j,k real(kind_phys):: afk,abk,zwk,zwk1,dzk,qdz,vflx,bv,tau_cloud, & & wstar,elb,els,elf,el_stab,el_mf,el_stab_mf,elb_mf, & & PBLH_PLUS_ENT,Uonset,Ugrid,wt_u,el_les - real(kind_phys), PARAMETER :: ctau = 1000. !constant for tau_cloud + real(kind_phys), parameter :: ctau = 1000. !constant for tau_cloud ! tv0 = 0.61*tref ! gtr = 9.81/tref @@ -2254,13 +2257,13 @@ SUBROUTINE boulac_length0(k,kts,kte,zw,dz,qtke,theta,lb1,lb2) ! lb2 = the average of the length up and length down !------------------------------------------------------------------- - INTEGER, INTENT(IN) :: k,kts,kte - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: qtke,dz,theta - real(kind_phys), INTENT(OUT) :: lb1,lb2 - real(kind_phys), DIMENSION(kts:kte+1), INTENT(IN) :: zw + integer, intent(in) :: k,kts,kte + real(kind_phys), dimension(kts:kte), intent(in) :: qtke,dz,theta + real(kind_phys), intent(out) :: lb1,lb2 + real(kind_phys), dimension(kts:kte+1), intent(in) :: zw !LOCAL VARS - INTEGER :: izz, found + integer :: izz, found real(kind_phys):: dlu,dld real(kind_phys):: dzt, zup, beta, zup_inf, bbb, tl, zdo, zdo_sup, zzz @@ -2404,15 +2407,15 @@ SUBROUTINE boulac_length(kts,kte,zw,dz,qtke,theta,lb1,lb2) ! lb2 = the average of the length up and length down !------------------------------------------------------------------- - INTEGER, INTENT(IN) :: kts,kte - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: qtke,dz,theta - real(kind_phys), DIMENSION(kts:kte), INTENT(OUT):: lb1,lb2 - real(kind_phys), DIMENSION(kts:kte+1), INTENT(IN) :: zw + integer, intent(in) :: kts,kte + real(kind_phys), dimension(kts:kte), intent(in) :: qtke,dz,theta + real(kind_phys), dimension(kts:kte), intent(out):: lb1,lb2 + real(kind_phys), dimension(kts:kte+1), intent(in) :: zw !LOCAL VARS - INTEGER :: iz, izz, found - real(kind_phys), DIMENSION(kts:kte) :: dlu,dld - real(kind_phys), PARAMETER :: Lmax=2000. !soft limit + integer :: iz, izz, found + real(kind_phys), dimension(kts:kte) :: dlu,dld + real(kind_phys), parameter :: Lmax=2000. !soft limit real(kind_phys):: dzt, zup, beta, zup_inf, bbb, tl, zdo, zdo_sup, zzz !print*,"IN MYNN-BouLac",kts, kte @@ -2618,40 +2621,40 @@ SUBROUTINE mym_turbulence ( & !------------------------------------------------------------------- - INTEGER, INTENT(IN) :: kts,kte + integer, intent(in) :: kts,kte #ifdef HARDCODE_VERTICAL # define kts 1 # define kte HARDCODE_VERTICAL #endif - INTEGER, INTENT(IN) :: bl_mynn_mixlength,tke_budget - real(kind_phys), INTENT(IN) :: closure - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: dz - real(kind_phys), DIMENSION(kts:kte+1), INTENT(in) :: zw - real(kind_phys), INTENT(in) :: rmo,flt,fltv,flq, & + integer, intent(in) :: bl_mynn_mixlength,tke_budget + real(kind_phys), intent(in) :: closure + real(kind_phys), dimension(kts:kte), intent(in) :: dz + real(kind_phys), dimension(kts:kte+1), intent(in) :: zw + real(kind_phys), intent(in) :: rmo,flt,fltv,flq, & &Psig_bl,Psig_shcu,xland,dx,zi - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: u,v,thl,thetav,qw, & + real(kind_phys), dimension(kts:kte), intent(in) :: u,v,thl,thetav,qw, & &ql,vt,vq,qke,tsq,qsq,cov,cldfra_bl1D,edmf_w1,edmf_a1, & &TKEprodTD - real(kind_phys), DIMENSION(kts:kte), INTENT(out) :: dfm,dfh,dfq, & + real(kind_phys), dimension(kts:kte), intent(out) :: dfm,dfh,dfq, & &pdk,pdt,pdq,pdc,tcd,qcd,el - real(kind_phys), DIMENSION(kts:kte), INTENT(inout) :: & + real(kind_phys), dimension(kts:kte), intent(inout) :: & qWT1D,qSHEAR1D,qBUOY1D,qDISS1D real(kind_phys):: q3sq_old,dlsq1,qWTP_old,qWTP_new real(kind_phys):: dudz,dvdz,dTdz,upwp,vpwp,Tpwp - real(kind_phys), DIMENSION(kts:kte) :: qkw,dtl,dqw,dtv,gm,gh,sm,sh + real(kind_phys), dimension(kts:kte) :: qkw,dtl,dqw,dtv,gm,gh,sm,sh - INTEGER :: k + integer :: k ! real(kind_phys):: cc2,cc3,e1c,e2c,e3c,e4c,e5c real(kind_phys):: e6c,dzk,afk,abk,vtt,vqq, & &cw25,clow,cupp,gamt,gamq,smd,gamv,elq,elh real(kind_phys):: cldavg - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: theta + real(kind_phys), dimension(kts:kte), intent(in) :: theta real(kind_phys):: a2fac, duz, ri !JOE-Canuto/Kitamura mod @@ -2664,10 +2667,10 @@ SUBROUTINE mym_turbulence ( & DOUBLE PRECISION e1, e2, e3, e4, enum, eden, wden ! Stochastic - INTEGER, INTENT(IN) :: spp_pbl - real(kind_phys), DIMENSION(KTS:KTE) :: rstoch_col + integer, intent(in) :: spp_pbl + real(kind_phys), dimension(kts:kte) :: rstoch_col real(kind_phys):: Prnum, shb - real(kind_phys), PARAMETER :: Prlimit = 5.0 + real(kind_phys), parameter :: Prlimit = 5.0 ! ! tv0 = 0.61*tref @@ -3042,7 +3045,8 @@ SUBROUTINE mym_turbulence ( & ! q-variance (pdq), and covariance (pdc) pdk(k) = elq*( sm(k)*gm(k) & & +sh(k)*gh(k)+gamv ) + & - & TKEprodTD(k) +!fix? & TKEprodTD(k) + & 0.5*TKEprodTD(k) ! xmchen pdt(k) = elh*( sh(k)*dtl(k)+gamt )*dtl(k) pdq(k) = elh*( sh(k)*dqw(k)+gamq )*dqw(k) pdc(k) = elh*( sh(k)*dtl(k)+gamt ) & @@ -3086,9 +3090,10 @@ SUBROUTINE mym_turbulence ( & !qBUOY1D(k) = elq*(sh(k)*(-dTdz*grav/thl(k)) + gamv) !! ORIGINAL CODE !! Buoyncy term takes the TKEprodTD(k) production now - qBUOY1D(k) = elq*(sh(k)*gh(k)+gamv)+TKEprodTD(k) !staggered +!fix? qBUOY1D(k) = elq*(sh(k)*gh(k)+gamv)+TKEprodTD(k) !staggered + qBUOY1D(k) = elq*(sh(k)*gh(k)+gamv)+0.5*TKEprodTD(k) ! xmchen - !!!Dissipation Term (now it evaluated on mym_predict) + !!!Dissipation Term (now it evaluated in mym_predict) !qDISS1D(k) = (q3sq**(3./2.))/(b1*MAX(el(k),1.)) !! ORIGINAL CODE !! >> EOB @@ -3113,8 +3118,6 @@ SUBROUTINE mym_turbulence ( & qcd(k) = ( qcd(k+1)-qcd(k) )/( dzk ) END DO ! - - if (spp_pbl==1) then DO k = kts,kte dfm(k)= dfm(k) + dfm(k)* rstoch_col(k) * 1.5 * MAX(exp(-MAX(zw(k)-8000.,0.0)/2000.),0.001) @@ -3181,43 +3184,43 @@ SUBROUTINE mym_predict (kts,kte, & & delt, & & dz, & & ust, flt, flq, pmz, phh, & - & el, dfq, rho, & + & el, dfq, rho, & & pdk, pdt, pdq, pdc, & & qke, tsq, qsq, cov, & & s_aw,s_awqke,bl_mynn_edmf_tke, & & qWT1D, qDISS1D,tke_budget) !! TKE budget (Puhales, 2020) !------------------------------------------------------------------- - INTEGER, INTENT(IN) :: kts,kte + integer, intent(in) :: kts,kte #ifdef HARDCODE_VERTICAL # define kts 1 # define kte HARDCODE_VERTICAL #endif - real(kind_phys), INTENT(IN) :: closure - INTEGER, INTENT(IN) :: bl_mynn_edmf_tke,tke_budget - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: dz, dfq, el, rho - real(kind_phys), DIMENSION(kts:kte), INTENT(INOUT) :: pdk, pdt, pdq, pdc - real(kind_phys), INTENT(IN) :: flt, flq, pmz, phh - real(kind_phys), INTENT(IN) :: ust, delt - real(kind_phys), DIMENSION(kts:kte), INTENT(INOUT) :: qke,tsq, qsq, cov + real(kind_phys), intent(in) :: closure + integer, intent(in) :: bl_mynn_edmf_tke,tke_budget + real(kind_phys), dimension(kts:kte), intent(in) :: dz, dfq, el, rho + real(kind_phys), dimension(kts:kte), intent(inout) :: pdk, pdt, pdq, pdc + real(kind_phys), intent(in) :: flt, flq, pmz, phh + real(kind_phys), intent(in) :: ust, delt + real(kind_phys), dimension(kts:kte), intent(inout) :: qke,tsq, qsq, cov ! WA 8/3/15 - real(kind_phys), DIMENSION(kts:kte+1), INTENT(INOUT) :: s_awqke,s_aw + real(kind_phys), dimension(kts:kte+1), intent(inout) :: s_awqke,s_aw !! TKE budget (Puhales, 2020, WRF 4.2.1) << EOB - real(kind_phys), DIMENSION(kts:kte), INTENT(OUT) :: qWT1D, qDISS1D - real(kind_phys), DIMENSION(kts:kte) :: tke_up,dzinv + real(kind_phys), dimension(kts:kte), intent(out) :: qWT1D, qDISS1D + real(kind_phys), dimension(kts:kte) :: tke_up,dzinv !! >> EOB - INTEGER :: k - real(kind_phys), DIMENSION(kts:kte) :: qkw, bp, rp, df3q + integer :: k + real(kind_phys), dimension(kts:kte) :: qkw, bp, rp, df3q real(kind_phys):: vkz,pdk1,phm,pdt1,pdq1,pdc1,b1l,b2l,onoff - real(kind_phys), DIMENSION(kts:kte) :: dtz - real(kind_phys), DIMENSION(kts:kte) :: a,b,c,d,x + real(kind_phys), dimension(kts:kte) :: dtz + real(kind_phys), dimension(kts:kte) :: a,b,c,d,x - real(kind_phys), DIMENSION(kts:kte) :: rhoinv - real(kind_phys), DIMENSION(kts:kte+1) :: rhoz,kqdz,kmdz + real(kind_phys), dimension(kts:kte) :: rhoinv + real(kind_phys), dimension(kts:kte+1) :: rhoz,kqdz,kmdz ! REGULATE THE MOMENTUM MIXING FROM THE MASS-FLUX SCHEME (on or off) IF (bl_mynn_edmf_tke == 0) THEN @@ -3263,7 +3266,7 @@ SUBROUTINE mym_predict (kts,kte, & kmdz(k) = MAX(kmdz(k), 0.5* s_aw(k)) kmdz(k) = MAX(kmdz(k), -0.5*(s_aw(k)-s_aw(k+1))) ENDDO -!JOE-end conservation mods + !end conservation mods pdk1 = 2.0*ust**3*pmz/( vkz ) phm = 2.0/ust *phh/( vkz ) @@ -3271,8 +3274,8 @@ SUBROUTINE mym_predict (kts,kte, & pdq1 = phm*flq**2 pdc1 = phm*flt*flq ! -! ** pdk(i,j,1)+pdk(i,j,2) corresponds to pdk1. ** - pdk(kts) = pdk1 -pdk(kts+1) +! ** pdk(1)+pdk(2) corresponds to pdk1. ** + pdk(kts) = pdk1 - pdk(kts+1) !! pdt(kts) = pdt1 -pdt(kts+1) !! pdq(kts) = pdq1 -pdq(kts+1) @@ -3367,7 +3370,7 @@ SUBROUTINE mym_predict (kts,kte, & ENDDO k=kte qWT1D(k)=dzinv(k)*(-kqdz(k)*(tke_up(k)-tke_up(k-1)) & - & + 0.5*rhoinv(k)*(-s_aw(k)*tke_up(k)-s_aw(k)*tke_up(k-1)+s_awqke(k))*onoff) !unstaggared + & + 0.5*rhoinv(k)*(-s_aw(k)*tke_up(k)-s_aw(k)*tke_up(k-1)+s_awqke(k))*onoff) !unstaggered !! >> EOBvt qDISS1D=bp*tke_up !! TKE dissipation rate !unstaggered END IF @@ -3596,39 +3599,42 @@ SUBROUTINE mym_condensation (kts,kte, & !------------------------------------------------------------------- - INTEGER, INTENT(IN) :: kts,kte, bl_mynn_cloudpdf + integer, intent(in) :: kts,kte, bl_mynn_cloudpdf #ifdef HARDCODE_VERTICAL # define kts 1 # define kte HARDCODE_VERTICAL #endif - real(kind_phys), INTENT(IN) :: HFX1,rmo,xland - real(kind_phys), INTENT(IN) :: dx,pblh1 - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: dz - real(kind_phys), DIMENSION(kts:kte+1), INTENT(IN) :: zw - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: p,exner,thl,qw, & + real(kind_phys), intent(in) :: HFX1,rmo,xland + real(kind_phys), intent(in) :: dx,pblh1 + real(kind_phys), dimension(kts:kte), intent(in) :: dz + real(kind_phys), dimension(kts:kte+1), intent(in) :: zw + real(kind_phys), dimension(kts:kte), intent(in) :: p,exner,thl,qw, & &qv,qc,qi,qs,tsq,qsq,cov,th - real(kind_phys), DIMENSION(kts:kte), INTENT(INOUT) :: vt,vq,sgm + real(kind_phys), dimension(kts:kte), intent(inout) :: vt,vq,sgm - real(kind_phys), DIMENSION(kts:kte) :: alp,a,bet,b,ql,q1,RH - real(kind_phys), DIMENSION(kts:kte), INTENT(OUT) :: qc_bl1D,qi_bl1D, & + real(kind_phys), dimension(kts:kte) :: alp,a,bet,b,ql,q1,RH + real(kind_phys), dimension(kts:kte), intent(out) :: qc_bl1D,qi_bl1D, & &cldfra_bl1D DOUBLE PRECISION :: t3sq, r3sq, c3sq real(kind_phys):: qsl,esat,qsat,dqsl,cld0,q1k,qlk,eq1,qll, & &q2p,pt,rac,qt,t,xl,rsl,cpm,Fng,qww,alpha,beta,bb, & - &ls,wt,cld_factor,fac_damp,liq_frac,ql_ice,ql_water, & - &qmq,qsat_tk,q1_rh,rh_hack - real(kind_phys), PARAMETER :: rhcrit=0.83 !for hom pdf min sigma - INTEGER :: i,j,k + &ls,wt,qpct,cld_factor,fac_damp,liq_frac,ql_ice,ql_water, & + &qmq,qsat_tk,q1_rh,rh_hack,dzm1,zsl,maxqc + real(kind_phys), parameter :: qpct_sfc=0.025 + real(kind_phys), parameter :: qpct_pbl=0.030 + real(kind_phys), parameter :: qpct_trp=0.040 + real(kind_phys), parameter :: rhcrit =0.83 !for hom pdf min sigma + integer :: i,j,k real(kind_phys):: erf !VARIABLES FOR ALTERNATIVE SIGMA real:: dth,dtl,dqw,dzk,els - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: Sh,el + real(kind_phys), dimension(kts:kte), intent(in) :: Sh,el !variables for SGS BL clouds real(kind_phys) :: zagl,damp,PBLH2 @@ -3636,11 +3642,11 @@ SUBROUTINE mym_condensation (kts,kte, & !JAYMES: variables for tropopause-height estimation real(kind_phys) :: theta1, theta2, ht1, ht2 - INTEGER :: k_tropo + integer :: k_tropo ! Stochastic - INTEGER, INTENT(IN) :: spp_pbl - real(kind_phys), DIMENSION(KTS:KTE) :: rstoch_col + integer, intent(in) :: spp_pbl + real(kind_phys), dimension(kts:kte) :: rstoch_col real(kind_phys) :: qw_pert ! First, obtain an estimate for the tropopause height (k), using the method employed in the @@ -3794,29 +3800,31 @@ SUBROUTINE mym_condensation (kts,kte, & !Diagnostic statistical scheme of Chaboureau and Bechtold (2002), JAS !but with use of higher-order moments to estimate sigma - PBLH2=MAX(10.,PBLH1) + pblh2=MAX(10.,pblh1) zagl = 0. + dzm1 = 0. DO k = kts,kte-1 - zagl = zagl + dz(k) - t = th(k)*exner(k) + zagl = zagl + 0.5*(dz(k) + dzm1) + dzm1 = dz(k) - xl = xl_blend(t) ! obtain latent heat - qsat_tk = qsat_blend(t, p(k)) ! saturation water vapor mixing ratio at tk and p - rh(k)=MAX(MIN(1.00,qw(k)/MAX(1.E-10,qsat_tk)),0.001) + t = th(k)*exner(k) + xl = xl_blend(t) ! obtain latent heat + qsat_tk= qsat_blend(t, p(k)) ! saturation water vapor mixing ratio at tk and p + rh(k) = MAX(MIN(1.00,qw(k)/MAX(1.E-10,qsat_tk)),0.001) !dqw/dT: Clausius-Clapeyron - dqsl = qsat_tk*ep_2*xlv/( r_d*t**2 ) + dqsl = qsat_tk*ep_2*xlv/( r_d*t**2 ) alp(k) = 1.0/( 1.0+dqsl*xlvcp ) bet(k) = dqsl*exner(k) - rsl = xl*qsat_tk / (r_v*t**2) ! slope of C-C curve at t (=abs temperature) + rsl = xl*qsat_tk / (r_v*t**2) ! slope of C-C curve at t (=abs temperature) ! CB02, Eqn. 4 - cpm = cp + qw(k)*cpv ! CB02, sec. 2, para. 1 - a(k) = 1./(1. + xl*rsl/cpm) ! CB02 variable "a" - b(k) = a(k)*rsl ! CB02 variable "b" + cpm = cp + qw(k)*cpv ! CB02, sec. 2, para. 1 + a(k) = 1./(1. + xl*rsl/cpm) ! CB02 variable "a" + b(k) = a(k)*rsl ! CB02 variable "b" !SPP - qw_pert = qw(k) + qw(k)*0.5*rstoch_col(k)*real(spp_pbl) + qw_pert= qw(k) + qw(k)*0.5*rstoch_col(k)*real(spp_pbl) !This form of qmq (the numerator of Q1) no longer uses the a(k) factor qmq = qw_pert - qsat_tk ! saturation deficit/excess; @@ -3826,14 +3834,24 @@ SUBROUTINE mym_condensation (kts,kte, & r3sq = max( qsq(k), 0.0 ) !Calculate sigma using higher-order moments: sgm(k) = SQRT( r3sq ) - !Set limits on sigma relative to saturation water vapor + !Set constraints on sigma relative to saturation water vapor sgm(k) = min( sgm(k), qsat_tk*0.666 ) - sgm(k) = max( sgm(k), qsat_tk*0.035 ) + !sgm(k) = max( sgm(k), qsat_tk*0.035 ) + + !introduce vertical grid spacing dependence on min sgm + wt = max(500. - max(dz(k)-100.,0.0), 0.0)/500. !=1 for dz < 100 m, =0 for dz > 600 m + sgm(k) = sgm(k) + sgm(k)*0.2*(1.0-wt) !inflate sgm for coarse dz + + !allow min sgm to vary with dz and z. + qpct = qpct_pbl*wt + qpct_trp*(1.0-wt) + qpct = min(qpct, max(qpct_sfc, qpct_pbl*zagl/500.) ) + sgm(k) = max( sgm(k), qsat_tk*qpct ) + q1(k) = qmq / sgm(k) ! Q1, the normalized saturation !Add condition for falling/settling into low-RH layers, so at least !some cloud fraction is applied for all qc and qi. - rh_hack = rh(k) + rh_hack= rh(k) !ensure adequate RH & q1 when qi is at least 1e-9 if (qi(k)>1.e-9) then rh_hack =min(1.0, rhcrit + 0.06*(9.0 + log10(qi(k)))) @@ -3864,20 +3882,17 @@ SUBROUTINE mym_condensation (kts,kte, & ! Specify hydrometeors ! JAYMES- this option added 8 May 2015 ! The cloud water formulations are taken from CB02, Eq. 8. - IF (q1k < 0.) THEN !unsaturated -#ifdef SINGLE_PREC - ql_water = sgm(k)*EXP(1.2*q1k-1.) -#else - ql_water = sgm(k)*EXP(1.2*q1k-1.) -#endif - ql_ice = sgm(k)*EXP(1.2*q1k-1.) - ELSE IF (q1k > 2.) THEN !supersaturated - ql_water = sgm(k)*q1k - ql_ice = sgm(k)*q1k - ELSE !slightly saturated (0 > q1 < 2) - ql_water = sgm(k)*(EXP(-1.) + 0.66*q1k + 0.086*q1k**2) - ql_ice = sgm(k)*(EXP(-1.) + 0.66*q1k + 0.086*q1k**2) - ENDIF + maxqc = max(qw(k) - qsat_tk, 0.0) + if (q1k < 0.) then !unsaturated + ql_water = sgm(k)*exp(1.2*q1k-1.) + ql_ice = sgm(k)*exp(1.2*q1k-1.) + elseif (q1k > 2.) then !supersaturated + ql_water = min(sgm(k)*q1k, maxqc) + ql_ice = sgm(k)*q1k + else !slightly saturated (0 > q1 < 2) + ql_water = min(sgm(k)*(exp(-1.) + 0.66*q1k + 0.086*q1k**2), maxqc) + ql_ice = sgm(k)*(exp(-1.) + 0.66*q1k + 0.086*q1k**2) + endif !In saturated grid cells, use average of SGS and resolved values !if ( qc(k) > 1.e-6 ) ql_water = 0.5 * ( ql_water + qc(k) ) @@ -3922,17 +3937,22 @@ SUBROUTINE mym_condensation (kts,kte, & ! Fng = 1.-1.5*q1k !ENDIF ! Use the form of "Fng" from Bechtold and Siebesma (1998, JAS) - IF (q1k .GE. 1.0) THEN + if (q1k .ge. 1.0) then Fng = 1.0 - ELSEIF (q1k .GE. -1.7 .AND. q1k .LT. 1.0) THEN - Fng = EXP(-0.4*(q1k-1.0)) - ELSEIF (q1k .GE. -2.5 .AND. q1k .LT. -1.7) THEN - Fng = 3.0 + EXP(-3.8*(q1k+1.7)) - ELSE - Fng = MIN(23.9 + EXP(-1.6*(q1k+2.5)), 60.) - ENDIF + elseif (q1k .ge. -1.7 .and. q1k .lt. 1.0) then + Fng = exp(-0.4*(q1k-1.0)) + elseif (q1k .ge. -2.5 .and. q1k .lt. -1.7) then + Fng = 3.0 + exp(-3.8*(q1k+1.7)) + else + Fng = min(23.9 + exp(-1.6*(q1k+2.5)), 60.) + endif + + cfmax = min(cldfra_bl1D(k), 0.6) + !Further limit the cf going into vt & vq near the surface + zsl = min(max(25., 0.1*pblh2), 100.) + wt = min(zagl/zsl, 1.0) !=0 at z=0 m, =1 above ekman layer + cfmax = cfmax*wt - cfmax= min(cldfra_bl1D(k), 0.6) bb = b(k)*t/th(k) ! bb is "b" in BCMT95. Their "b" differs from ! "b" in CB02 (i.e., b(k) above) by a factor ! of T/theta. Strictly, b(k) above is formulated in @@ -4023,17 +4043,17 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & &bl_mynn_mixscalars ) !------------------------------------------------------------------- - INTEGER, INTENT(in) :: kts,kte,i + integer, intent(in) :: kts,kte,i #ifdef HARDCODE_VERTICAL # define kts 1 # define kte HARDCODE_VERTICAL #endif - INTEGER, INTENT(in) :: bl_mynn_cloudmix,bl_mynn_mixqt, & + integer, intent(in) :: bl_mynn_cloudmix,bl_mynn_mixqt, & bl_mynn_edmf,bl_mynn_edmf_mom, & bl_mynn_mixscalars - LOGICAL, INTENT(IN) :: FLAG_QI,FLAG_QNI,FLAG_QC,FLAG_QS, & + logical, intent(IN) :: FLAG_QI,FLAG_QNI,FLAG_QC,FLAG_QS, & &FLAG_QNC,FLAG_QNWFA,FLAG_QNIFA,FLAG_QNBCA ! thl - liquid water potential temperature @@ -4043,47 +4063,47 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & ! flq - surface flux of qw ! mass-flux plumes - real(kind_phys), DIMENSION(kts:kte+1), INTENT(in) :: s_aw, & + real(kind_phys), dimension(kts:kte+1), intent(in) :: s_aw, & &s_awthl,s_awqt,s_awqnc,s_awqni,s_awqv,s_awqc,s_awu,s_awv, & &s_awqnwfa,s_awqnifa,s_awqnbca, & &sd_aw,sd_awthl,sd_awqt,sd_awqv,sd_awqc,sd_awu,sd_awv ! tendencies from mass-flux environmental subsidence and detrainment - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: sub_thl,sub_sqv, & + real(kind_phys), dimension(kts:kte), intent(in) :: sub_thl,sub_sqv, & &sub_u,sub_v,det_thl,det_sqv,det_sqc,det_u,det_v - real(kind_phys), DIMENSION(kts:kte), INTENT(in) :: u,v,th,tk,qv,qc,qi,& + real(kind_phys), dimension(kts:kte), intent(in) :: u,v,th,tk,qv,qc,qi,& &qs,qni,qnc,rho,p,exner,dfq,dz,tsq,qsq,cov,tcd,qcd, & &cldfra_bl1d,diss_heat - real(kind_phys), DIMENSION(kts:kte), INTENT(inout) :: thl,sqw,sqv,sqc,& + real(kind_phys), dimension(kts:kte), intent(inout) :: thl,sqw,sqv,sqc,& &sqi,sqs,qnwfa,qnifa,qnbca,ozone,dfm,dfh - real(kind_phys), DIMENSION(kts:kte), INTENT(inout) :: du,dv,dth,dqv, & + real(kind_phys), dimension(kts:kte), intent(inout) :: du,dv,dth,dqv, & &dqc,dqi,dqs,dqni,dqnc,dqnwfa,dqnifa,dqnbca,dozone - real(kind_phys), INTENT(IN) :: flt,flq,flqv,flqc,uoce,voce - real(kind_phys), INTENT(IN) :: ust,delt,psfc,wspd + real(kind_phys), intent(in) :: flt,flq,flqv,flqc,uoce,voce + real(kind_phys), intent(in) :: ust,delt,psfc,wspd !debugging real(kind_phys):: wsp,wsp2,tk2,th2 - LOGICAL :: problem + logical :: problem integer :: kproblem -! real(kind_phys), INTENT(IN) :: gradu_top,gradv_top,gradth_top,gradqv_top +! real(kind_phys), intent(in) :: gradu_top,gradv_top,gradth_top,gradqv_top !local vars - real(kind_phys), DIMENSION(kts:kte) :: dtz,dfhc,dfmc,delp - real(kind_phys), DIMENSION(kts:kte) :: sqv2,sqc2,sqi2,sqs2,sqw2, & + real(kind_phys), dimension(kts:kte) :: dtz,dfhc,dfmc,delp + real(kind_phys), dimension(kts:kte) :: sqv2,sqc2,sqi2,sqs2,sqw2, & &qni2,qnc2,qnwfa2,qnifa2,qnbca2,ozone2 - real(kind_phys), DIMENSION(kts:kte) :: zfac,plumeKh,rhoinv - real(kind_phys), DIMENSION(kts:kte) :: a,b,c,d,x - real(kind_phys), DIMENSION(kts:kte+1) :: rhoz, & !rho on model interface + real(kind_phys), dimension(kts:kte) :: zfac,plumeKh,rhoinv + real(kind_phys), dimension(kts:kte) :: a,b,c,d,x + real(kind_phys), dimension(kts:kte+1) :: rhoz, & !rho on model interface &khdz,kmdz real(kind_phys):: rhs,gfluxm,gfluxp,dztop,maxdfh,mindfh,maxcf,maxKh,zw real(kind_phys):: t,esat,qsl,onoff,kh,km,dzk,rhosfc real(kind_phys):: ustdrag,ustdiff,qvflux real(kind_phys):: th_new,portion_qc,portion_qi,condensate,qsat - INTEGER :: k,kk + integer :: k,kk !Activate nonlocal mixing from the mass-flux scheme for !number concentrations and aerosols (0.0 = no; 1.0 = yes) - real(kind_phys), PARAMETER :: nonloc = 1.0 + real(kind_phys), parameter :: nonloc = 1.0 dztop=.5*(dz(kte)+dz(kte-1)) @@ -4813,8 +4833,8 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & d(kte)=qnbca(kte) ! CALL tridiag(kte,a,b,c,d) -! CALL tridiag2(kte,a,b,c,d,x) - CALL tridiag3(kte,a,b,c,d,x) + CALL tridiag2(kte,a,b,c,d,x) +! CALL tridiag3(kte,a,b,c,d,x) DO k=kts,kte !qnbca2(k)=d(k-kts+1) @@ -5207,36 +5227,36 @@ SUBROUTINE mynn_mix_chem(kts,kte,i, & enh_mix, smoke_dbg ) !------------------------------------------------------------------- - INTEGER, INTENT(in) :: kts,kte,i - real(kind_phys), DIMENSION(kts:kte), INTENT(IN) :: dfh,dz,tcd,qcd - real(kind_phys), DIMENSION(kts:kte), INTENT(INOUT) :: rho - real(kind_phys), INTENT(IN) :: flt - real(kind_phys), INTENT(IN) :: delt,pblh - INTEGER, INTENT(IN) :: nchem, kdvel, ndvel - real(kind_phys), DIMENSION( kts:kte+1), INTENT(IN) :: s_aw - real(kind_phys), DIMENSION( kts:kte, nchem ), INTENT(INOUT) :: chem1 - real(kind_phys), DIMENSION( kts:kte+1,nchem), INTENT(IN) :: s_awchem - real(kind_phys), DIMENSION( ndvel ), INTENT(IN) :: vd1 - real(kind_phys), INTENT(IN) :: emis_ant_no,frp - LOGICAL, INTENT(IN) :: rrfs_sd,enh_mix,smoke_dbg + integer, intent(in) :: kts,kte,i + real(kind_phys), dimension(kts:kte), intent(in) :: dfh,dz,tcd,qcd + real(kind_phys), dimension(kts:kte), intent(inout) :: rho + real(kind_phys), intent(in) :: flt + real(kind_phys), intent(in) :: delt,pblh + integer, intent(in) :: nchem, kdvel, ndvel + real(kind_phys), dimension( kts:kte+1), intent(in) :: s_aw + real(kind_phys), dimension( kts:kte, nchem ), intent(inout) :: chem1 + real(kind_phys), dimension( kts:kte+1,nchem), intent(in) :: s_awchem + real(kind_phys), dimension( ndvel ), intent(in) :: vd1 + real(kind_phys), intent(in) :: emis_ant_no,frp + logical, intent(in) :: rrfs_sd,enh_mix,smoke_dbg !local vars - real(kind_phys), DIMENSION(kts:kte) :: dtz - real(kind_phys), DIMENSION(kts:kte) :: a,b,c,d,x + real(kind_phys), dimension(kts:kte) :: dtz + real(kind_phys), dimension(kts:kte) :: a,b,c,d,x real(kind_phys):: rhs,dztop real(kind_phys):: t,dzk real(kind_phys):: hght real(kind_phys):: khdz_old, khdz_back - INTEGER :: k,kk,kmaxfire ! JLS 12/21/21 - INTEGER :: ic ! Chemical array loop index + integer :: k,kk,kmaxfire ! JLS 12/21/21 + integer :: ic ! Chemical array loop index - INTEGER, SAVE :: icall + integer, SAVE :: icall - real(kind_phys), DIMENSION(kts:kte) :: rhoinv - real(kind_phys), DIMENSION(kts:kte+1) :: rhoz,khdz - real(kind_phys), PARAMETER :: NO_threshold = 10.0 ! For anthropogenic sources - real(kind_phys), PARAMETER :: frp_threshold = 10.0 ! RAR 02/11/22: I increased the frp threshold to enhance mixing over big fires - real(kind_phys), PARAMETER :: pblh_threshold = 100.0 + real(kind_phys), dimension(kts:kte) :: rhoinv + real(kind_phys), dimension(kts:kte+1) :: rhoz,khdz + real(kind_phys), parameter :: NO_threshold = 10.0 ! For anthropogenic sources + real(kind_phys), parameter :: frp_threshold = 10.0 ! RAR 02/11/22: I increased the frp threshold to enhance mixing over big fires + real(kind_phys), parameter :: pblh_threshold = 100.0 dztop=.5*(dz(kte)+dz(kte-1)) @@ -5335,14 +5355,14 @@ SUBROUTINE retrieve_exchange_coeffs(kts,kte,& !------------------------------------------------------------------- - INTEGER , INTENT(in) :: kts,kte + integer , intent(in) :: kts,kte - real(kind_phys), DIMENSION(KtS:KtE), INTENT(in) :: dz,dfm,dfh + real(kind_phys), dimension(KtS:KtE), intent(in) :: dz,dfm,dfh - real(kind_phys), DIMENSION(KtS:KtE), INTENT(out) :: K_m, K_h + real(kind_phys), dimension(KtS:KtE), intent(out) :: K_m, K_h - INTEGER :: k + integer :: k real(kind_phys):: dzk K_m(kts)=0. @@ -5368,13 +5388,13 @@ SUBROUTINE tridiag(n,a,b,c,d) !------------------------------------------------------------------- - INTEGER, INTENT(in):: n - real(kind_phys), DIMENSION(n), INTENT(in) :: a,b - real(kind_phys), DIMENSION(n), INTENT(inout) :: c,d + integer, intent(in):: n + real(kind_phys), dimension(n), intent(in) :: a,b + real(kind_phys), dimension(n), intent(inout) :: c,d - INTEGER :: i + integer :: i real(kind_phys):: p - real(kind_phys), DIMENSION(n) :: q + real(kind_phys), dimension(n) :: q c(n)=0. q(1)=-c(1)/b(1) @@ -5508,23 +5528,23 @@ SUBROUTINE GET_PBLH(KTS,KTE,zi,thetav1D,qke1D,zw1D,dz1D,landsea,kzi) !value could be found to work best in all conditions. !--------------------------------------------------------------- - INTEGER,INTENT(IN) :: KTS,KTE + integer,intent(in) :: KTS,KTE #ifdef HARDCODE_VERTICAL # define kts 1 # define kte HARDCODE_VERTICAL #endif - real(kind_phys), INTENT(OUT) :: zi - real(kind_phys), INTENT(IN) :: landsea - real(kind_phys), DIMENSION(KTS:KTE), INTENT(IN) :: thetav1D, qke1D, dz1D - real(kind_phys), DIMENSION(KTS:KTE+1), INTENT(IN) :: zw1D + real(kind_phys), intent(out) :: zi + real(kind_phys), intent(in) :: landsea + real(kind_phys), dimension(kts:kte), intent(in) :: thetav1D, qke1D, dz1D + real(kind_phys), dimension(kts:kte+1), intent(in) :: zw1D !LOCAL VARS real(kind_phys):: PBLH_TKE,qtke,qtkem1,wt,maxqke,TKEeps,minthv real(kind_phys):: delt_thv !delta theta-v; dependent on land/sea point - real(kind_phys), PARAMETER :: sbl_lim = 200. !upper limit of stable BL height (m). - real(kind_phys), PARAMETER :: sbl_damp = 400. !transition length for blending (m). - INTEGER :: I,J,K,kthv,ktke,kzi + real(kind_phys), parameter :: sbl_lim = 200. !upper limit of stable BL height (m). + real(kind_phys), parameter :: sbl_damp = 400. !transition length for blending (m). + integer :: I,J,K,kthv,ktke,kzi !Initialize KPBL (kzi) kzi = 2 @@ -5689,12 +5709,12 @@ SUBROUTINE DMP_mf( & & F_QNWFA,F_QNIFA,F_QNBCA, & & Psig_shcu, & ! output info - & nup2,ktop,maxmf,ztop, & + & maxwidth,ktop,maxmf,ztop, & ! inputs for stochastic perturbations & spp_pbl,rstoch_col ) ! inputs: - INTEGER, INTENT(IN) :: KTS,KTE,KPBL,momentum_opt,tke_opt,scalar_opt + integer, intent(in) :: KTS,KTE,KPBL,momentum_opt,tke_opt,scalar_opt #ifdef HARDCODE_VERTICAL # define kts 1 @@ -5702,133 +5722,137 @@ SUBROUTINE DMP_mf( & #endif ! Stochastic - INTEGER, INTENT(IN) :: spp_pbl - real(kind_phys), DIMENSION(KTS:KTE) :: rstoch_col + integer, intent(in) :: spp_pbl + real(kind_phys), dimension(kts:kte) :: rstoch_col - real(kind_phys),DIMENSION(KTS:KTE), INTENT(IN) :: & + real(kind_phys),dimension(kts:kte), intent(in) :: & &U,V,W,TH,THL,TK,QT,QV,QC, & &exner,dz,THV,P,rho,qke,qnc,qni,qnwfa,qnifa,qnbca - real(kind_phys),DIMENSION(KTS:KTE+1), INTENT(IN) :: zw !height at full-sigma - real(kind_phys), INTENT(IN) :: flt,fltv,flq,flqv,Psig_shcu, & + real(kind_phys),dimension(kts:kte+1), intent(in) :: zw !height at full-sigma + real(kind_phys), intent(in) :: flt,fltv,flq,flqv,Psig_shcu, & &landsea,ts,dx,dt,ust,pblh - LOGICAL, OPTIONAL :: F_QC,F_QI,F_QNC,F_QNI,F_QNWFA,F_QNIFA,F_QNBCA + logical, optional :: F_QC,F_QI,F_QNC,F_QNI,F_QNWFA,F_QNIFA,F_QNBCA ! outputs - updraft properties - real(kind_phys),DIMENSION(KTS:KTE), INTENT(OUT) :: edmf_a,edmf_w, & + real(kind_phys),dimension(kts:kte), intent(out) :: edmf_a,edmf_w, & & edmf_qt,edmf_thl,edmf_ent,edmf_qc !add one local edmf variable: - real(kind_phys),DIMENSION(KTS:KTE) :: edmf_th + real(kind_phys),dimension(kts:kte) :: edmf_th ! output - INTEGER, INTENT(OUT) :: nup2,ktop - real(kind_phys), INTENT(OUT) :: maxmf - real(kind_phys), INTENT(OUT) :: ztop + integer, intent(out) :: ktop + real(kind_phys), intent(out) :: maxmf,ztop,maxwidth ! outputs - variables needed for solver - real(kind_phys),DIMENSION(KTS:KTE+1) :: s_aw, & !sum ai*rho*wis_awphi + real(kind_phys),dimension(kts:kte+1) :: s_aw, & !sum ai*rho*wis_awphi &s_awthl,s_awqt,s_awqv,s_awqc,s_awqnc,s_awqni, & &s_awqnwfa,s_awqnifa,s_awqnbca,s_awu,s_awv, & &s_awqke,s_aw2 - real(kind_phys),DIMENSION(KTS:KTE), INTENT(INOUT) :: & + real(kind_phys),dimension(kts:kte), intent(inout) :: & &qc_bl1d,cldfra_bl1d,qc_bl1d_old,cldfra_bl1d_old - INTEGER, PARAMETER :: nup=10, debug_mf=0 + integer, parameter :: nup=8, debug_mf=0 + real(kind_phys) :: nup2 !------------- local variables ------------------- ! updraft properties defined on interfaces (k=1 is the top of the ! first model layer - real(kind_phys),DIMENSION(KTS:KTE+1,1:NUP) :: & + real(kind_phys),dimension(kts:kte+1,1:NUP) :: & &UPW,UPTHL,UPQT,UPQC,UPQV, & &UPA,UPU,UPV,UPTHV,UPQKE,UPQNC, & &UPQNI,UPQNWFA,UPQNIFA,UPQNBCA ! entrainment variables - real(kind_phys),DIMENSION(KTS:KTE,1:NUP) :: ENT,ENTf - INTEGER,DIMENSION(KTS:KTE,1:NUP) :: ENTi + real(kind_phys),dimension(kts:kte,1:NUP) :: ENT,ENTf + integer,dimension(kts:kte,1:NUP) :: ENTi ! internal variables - INTEGER :: K,I,k50 + integer :: K,I,k50 real(kind_phys):: fltv2,wstar,qstar,thstar,sigmaW,sigmaQT, & &sigmaTH,z0,pwmin,pwmax,wmin,wmax,wlv,Psig_w,maxw,maxqc,wpbl real(kind_phys):: B,QTn,THLn,THVn,QCn,Un,Vn,QKEn,QNCn,QNIn, & - QNWFAn,QNIFAn,QNBCAn, & - Wn2,Wn,EntEXP,EntEXM,EntW,BCOEFF,THVkm1,THVk,Pk,rho_int + & QNWFAn,QNIFAn,QNBCAn, & + & Wn2,Wn,EntEXP,EntEXM,EntW,BCOEFF,THVkm1,THVk,Pk,rho_int ! w parameters - real(kind_phys), PARAMETER :: & + real(kind_phys), parameter :: & &Wa=2./3., & &Wb=0.002, & &Wc=1.5 ! Lateral entrainment parameters ( L0=100 and ENT0=0.1) were taken from ! Suselj et al (2013, jas). Note that Suselj et al (2014,waf) use L0=200 and ENT0=0.2. - real(kind_phys),PARAMETER :: & - & L0=100., & - & ENT0=0.1 - - ! Implement ideas from Neggers (2016, JAMES): - real(kind_phys), PARAMETER :: Atot = 0.10 ! Maximum total fractional area of all updrafts - real(kind_phys), PARAMETER :: lmax = 1000.! diameter of largest plume - real(kind_phys), PARAMETER :: dl = 100. ! diff size of each plume - the differential multiplied by the integrand - real(kind_phys), PARAMETER :: dcut = 1.2 ! max diameter of plume to parameterize relative to dx (km) - real(kind_phys):: d != -2.3 to -1.7 ;=-1.9 in Neggers paper; power law exponent for number density (N=Cl^d). + real(kind_phys),parameter :: & + & L0=100., & + & ENT0=0.1 + + ! Parameters/variables for regulating plumes: + real(kind_phys), parameter :: Atot = 0.10 ! Maximum total fractional area of all updrafts + real(kind_phys), parameter :: lmax = 1000.! diameter of largest plume (absolute maximum, can be smaller) + real(kind_phys), parameter :: lmin = 300. ! diameter of smallest plume (absolute minimum, can be larger) + real(kind_phys), parameter :: dlmin = 0. ! delta increase in the diameter of smallest plume (large fltv) + real(kind_phys) :: minwidth ! actual width of smallest plume + real(kind_phys) :: dl ! variable increment of plume size + real(kind_phys), parameter :: dcut = 1.2 ! max diameter of plume to parameterize relative to dx (km) + real(kind_phys):: d != -2.3 to -1.7 ;=-1.9 in Neggers paper; power law exponent for number density (N=Cl^d). ! Note that changing d to -2.0 makes each size plume equally contribute to the total coverage of all plumes. ! Note that changing d to -1.7 doubles the area coverage of the largest plumes relative to the smallest plumes. - real(kind_phys):: cn,c,l,n,an2,hux,maxwidth,wspd_pbl,cloud_base,width_flx + real(kind_phys):: cn,c,l,n,an2,hux,wspd_pbl,cloud_base,width_flx ! chem/smoke - INTEGER, INTENT(IN) :: nchem - real(kind_phys),DIMENSION(:, :) :: chem1 - real(kind_phys),DIMENSION(kts:kte+1, nchem) :: s_awchem - real(kind_phys),DIMENSION(nchem) :: chemn - real(kind_phys),DIMENSION(KTS:KTE+1,1:NUP, nchem) :: UPCHEM - INTEGER :: ic - real(kind_phys),DIMENSION(KTS:KTE+1, nchem) :: edmf_chem - LOGICAL, INTENT(IN) :: mix_chem + integer, intent(in) :: nchem + real(kind_phys),dimension(:, :) :: chem1 + real(kind_phys),dimension(kts:kte+1, nchem) :: s_awchem + real(kind_phys),dimension(nchem) :: chemn + real(kind_phys),dimension(kts:kte+1,1:NUP, nchem) :: UPCHEM + integer :: ic + real(kind_phys),dimension(kts:kte+1, nchem) :: edmf_chem + logical, intent(in) :: mix_chem !JOE: add declaration of ERF real(kind_phys):: ERF - LOGICAL :: superadiabatic + logical :: superadiabatic ! VARIABLES FOR CHABOUREAU-BECHTOLD CLOUD FRACTION - real(kind_phys),DIMENSION(KTS:KTE), INTENT(INOUT) :: vt, vq, sgm + real(kind_phys),dimension(kts:kte), intent(inout) :: vt, vq, sgm real(kind_phys):: sigq,xl,rsl,cpm,a,qmq,mf_cf,Aup,Q1,diffqt,qsat_tk,& Fng,qww,alpha,beta,bb,f,pt,t,q2p,b9,satvp,rhgrid, & Ac_mf,Ac_strat,qc_mf - real(kind_phys), PARAMETER :: cf_thresh = 0.5 ! only overwrite stratus CF less than this value + real(kind_phys), parameter :: cf_thresh = 0.5 ! only overwrite stratus CF less than this value ! Variables for plume interpolation/saturation check - real(kind_phys),DIMENSION(KTS:KTE) :: exneri,dzi + real(kind_phys),dimension(kts:kte) :: exneri,dzi,rhoz real(kind_phys):: THp, QTp, QCp, QCs, esat, qsl - real(kind_phys):: csigma,acfac,ac_wsp,ac_cld + real(kind_phys):: csigma,acfac,ac_wsp !plume overshoot - INTEGER :: overshoot + integer :: overshoot real(kind_phys):: bvf, Frz, dzp !Flux limiter: not let mass-flux of heat between k=1&2 exceed (fluxportion)*(surface heat flux). !This limiter makes adjustments to the entire column. real(kind_phys):: adjustment, flx1 - real(kind_phys), PARAMETER :: fluxportion=0.75 ! set liberally, so has minimal impact. 0.5 starts to have a noticeable impact + real(kind_phys), parameter :: fluxportion=0.75 ! set liberally, so has minimal impact. Note that + ! 0.5 starts to have a noticeable impact ! over land (decrease maxMF by 10-20%), but no impact over water. !Subsidence - real(kind_phys),DIMENSION(KTS:KTE) :: sub_thl,sub_sqv,sub_u,sub_v, & !tendencies due to subsidence + real(kind_phys),dimension(kts:kte) :: sub_thl,sub_sqv,sub_u,sub_v, & !tendencies due to subsidence det_thl,det_sqv,det_sqc,det_u,det_v, & !tendencied due to detrainment envm_a,envm_w,envm_thl,envm_sqv,envm_sqc, & envm_u,envm_v !environmental variables defined at middle of layer - real(kind_phys),DIMENSION(KTS:KTE+1) :: envi_a,envi_w !environmental variables defined at model interface + real(kind_phys),dimension(kts:kte+1) :: envi_a,envi_w !environmental variables defined at model interface real(kind_phys):: temp,sublim,qc_ent,qv_ent,qt_ent,thl_ent,detrate, & detrateUV,oow,exc_fac,aratio,detturb,qc_grid,qc_sgs, & qc_plume,exc_heat,exc_moist,tk_int - real(kind_phys), PARAMETER :: Cdet = 1./45. - real(kind_phys), PARAMETER :: dzpmax = 300. !limit dz used in detrainment - can be excessing in thick layers + real(kind_phys), parameter :: Cdet = 1./45. + real(kind_phys), parameter :: dzpmax = 300. !limit dz used in detrainment - can be excessing in thick layers !parameter "Csub" determines the propotion of upward vertical velocity that contributes to !environmenatal subsidence. Some portion is expected to be compensated by downdrafts instead of !gentle environmental subsidence. 1.0 assumes all upward vertical velocity in the mass-flux scheme !is compensated by "gentle" environmental subsidence. - real(kind_phys), PARAMETER :: Csub=0.25 + real(kind_phys), parameter :: Csub=0.25 !Factor for the pressure gradient effects on momentum transport - real(kind_phys), PARAMETER :: pgfac = 0.00 ! Zhang and Wu showed 0.4 is more appropriate for lower troposphere + real(kind_phys), parameter :: pgfac = 0.00 ! Zhang and Wu showed 0.4 is more appropriate for lower troposphere real(kind_phys):: Uk,Ukm1,Vk,Vkm1,dxsa ! check the inputs @@ -5859,9 +5883,9 @@ SUBROUTINE DMP_mf( & UPQNWFA=0. UPQNIFA=0. UPQNBCA=0. - IF ( mix_chem ) THEN - UPCHEM(KTS:KTE+1,1:NUP,1:nchem)=0.0 - ENDIF + if ( mix_chem ) then + UPCHEM(kts:kte+1,1:NUP,1:nchem)=0.0 + endif ENT=0.001 ! Initialize mean updraft properties @@ -5871,9 +5895,9 @@ SUBROUTINE DMP_mf( & edmf_thl=0. edmf_ent=0. edmf_qc =0. - IF ( mix_chem ) THEN + if ( mix_chem ) then edmf_chem(kts:kte+1,1:nchem) = 0.0 - ENDIF + endif ! Initialize the variables needed for implicit solver s_aw=0. @@ -5889,153 +5913,161 @@ SUBROUTINE DMP_mf( & s_awqnwfa=0. s_awqnifa=0. s_awqnbca=0. - IF ( mix_chem ) THEN + if ( mix_chem ) then s_awchem(kts:kte+1,1:nchem) = 0.0 - ENDIF + endif ! Initialize explicit tendencies for subsidence & detrainment sub_thl = 0. sub_sqv = 0. - sub_u = 0. - sub_v = 0. + sub_u = 0. + sub_v = 0. det_thl = 0. det_sqv = 0. det_sqc = 0. - det_u = 0. - det_v = 0. + det_u = 0. + det_v = 0. + nup2 = nup !start with nup, but set to zero if activation criteria fails ! Taper off MF scheme when significant resolved-scale motions ! are present This function needs to be asymetric... - k = 1 - maxw = 0.0 + maxw = 0.0 cloud_base = 9000.0 -! DO WHILE (ZW(k) < pblh + 500.) - DO k=1,kte-1 - IF(zw(k) > pblh + 500.) exit + do k=1,kte-1 + if (zw(k) > pblh + 500.) exit wpbl = w(k) - IF(w(k) < 0.)wpbl = 2.*w(k) - maxw = MAX(maxw,ABS(wpbl)) + if (w(k) < 0.)wpbl = 2.*w(k) + maxw = max(maxw,abs(wpbl)) !Find highest k-level below 50m AGL - IF(ZW(k)<=50.)k50=k + if (ZW(k)<=50.)k50=k !Search for cloud base - qc_sgs = MAX(qc(k), qc_bl1d(k)*cldfra_bl1d(k)) - IF(qc_sgs> 1E-5 .AND. cloud_base == 9000.0)THEN + qc_sgs = max(qc(k), qc_bl1d(k)) + if (qc_sgs> 1E-5 .and. (cldfra_bl1d(k) .ge. 0.5) .and. cloud_base == 9000.0) then cloud_base = 0.5*(ZW(k)+ZW(k+1)) - ENDIF + endif + enddo - !k = k + 1 - ENDDO - !print*," maxw before manipulation=", maxw - maxw = MAX(0.,maxw - 1.0) ! do nothing for small w (< 1 m/s), but - Psig_w = MAX(0.0, 1.0 - maxw) ! linearly taper off for w > 1.0 m/s - Psig_w = MIN(Psig_w, Psig_shcu) - !print*," maxw=", maxw," Psig_w=",Psig_w," Psig_shcu=",Psig_shcu + !do nothing for small w (< 1 m/s), but linearly taper off for w > 1.0 m/s + maxw = max(0.,maxw - 1.0) + Psig_w = max(0.0, 1.0 - maxw) + Psig_w = min(Psig_w, Psig_shcu) !Completely shut off MF scheme for strong resolved-scale vertical velocities. fltv2 = fltv - IF(Psig_w == 0.0 .and. fltv > 0.0) fltv2 = -1.*fltv + if(Psig_w == 0.0 .and. fltv > 0.0) fltv2 = -1.*fltv ! If surface buoyancy is positive we do integration, otherwise no. ! Also, ensure that it is at least slightly superadiabatic up through 50 m superadiabatic = .false. - IF((landsea-1.5).GE.0)THEN + if ((landsea-1.5).ge.0) then hux = -0.001 ! WATER ! dT/dz must be < - 0.1 K per 100 m. - ELSE + else hux = -0.005 ! LAND ! dT/dz must be < - 0.5 K per 100 m. - ENDIF - DO k=1,MAX(1,k50-1) !use "-1" because k50 used interface heights (zw). - IF (k == 1) then - IF ((th(k)-ts)/(0.5*dz(k)) < hux) THEN + endif + do k=1,max(1,k50-1) !use "-1" because k50 used interface heights (zw). + if (k == 1) then + if ((th(k)-ts)/(0.5*dz(k)) < hux) then superadiabatic = .true. - ELSE + else superadiabatic = .false. exit - ENDIF - ELSE - IF ((th(k)-th(k-1))/(0.5*(dz(k)+dz(k-1))) < hux) THEN + endif + else + if ((th(k)-th(k-1))/(0.5*(dz(k)+dz(k-1))) < hux) then superadiabatic = .true. - ELSE + else superadiabatic = .false. exit - ENDIF - ENDIF - ENDDO + endif + endif + enddo ! Determine the numer of updrafts/plumes in the grid column: ! Some of these criteria may be a little redundant but useful for bullet-proofing. - ! (1) largest plume = 1.0 * dx. - ! (2) Apply a scale-break, assuming no plumes with diameter larger than PBLH can exist. + ! (1) largest plume = 1.2 * dx. + ! (2) Apply a scale-break, assuming no plumes with diameter larger than 1.1*PBLH can exist. ! (3) max plume size beneath clouds deck approx = 0.5 * cloud_base. ! (4) add wspd-dependent limit, when plume model breaks down. (hurricanes) ! (5) limit to reduce max plume sizes in weakly forced conditions. This is only ! meant to "soften" the activation of the mass-flux scheme. ! Criteria (1) - NUP2 = max(1,min(NUP,INT(dx*dcut/dl))) + maxwidth = min(dx*dcut, lmax) !Criteria (2) - maxwidth = 1.1*PBLH + maxwidth = min(maxwidth, 1.1*PBLH) ! Criteria (3) - maxwidth = MIN(maxwidth,0.5*cloud_base) + if ((landsea-1.5) .lt. 0) then !land + maxwidth = MIN(maxwidth, 0.5*cloud_base) + else !water + maxwidth = MIN(maxwidth, 0.9*cloud_base) + endif ! Criteria (4) wspd_pbl=SQRT(MAX(u(kts)**2 + v(kts)**2, 0.01)) !Note: area fraction (acfac) is modified below ! Criteria (5) - only a function of flt (not fltv) if ((landsea-1.5).LT.0) then !land !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.050)/0.03) + .5),1000.), 0.) - width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.040)/0.03) + .5),1000.), 0.) + !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.040)/0.03) + .5),1000.), 0.) + width_flx = MAX(MIN(1000.*(0.6*tanh((fltv - 0.040)/0.04) + .5),1000.), 0.) else !water - width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.003)/0.01) + .5),1000.), 0.) + !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.003)/0.01) + .5),1000.), 0.) + width_flx = MAX(MIN(1000.*(0.6*tanh((fltv - 0.007)/0.02) + .5),1000.), 0.) + endif + maxwidth = MIN(maxwidth, width_flx) + minwidth = lmin + !allow min plume size to increase in large flux conditions (eddy diffusivity should be + !large enough to handle the representation of small plumes). + if (maxwidth .ge. (lmax - 1.0) .and. fltv .gt. 0.2)minwidth = lmin + dlmin*min((fltv-0.2)/0.3, 1.) + + if (maxwidth .le. minwidth) then ! deactivate MF component + nup2 = 0 + maxwidth = 0.0 endif - maxwidth = MIN(maxwidth,width_flx) - ! Convert maxwidth to number of plumes - NUP2 = MIN(MAX(INT((maxwidth - MOD(maxwidth,100.))/100), 0), NUP2) - !Initialize values for 2d output fields: - ktop = 0 - ztop = 0.0 - maxmf= 0.0 + ! Initialize values for 2d output fields: + ktop = 0 + ztop = 0.0 + maxmf= 0.0 - IF ( fltv2 > 0.002 .AND. NUP2 .GE. 1 .AND. superadiabatic) then - !PRINT*," Conditions met to run mass-flux scheme",fltv2,pblh +!Begin plume processing if passes criteria +if ( fltv2 > 0.002 .AND. (maxwidth > minwidth) .AND. superadiabatic) then ! Find coef C for number size density N cn = 0. - d=-1.9 !set d to value suggested by Neggers 2015 (JAMES). - !d=-1.9 + .2*tanh((fltv2 - 0.05)/0.15) - do I=1,NUP !NUP2 - IF(I > NUP2) exit - l = dl*I ! diameter of plume + d =-1.9 !set d to value suggested by Neggers 2015 (JAMES). + dl = (maxwidth - minwidth)/real(nup-1) + do i=1,NUP + ! diameter of plume + l = minwidth + dl*real(i-1) cn = cn + l**d * (l*l)/(dx*dx) * dl ! sum fractional area of each plume enddo C = Atot/cn !Normalize C according to the defined total fraction (Atot) ! Make updraft area (UPA) a function of the buoyancy flux if ((landsea-1.5).LT.0) then !land - !acfac = .5*tanh((fltv2 - 0.03)/0.09) + .5 - !acfac = .5*tanh((fltv2 - 0.02)/0.09) + .5 acfac = .5*tanh((fltv2 - 0.02)/0.05) + .5 else !water acfac = .5*tanh((fltv2 - 0.01)/0.03) + .5 endif !add a windspeed-dependent adjustment to acfac that tapers off - !the mass-flux scheme linearly above sfc wind speeds of 20 m/s: - ac_wsp = 1.0 - min(max(wspd_pbl - 20.0, 0.0), 10.0)/10.0 - !reduce area fraction beneath cloud bases < 1200 m AGL - ac_cld = min(cloud_base/1200., 1.0) - acfac = acfac * min(ac_wsp, ac_cld) + !the mass-flux scheme linearly above sfc wind speeds of 15 m/s. + !Note: this effect may be better represented by an increase in + !entrainment rate for high wind consitions (more ambient turbulence). + ac_wsp = 1.0 - min(max(wspd_pbl - 15.0, 0.0), 10.0)/10.0 + acfac = acfac * ac_wsp ! Find the portion of the total fraction (Atot) of each plume size: An2 = 0. - do I=1,NUP !NUP2 - IF(I > NUP2) exit - l = dl*I ! diameter of plume + do i=1,NUP + ! diameter of plume + l = minwidth + dl*real(i-1) N = C*l**d ! number density of plume n - UPA(1,I) = N*l*l/(dx*dx) * dl ! fractional area of plume n + UPA(1,i) = N*l*l/(dx*dx) * dl ! fractional area of plume n - UPA(1,I) = UPA(1,I)*acfac - An2 = An2 + UPA(1,I) ! total fractional area of all plumes + UPA(1,i) = UPA(1,i)*acfac + An2 = An2 + UPA(1,i) ! total fractional area of all plumes !print*," plume size=",l,"; area=",UPA(1,I),"; total=",An2 end do @@ -6048,11 +6080,11 @@ SUBROUTINE DMP_mf( & qstar=max(flq,1.0E-5)/wstar thstar=flt/wstar - IF((landsea-1.5).GE.0)THEN + if ((landsea-1.5) .ge. 0) then csigma = 1.34 ! WATER - ELSE + else csigma = 1.34 ! LAND - ENDIF + endif if (env_subs) then exc_fac = 0.0 @@ -6065,6 +6097,8 @@ SUBROUTINE DMP_mf( & exc_fac = 0.58 endif endif + !decrease excess for large wind speeds + exc_fac = exc_fac * ac_wsp !Note: sigmaW is typically about 0.5*wstar sigmaW =csigma*wstar*(z0/pblh)**(onethird)*(1 - 0.8*z0/pblh) @@ -6077,14 +6111,11 @@ SUBROUTINE DMP_mf( & wmax=MIN(sigmaW*pwmax,0.5) !SPECIFY SURFACE UPDRAFT PROPERTIES AT MODEL INTERFACE BETWEEN K = 1 & 2 - DO I=1,NUP !NUP2 - IF(I > NUP2) exit + do i=1,NUP wlv=wmin+(wmax-wmin)/NUP2*(i-1) !SURFACE UPDRAFT VERTICAL VELOCITY UPW(1,I)=wmin + real(i)/real(NUP)*(wmax-wmin) - !IF (UPW(1,I) > 0.5*ZW(2)/dt) UPW(1,I) = 0.5*ZW(2)/dt - UPU(1,I)=(U(KTS)*DZ(KTS+1)+U(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) UPV(1,I)=(V(KTS)*DZ(KTS+1)+V(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) UPQC(1,I)=0.0 @@ -6093,21 +6124,11 @@ SUBROUTINE DMP_mf( & exc_heat = exc_fac*UPW(1,I)*sigmaTH/sigmaW UPTHV(1,I)=(THV(KTS)*DZ(KTS+1)+THV(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) & & + exc_heat -!was UPTHL(1,I)= UPTHV(1,I)/(1.+svp1*UPQT(1,I)) !assume no saturated parcel at surface UPTHL(1,I)=(THL(KTS)*DZ(KTS+1)+THL(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) & & + exc_heat !calculate exc_moist by use of surface fluxes exc_moist=exc_fac*UPW(1,I)*sigmaQT/sigmaW - !calculate exc_moist by conserving rh: -! tk_int =(tk(kts)*dz(kts+1)+tk(kts+1)*dz(kts))/(dz(kts+1)+dz(kts)) -! pk =(p(kts)*dz(kts+1)+p(kts+1)*dz(kts))/(dz(kts+1)+dz(kts)) -! qtk =(qt(kts)*dz(kts+1)+qt(kts+1)*dz(kts))/(dz(kts)+dz(kts+1)) -! qsat_tk = qsat_blend(tk_int, pk) ! saturation water vapor mixing ratio at tk and p -! rhgrid =MAX(MIN(1.0,qtk/MAX(1.E-8,qsat_tk)),0.001) -! tk_int = tk_int + exc_heat -! qsat_tk = qsat_blend(tk_int, pk) -! exc_moist= max(rhgrid*qsat_tk - qtk, 0.0) UPQT(1,I)=(QT(KTS)*DZ(KTS+1)+QT(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1))& & +exc_moist @@ -6117,36 +6138,36 @@ SUBROUTINE DMP_mf( & UPQNWFA(1,I)=(QNWFA(KTS)*DZ(KTS+1)+QNWFA(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) UPQNIFA(1,I)=(QNIFA(KTS)*DZ(KTS+1)+QNIFA(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) UPQNBCA(1,I)=(QNBCA(KTS)*DZ(KTS+1)+QNBCA(KTS+1)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) - ENDDO + enddo - IF ( mix_chem ) THEN - DO I=1,NUP !NUP2 - IF(I > NUP2) exit + if ( mix_chem ) then + do i=1,NUP do ic = 1,nchem - UPCHEM(1,I,ic)=(chem1(KTS,ic)*DZ(KTS+1)+chem1(KTS+1,ic)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) + UPCHEM(1,i,ic)=(chem1(KTS,ic)*DZ(KTS+1)+chem1(KTS+1,ic)*DZ(KTS))/(DZ(KTS)+DZ(KTS+1)) enddo - ENDDO - ENDIF + enddo + endif !Initialize environmental variables which can be modified by detrainment - DO k=kts,kte - envm_thl(k)=THL(k) - envm_sqv(k)=QV(k) - envm_sqc(k)=QC(k) - envm_u(k)=U(k) - envm_v(k)=V(k) - ENDDO + envm_thl(kts:kte)=THL(kts:kte) + envm_sqv(kts:kte)=QV(kts:kte) + envm_sqc(kts:kte)=QC(kts:kte) + envm_u(kts:kte)=U(kts:kte) + envm_v(kts:kte)=V(kts:kte) + do k=kts,kte-1 + rhoz(k) = (rho(k)*dz(k+1)+rho(k+1)*dz(k))/(dz(k+1)+dz(k)) + enddo + rhoz(kte) = rho(kte) !dxsa is scale-adaptive factor governing the pressure-gradient term of the momentum transport dxsa = 1. - MIN(MAX((12000.0-dx)/(12000.0-3000.0), 0.), 1.) ! do integration updraft - DO I=1,NUP !NUP2 - IF(I > NUP2) exit + do i=1,NUP QCn = 0. overshoot = 0 - l = dl*I ! diameter of plume - DO k=KTS+1,KTE-1 + l = minwidth + dl*real(i-1) ! diameter of plume + do k=kts+1,kte-1 !Entrainment from Tian and Kuang (2016) !ENT(k,i) = 0.35/(MIN(MAX(UPW(K-1,I),0.75),1.9)*l) wmin = 0.3 + l*0.0005 !* MAX(pblh-ZW(k+1), 0.0)/pblh @@ -6161,7 +6182,7 @@ SUBROUTINE DMP_mf( & ENT(k,i) = max(ENT(k,i),0.0003) !ENT(k,i) = max(ENT(k,i),0.05/ZW(k)) !not needed for Tian and Kuang - !JOE - increase entrainment for plumes extending very high. + !increase entrainment for plumes extending very high. IF(ZW(k) >= MIN(pblh+1500., 4000.))THEN ENT(k,i)=ENT(k,i) + (ZW(k)-MIN(pblh+1500.,4000.))*5.0E-6 ENDIF @@ -6339,6 +6360,7 @@ SUBROUTINE DMP_mf( & exit !exit k-loop END IF ENDDO + IF (debug_mf == 1) THEN IF (MAXVAL(UPW(:,I)) > 10.0 .OR. MINVAL(UPA(:,I)) < 0.0 .OR. & MAXVAL(UPA(:,I)) > Atot .OR. NUP2 > 10) THEN @@ -6358,30 +6380,26 @@ SUBROUTINE DMP_mf( & ENDIF ENDIF ENDDO - ELSE +ELSE !At least one of the conditions was not met for activating the MF scheme. NUP2=0. - END IF !end criteria for mass-flux scheme +END IF !end criteria check for mass-flux scheme - ktop=MIN(ktop,KTE-1) ! Just to be safe... - IF (ktop == 0) THEN - ztop = 0.0 - ELSE - ztop=zw(ktop) - ENDIF - - IF(nup2 > 0) THEN +ktop=MIN(ktop,KTE-1) +IF (ktop == 0) THEN + ztop = 0.0 +ELSE + ztop=zw(ktop) +ENDIF - !Calculate the fluxes for each variable - !All s_aw* variable are == 0 at k=1 - DO i=1,NUP !NUP2 - IF(I > NUP2) exit +IF (nup2 > 0) THEN + !Calculate the fluxes for each variable + !All s_aw* variable are == 0 at k=1 + DO i=1,NUP DO k=KTS,KTE-1 - IF(k > ktop) exit - rho_int = (rho(k)*DZ(k+1)+rho(k+1)*DZ(k))/(DZ(k+1)+DZ(k)) - s_aw(k+1) = s_aw(k+1) + rho_int*UPA(K,i)*UPW(K,i)*Psig_w - s_awthl(k+1)= s_awthl(k+1) + rho_int*UPA(K,i)*UPW(K,i)*UPTHL(K,i)*Psig_w - s_awqt(k+1) = s_awqt(k+1) + rho_int*UPA(K,i)*UPW(K,i)*UPQT(K,i)*Psig_w + s_aw(k+1) = s_aw(k+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*Psig_w + s_awthl(k+1)= s_awthl(k+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPTHL(K,i)*Psig_w + s_awqt(k+1) = s_awqt(k+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPQT(K,i)*Psig_w !to conform to grid mean properties, move qc to qv in grid mean !saturated layers, so total water fluxes are preserved but !negative qc fluxes in unsaturated layers is reduced. @@ -6390,72 +6408,76 @@ SUBROUTINE DMP_mf( & ! else ! qc_plume = 0.0 ! endif - s_awqc(k+1) = s_awqc(k+1) + rho_int*UPA(K,i)*UPW(K,i)*qc_plume*Psig_w - IF (momentum_opt > 0) THEN - s_awu(k+1) = s_awu(k+1) + rho_int*UPA(K,i)*UPW(K,i)*UPU(K,i)*Psig_w - s_awv(k+1) = s_awv(k+1) + rho_int*UPA(K,i)*UPW(K,i)*UPV(K,i)*Psig_w - ENDIF - IF (tke_opt > 0) THEN - s_awqke(k+1)= s_awqke(k+1) + rho_int*UPA(K,i)*UPW(K,i)*UPQKE(K,i)*Psig_w - ENDIF + s_awqc(k+1) = s_awqc(k+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*qc_plume*Psig_w s_awqv(k+1) = s_awqt(k+1) - s_awqc(k+1) ENDDO - ENDDO - - IF ( mix_chem ) THEN - DO k=KTS,KTE - IF(k > KTOP) exit - rho_int = (rho(k)*DZ(k+1)+rho(k+1)*DZ(k))/(DZ(k+1)+DZ(k)) - DO i=1,NUP !NUP2 - IF(I > NUP2) exit - do ic = 1,nchem - s_awchem(k+1,ic) = s_awchem(k+1,ic) + rho_int*UPA(K,i)*UPW(K,i)*UPCHEM(K,i,ic)*Psig_w - enddo - ENDDO - ENDDO - ENDIF - - IF (scalar_opt > 0) THEN - DO k=KTS,KTE - IF(k > KTOP) exit - rho_int = (rho(k)*DZ(k+1)+rho(k+1)*DZ(k))/(DZ(k+1)+DZ(k)) - DO I=1,NUP !NUP2 - IF (I > NUP2) exit - s_awqnc(k+1)= s_awqnc(K+1) + rho_int*UPA(K,i)*UPW(K,i)*UPQNC(K,i)*Psig_w - s_awqni(k+1)= s_awqni(K+1) + rho_int*UPA(K,i)*UPW(K,i)*UPQNI(K,i)*Psig_w - s_awqnwfa(k+1)= s_awqnwfa(K+1) + rho_int*UPA(K,i)*UPW(K,i)*UPQNWFA(K,i)*Psig_w - s_awqnifa(k+1)= s_awqnifa(K+1) + rho_int*UPA(K,i)*UPW(K,i)*UPQNIFA(K,i)*Psig_w - s_awqnbca(k+1)= s_awqnbca(K+1) + rho_int*UPA(K,i)*UPW(K,i)*UPQNBCA(K,i)*Psig_w - ENDDO - ENDDO - ENDIF + ENDDO + !momentum + if (momentum_opt > 0) then + do i=1,nup + do k=kts,kte-1 + s_awu(k+1) = s_awu(k+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPU(K,i)*Psig_w + s_awv(k+1) = s_awv(k+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPV(K,i)*Psig_w + enddo + enddo + endif + !tke + if (tke_opt > 0) then + do i=1,nup + do k=kts,kte-1 + s_awqke(k+1)= s_awqke(k+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPQKE(K,i)*Psig_w + enddo + enddo + endif + !chem + if ( mix_chem ) then + do k=kts,kte + do i=1,nup + do ic = 1,nchem + s_awchem(k+1,ic) = s_awchem(k+1,ic) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPCHEM(K,i,ic)*Psig_w + enddo + enddo + enddo + endif + + if (scalar_opt > 0) then + do k=kts,kte + do I=1,nup + s_awqnc(k+1) = s_awqnc(K+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPQNC(K,i)*Psig_w + s_awqni(k+1) = s_awqni(K+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPQNI(K,i)*Psig_w + s_awqnwfa(k+1)= s_awqnwfa(K+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPQNWFA(K,i)*Psig_w + s_awqnifa(k+1)= s_awqnifa(K+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPQNIFA(K,i)*Psig_w + s_awqnbca(k+1)= s_awqnbca(K+1) + rhoz(k)*UPA(K,i)*UPW(K,i)*UPQNBCA(K,i)*Psig_w + enddo + enddo + endif - !Flux limiter: Check ratio of heat flux at top of first model layer - !and at the surface. Make sure estimated flux out of the top of the - !layer is < fluxportion*surface_heat_flux - IF (s_aw(kts+1) /= 0.) THEN + !Flux limiter: Check ratio of heat flux at top of first model layer + !and at the surface. Make sure estimated flux out of the top of the + !layer is < fluxportion*surface_heat_flux + IF (s_aw(kts+1) /= 0.) THEN dzi(kts) = 0.5*(DZ(kts)+DZ(kts+1)) !dz centered at model interface flx1 = MAX(s_aw(kts+1)*(TH(kts)-TH(kts+1))/dzi(kts),1.0e-5) - ELSE + ELSE flx1 = 0.0 !print*,"ERROR: s_aw(kts+1) == 0, NUP=",NUP," NUP2=",NUP2,& ! " superadiabatic=",superadiabatic," KTOP=",KTOP - ENDIF - adjustment=1.0 - !Print*,"Flux limiter in MYNN-EDMF, adjustment=",fluxportion*flt/dz(kts)/flx1 - !Print*,"flt/dz=",flt/dz(kts)," flx1=",flx1," s_aw(kts+1)=",s_aw(kts+1) - IF (flx1 > fluxportion*flt/dz(kts) .AND. flx1>0.0) THEN + ENDIF + adjustment=1.0 + !Print*,"Flux limiter in MYNN-EDMF, adjustment=",fluxportion*flt/dz(kts)/flx1 + !Print*,"flt/dz=",flt/dz(kts)," flx1=",flx1," s_aw(kts+1)=",s_aw(kts+1) + IF (flx1 > fluxportion*flt/dz(kts) .AND. flx1>0.0) THEN adjustment= fluxportion*flt/dz(kts)/flx1 - s_aw = s_aw*adjustment - s_awthl= s_awthl*adjustment - s_awqt = s_awqt*adjustment - s_awqc = s_awqc*adjustment - s_awqv = s_awqv*adjustment - s_awqnc= s_awqnc*adjustment - s_awqni= s_awqni*adjustment - s_awqnwfa= s_awqnwfa*adjustment - s_awqnifa= s_awqnifa*adjustment - s_awqnbca= s_awqnbca*adjustment + s_aw = s_aw*adjustment + s_awthl = s_awthl*adjustment + s_awqt = s_awqt*adjustment + s_awqc = s_awqc*adjustment + s_awqv = s_awqv*adjustment + s_awqnc = s_awqnc*adjustment + s_awqni = s_awqni*adjustment + s_awqnwfa = s_awqnwfa*adjustment + s_awqnifa = s_awqnifa*adjustment + s_awqnbca = s_awqnbca*adjustment IF (momentum_opt > 0) THEN s_awu = s_awu*adjustment s_awv = s_awv*adjustment @@ -6467,62 +6489,57 @@ SUBROUTINE DMP_mf( & s_awchem = s_awchem*adjustment ENDIF UPA = UPA*adjustment - ENDIF - !Print*,"adjustment=",adjustment," fluxportion=",fluxportion," flt=",flt - - !Calculate mean updraft properties for output: - !all edmf_* variables at k=1 correspond to the interface at top of first model layer - DO k=KTS,KTE-1 - IF(k > KTOP) exit - rho_int = (rho(k)*DZ(k+1)+rho(k+1)*DZ(k))/(DZ(k+1)+DZ(k)) - DO I=1,NUP !NUP2 - IF(I > NUP2) exit - edmf_a(K) =edmf_a(K) +UPA(K,i) - edmf_w(K) =edmf_w(K) +rho_int*UPA(K,i)*UPW(K,i) - edmf_qt(K) =edmf_qt(K) +rho_int*UPA(K,i)*UPQT(K,i) - edmf_thl(K)=edmf_thl(K)+rho_int*UPA(K,i)*UPTHL(K,i) - edmf_ent(K)=edmf_ent(K)+rho_int*UPA(K,i)*ENT(K,i) - edmf_qc(K) =edmf_qc(K) +rho_int*UPA(K,i)*UPQC(K,i) - ENDDO - + ENDIF + !Print*,"adjustment=",adjustment," fluxportion=",fluxportion," flt=",flt + + !Calculate mean updraft properties for output: + !all edmf_* variables at k=1 correspond to the interface at top of first model layer + do k=kts,kte-1 + do I=1,nup + edmf_a(K) =edmf_a(K) +UPA(K,i) + edmf_w(K) =edmf_w(K) +rhoz(k)*UPA(K,i)*UPW(K,i) + edmf_qt(K) =edmf_qt(K) +rhoz(k)*UPA(K,i)*UPQT(K,i) + edmf_thl(K)=edmf_thl(K)+rhoz(k)*UPA(K,i)*UPTHL(K,i) + edmf_ent(K)=edmf_ent(K)+rhoz(k)*UPA(K,i)*ENT(K,i) + edmf_qc(K) =edmf_qc(K) +rhoz(k)*UPA(K,i)*UPQC(K,i) + enddo + enddo + do k=kts,kte-1 !Note that only edmf_a is multiplied by Psig_w. This takes care of the !scale-awareness of the subsidence below: - IF (edmf_a(k)>0.) THEN - edmf_w(k)=edmf_w(k)/edmf_a(k) - edmf_qt(k)=edmf_qt(k)/edmf_a(k) - edmf_thl(k)=edmf_thl(k)/edmf_a(k) - edmf_ent(k)=edmf_ent(k)/edmf_a(k) - edmf_qc(k)=edmf_qc(k)/edmf_a(k) - edmf_a(k)=edmf_a(k)*Psig_w - - !FIND MAXIMUM MASS-FLUX IN THE COLUMN: - IF(edmf_a(k)*edmf_w(k) > maxmf) maxmf = edmf_a(k)*edmf_w(k) - ENDIF - ENDDO ! end k - - !smoke/chem - IF ( mix_chem ) THEN - DO k=kts,kte-1 - IF(k > KTOP) exit - rho_int = (rho(k)*dz(k+1)+rho(k+1)*dz(k))/(dz(k+1)+dz(k)) - DO I=1,NUP !NUP2 - IF(I > NUP2) exit + if (edmf_a(k)>0.) then + edmf_w(k)=edmf_w(k)/edmf_a(k) + edmf_qt(k)=edmf_qt(k)/edmf_a(k) + edmf_thl(k)=edmf_thl(k)/edmf_a(k) + edmf_ent(k)=edmf_ent(k)/edmf_a(k) + edmf_qc(k)=edmf_qc(k)/edmf_a(k) + edmf_a(k)=edmf_a(k)*Psig_w + !FIND MAXIMUM MASS-FLUX IN THE COLUMN: + if(edmf_a(k)*edmf_w(k) > maxmf) maxmf = edmf_a(k)*edmf_w(k) + endif + enddo ! end k + + !smoke/chem + if ( mix_chem ) then + do k=kts,kte-1 + do I=1,nup do ic = 1,nchem - edmf_chem(k,ic) = edmf_chem(k,ic) + rho_int*UPA(K,I)*UPCHEM(k,i,ic) + edmf_chem(k,ic) = edmf_chem(k,ic) + rhoz(k)*UPA(K,I)*UPCHEM(k,i,ic) enddo - ENDDO - - IF (edmf_a(k)>0.) THEN + enddo + enddo + do k=kts,kte-1 + if (edmf_a(k)>0.) then do ic = 1,nchem edmf_chem(k,ic) = edmf_chem(k,ic)/edmf_a(k) enddo - ENDIF - ENDDO ! end k - ENDIF + endif + enddo ! end k + endif - !Calculate the effects environmental subsidence. - !All envi_*variables are valid at the interfaces, like the edmf_* variables - IF (env_subs) THEN + !Calculate the effects environmental subsidence. + !All envi_*variables are valid at the interfaces, like the edmf_* variables + IF (env_subs) THEN DO k=kts+1,kte-1 !First, smooth the profiles of w & a, since sharp vertical gradients !in plume variables are not likely extended to env variables @@ -6557,18 +6574,16 @@ SUBROUTINE DMP_mf( & !calculate tendencies from subsidence and detrainment valid at the middle of !each model layer. The lowest model layer uses an assumes w=0 at the surface. dzi(kts) = 0.5*(dz(kts)+dz(kts+1)) - rho_int = (rho(kts)*dz(kts+1)+rho(kts+1)*dz(kts))/(dz(kts+1)+dz(kts)) sub_thl(kts)= 0.5*envi_w(kts)*envi_a(kts)* & - (rho(kts+1)*thl(kts+1)-rho(kts)*thl(kts))/dzi(kts)/rho_int + (rho(kts+1)*thl(kts+1)-rho(kts)*thl(kts))/dzi(kts)/rhoz(k) sub_sqv(kts)= 0.5*envi_w(kts)*envi_a(kts)* & - (rho(kts+1)*qv(kts+1)-rho(kts)*qv(kts))/dzi(kts)/rho_int + (rho(kts+1)*qv(kts+1)-rho(kts)*qv(kts))/dzi(kts)/rhoz(k) DO k=kts+1,kte-1 dzi(k) = 0.5*(dz(k)+dz(k+1)) - rho_int = (rho(k)*dz(k+1)+rho(k+1)*dz(k))/(dz(k+1)+dz(k)) sub_thl(k)= 0.5*(envi_w(k)+envi_w(k-1))*0.5*(envi_a(k)+envi_a(k-1)) * & - (rho(k+1)*thl(k+1)-rho(k)*thl(k))/dzi(k)/rho_int + (rho(k+1)*thl(k+1)-rho(k)*thl(k))/dzi(k)/rhoz(k) sub_sqv(k)= 0.5*(envi_w(k)+envi_w(k-1))*0.5*(envi_a(k)+envi_a(k-1)) * & - (rho(k+1)*qv(k+1)-rho(k)*qv(k))/dzi(k)/rho_int + (rho(k+1)*qv(k+1)-rho(k)*qv(k))/dzi(k)/rhoz(k) ENDDO DO k=KTS,KTE-1 @@ -6578,17 +6593,15 @@ SUBROUTINE DMP_mf( & ENDDO IF (momentum_opt > 0) THEN - rho_int = (rho(kts)*dz(kts+1)+rho(kts+1)*dz(kts))/(dz(kts+1)+dz(kts)) sub_u(kts)=0.5*envi_w(kts)*envi_a(kts)* & - (rho(kts+1)*u(kts+1)-rho(kts)*u(kts))/dzi(kts)/rho_int + (rho(kts+1)*u(kts+1)-rho(kts)*u(kts))/dzi(kts)/rhoz(k) sub_v(kts)=0.5*envi_w(kts)*envi_a(kts)* & - (rho(kts+1)*v(kts+1)-rho(kts)*v(kts))/dzi(kts)/rho_int + (rho(kts+1)*v(kts+1)-rho(kts)*v(kts))/dzi(kts)/rhoz(k) DO k=kts+1,kte-1 - rho_int = (rho(k)*dz(k+1)+rho(k+1)*dz(k))/(dz(k+1)+dz(k)) sub_u(k)=0.5*(envi_w(k)+envi_w(k-1))*0.5*(envi_a(k)+envi_a(k-1)) * & - (rho(k+1)*u(k+1)-rho(k)*u(k))/dzi(k)/rho_int + (rho(k+1)*u(k+1)-rho(k)*u(k))/dzi(k)/rhoz(k) sub_v(k)=0.5*(envi_w(k)+envi_w(k-1))*0.5*(envi_a(k)+envi_a(k-1)) * & - (rho(k+1)*v(k+1)-rho(k)*v(k))/dzi(k)/rho_int + (rho(k+1)*v(k+1)-rho(k)*v(k))/dzi(k)/rhoz(k) ENDDO DO k=KTS,KTE-1 @@ -6596,23 +6609,23 @@ SUBROUTINE DMP_mf( & det_v(k) = Cdet*(envm_v(k)-v(k))*envi_a(k)*Psig_w ENDDO ENDIF - ENDIF !end subsidence/env detranment + ENDIF !end subsidence/env detranment - !First, compute exner, plume theta, and dz centered at interface - !Here, k=1 is the top of the first model layer. These values do not - !need to be defined at k=kte (unused level). - DO K=KTS,KTE-1 - exneri(k) = (exner(k)*DZ(k+1)+exner(k+1)*DZ(k))/(DZ(k+1)+DZ(k)) + !First, compute exner, plume theta, and dz centered at interface + !Here, k=1 is the top of the first model layer. These values do not + !need to be defined at k=kte (unused level). + DO K=KTS,KTE-1 + exneri(k) = (exner(k)*dz(k+1)+exner(k+1)*dz(k))/(dz(k+1)+dz(k)) edmf_th(k)= edmf_thl(k) + xlvcp/exneri(k)*edmf_qc(K) - dzi(k) = 0.5*(DZ(k)+DZ(k+1)) - ENDDO + dzi(k) = 0.5*(dz(k)+dz(k+1)) + ENDDO !JOE: ADD CLDFRA_bl1d, qc_bl1d. Note that they have already been defined in ! mym_condensation. Here, a shallow-cu component is added, but no cumulus ! clouds can be added at k=1 (start loop at k=2). - do k=kts+1,kte-2 - IF(k > KTOP) exit - IF(0.5*(edmf_qc(k)+edmf_qc(k-1))>0.0 .and. (cldfra_bl1d(k) < cf_thresh))THEN + do k=kts+1,kte-2 + if (k > KTOP) exit + if(0.5*(edmf_qc(k)+edmf_qc(k-1))>0.0 .and. (cldfra_bl1d(k) < cf_thresh))THEN !interpolate plume quantities to mass levels Aup = (edmf_a(k)*dzi(k-1)+edmf_a(k-1)*dzi(k))/(dzi(k-1)+dzi(k)) THp = (edmf_th(k)*dzi(k-1)+edmf_th(k-1)*dzi(k))/(dzi(k-1)+dzi(k)) @@ -6686,8 +6699,8 @@ SUBROUTINE DMP_mf( & !mf_cf = min(max(0.5 + 0.36 * atan(1.20*(Q1+0.4)),0.01),0.6) !Original CB mf_cf = min(max(0.5 + 0.36 * atan(1.55*Q1),0.01),0.6) - mf_cf = max(mf_cf, 1.75 * Aup) - mf_cf = min(mf_cf, 5.0 * Aup) + mf_cf = max(mf_cf, 1.8 * Aup) + mf_cf = min(mf_cf, 5.0 * Aup) endif !IF ( debug_code ) THEN @@ -6705,10 +6718,7 @@ SUBROUTINE DMP_mf( & if (QCp * Aup > 5e-5) then qc_bl1d(k) = 1.86 * (QCp * Aup) - 2.2e-5 else - qc_bl1d(k) = 1.18 * (QCp * Aup) - endif - if (mf_cf .ge. Aup) then - qc_bl1d(k) = qc_bl1d(k) / mf_cf + qc_bl1d(k) = 1.18 * (QCp * Aup) endif cldfra_bl1d(k) = mf_cf Ac_mf = mf_cf @@ -6718,9 +6728,6 @@ SUBROUTINE DMP_mf( & else qc_bl1d(k) = 1.18 * (QCp * Aup) endif - if (mf_cf .ge. Aup) then - qc_bl1d(k) = qc_bl1d(k) / mf_cf - endif cldfra_bl1d(k) = mf_cf Ac_mf = mf_cf endif @@ -6752,13 +6759,13 @@ SUBROUTINE DMP_mf( & endif !check for (qc in plume) .and. (cldfra_bl < threshold) enddo !k-loop - ENDIF !end nup2 > 0 +ENDIF !end nup2 > 0 - !modify output (negative: dry plume, positive: moist plume) - if (ktop > 0) then - maxqc = maxval(edmf_qc(1:ktop)) - if ( maxqc < 1.E-8) maxmf = -1.0*maxmf - endif +!modify output (negative: dry plume, positive: moist plume) +if (ktop > 0) then + maxqc = maxval(edmf_qc(1:ktop)) + if ( maxqc < 1.E-8) maxmf = -1.0*maxmf +endif ! ! debugging @@ -6927,62 +6934,68 @@ SUBROUTINE DDMF_JPL(kts,kte,dt,zw,dz,p, & &qc_bl1d,cldfra_bl1d, & &rthraten ) - INTEGER, INTENT(IN) :: KTS,KTE,KPBL - real(kind_phys),DIMENSION(KTS:KTE), INTENT(IN) :: U,V,TH,THL,TK,QT,QV,QC,& - THV,P,rho,exner,dz - real(kind_phys),DIMENSION(KTS:KTE), INTENT(IN) :: rthraten + integer, intent(in) :: KTS,KTE,KPBL + real(kind_phys), dimension(kts:kte), intent(in) :: & + U,V,TH,THL,TK,QT,QV,QC,THV,P,rho,exner,dz + real(kind_phys), dimension(kts:kte), intent(in) :: rthraten ! zw .. heights of the downdraft levels (edges of boxes) - real(kind_phys),DIMENSION(KTS:KTE+1), INTENT(IN) :: ZW - real(kind_phys), INTENT(IN) :: WTHL,WQT - real(kind_phys), INTENT(IN) :: dt,ust,pblh + real(kind_phys), dimension(kts:kte+1), intent(in) :: ZW + real(kind_phys), intent(in) :: WTHL,WQT + real(kind_phys), intent(in) :: dt,ust,pblh ! outputs - downdraft properties - real(kind_phys),DIMENSION(KTS:KTE), INTENT(OUT) :: edmf_a_dd,edmf_w_dd, & - & edmf_qt_dd,edmf_thl_dd, edmf_ent_dd,edmf_qc_dd + real(kind_phys), dimension(kts:kte), intent(out) :: & + edmf_a_dd,edmf_w_dd, & + edmf_qt_dd,edmf_thl_dd, edmf_ent_dd,edmf_qc_dd ! outputs - variables needed for solver (sd_aw - sum ai*wi, sd_awphi - sum ai*wi*phii) - real(kind_phys),DIMENSION(KTS:KTE+1) :: sd_aw, sd_awthl, sd_awqt, sd_awu, & - sd_awv, sd_awqc, sd_awqv, sd_awqke, sd_aw2 + real(kind_phys), dimension(kts:kte+1) :: & + sd_aw, sd_awthl, sd_awqt, sd_awu, & + sd_awv, sd_awqc, sd_awqv, sd_awqke, sd_aw2 - real(kind_phys),DIMENSION(KTS:KTE), INTENT(IN) :: qc_bl1d, cldfra_bl1d + real(kind_phys), dimension(kts:kte), intent(in) :: & + qc_bl1d, cldfra_bl1d - INTEGER, PARAMETER :: NDOWN=5, debug_mf=0 !fixing number of plumes to 5 + integer, parameter:: ndown = 5 ! draw downdraft starting height randomly between cloud base and cloud top - INTEGER, DIMENSION(1:NDOWN) :: DD_initK - real(kind_phys) , DIMENSION(1:NDOWN) :: randNum + integer, dimension(1:NDOWN) :: DD_initK + real(kind_phys), dimension(1:NDOWN) :: randNum ! downdraft properties - real(kind_phys),DIMENSION(KTS:KTE+1,1:NDOWN) :: DOWNW,DOWNTHL,DOWNQT,& - DOWNQC,DOWNA,DOWNU,DOWNV,DOWNTHV + real(kind_phys), dimension(kts:kte+1,1:NDOWN) :: & + DOWNW,DOWNTHL,DOWNQT,DOWNQC,DOWNA,DOWNU,DOWNV,DOWNTHV ! entrainment variables - Real(Kind_phys),DIMENSION(KTS+1:KTE+1,1:NDOWN) :: ENT,ENTf - INTEGER,DIMENSION(KTS+1:KTE+1,1:NDOWN) :: ENTi + real(kind_phys), dimension(KTS+1:KTE+1,1:NDOWN) :: ENT,ENTf + integer, dimension(KTS+1:KTE+1,1:NDOWN) :: ENTi ! internal variables - INTEGER :: K,I,ki, kminrad, qlTop, p700_ind, qlBase - real(kind_phys):: wthv,wstar,qstar,thstar,sigmaW,sigmaQT,sigmaTH,z0, & - pwmin,pwmax,wmin,wmax,wlv,wtv,went,mindownw - real(kind_phys):: B,QTn,THLn,THVn,QCn,Un,Vn,QKEn,Wn2,Wn,THVk,Pk, & - EntEXP,EntW, Beta_dm, EntExp_M, rho_int - real(kind_phys):: jump_thetav, jump_qt, jump_thetal, & + integer :: K,I,ki, kminrad, qlTop, p700_ind, qlBase + real(kind_phys):: wthv,wstar,qstar,thstar,sigmaW,sigmaQT, & + sigmaTH,z0,pwmin,pwmax,wmin,wmax,wlv,wtv,went,mindownw + real(kind_phys):: B,QTn,THLn,THVn,QCn,Un,Vn,QKEn,Wn2,Wn, & + THVk,Pk,EntEXP,EntW,beta_dm,EntExp_M,rho_int + real(kind_phys):: jump_thetav, jump_qt, jump_thetal, & refTHL, refTHV, refQT ! DD specific internal variables real(kind_phys):: minrad,zminrad, radflux, F0, wst_rad, wst_dd logical :: cloudflg - - real(kind_phys):: sigq,xl,rsl,cpm,a,mf_cf,diffqt,& + real(kind_phys):: sigq,xl,rsl,cpm,a,mf_cf,diffqt, & Fng,qww,alpha,beta,bb,f,pt,t,q2p,b9,satvp,rhgrid ! w parameters - real(kind_phys),PARAMETER :: & - &Wa=1., & - &Wb=1.5,& - &Z00=100.,& - &BCOEFF=0.2 + real(kind_phys),parameter :: & + &Wa=1., Wb=1.5, Z00=100., BCOEFF=0.2 ! entrainment parameters - real(kind_phys),PARAMETER :: & - & L0=80,& - & ENT0=0.2 - + real(kind_phys),parameter :: & + &L0=80, ENT0=0.2 + !downdraft properties + real(kind_phys):: & + & dp, & !diameter of plume + & dl, & !diameter increment + & Adn !total area of downdrafts + !additional printouts for debugging + integer, parameter :: debug_mf=0 + + dl = (1000.-500.)/real(ndown) pwmin=-3. ! drawing from the negative tail -3sigma to -1sigma pwmax=-1. @@ -7052,6 +7065,14 @@ SUBROUTINE DDMF_JPL(kts,kte,dt,zw,dz,p, & if ( radflux < 0.0 ) F0 = abs(radflux) + F0 enddo F0 = max(F0, 1.0) + + !Allow the total fractional area of the downdrafts to be proportional + !to the radiative forcing: + !for 50 W/m2, Adn = 0.10 + !for 100 W/m2, Adn = 0.15 + !for 150 W/m2, Adn = 0.20 + Adn = min( 0.05 + F0*0.001, 0.3) + !found Sc cloud and cloud not at surface, trigger downdraft if (cloudflg) then @@ -7066,14 +7087,14 @@ SUBROUTINE DDMF_JPL(kts,kte,dt,zw,dz,p, & ! call Poisson(1,NDOWN,kts+1,kte,ENTf,ENTi) - ! entrainent: Ent=Ent0/dz*P(dz/L0) - do i=1,NDOWN - do k=kts+1,kte -! ENT(k,i)=real(ENTi(k,i))*Ent0/(ZW(k+1)-ZW(k)) - ENT(k,i) = 0.002 - ENT(k,i) = min(ENT(k,i),0.9/(ZW(k+1)-ZW(k))) - enddo - enddo +! ! entrainent: Ent=Ent0/dz*P(dz/L0) +! do i=1,NDOWN +! do k=kts+1,kte +!! ENT(k,i)=real(ENTi(k,i))*Ent0/(ZW(k+1)-ZW(k)) +! ENT(k,i) = 0.002 +! ENT(k,i) = min(ENT(k,i),0.9/(ZW(k+1)-ZW(k))) +! enddo +! enddo !!![EW: INVJUMP] find 700mb height then subtract trpospheric lapse rate!!! p700_ind = MINLOC(ABS(p-70000),1)!p1D is 70000 @@ -7116,8 +7137,10 @@ SUBROUTINE DDMF_JPL(kts,kte,dt,zw,dz,p, & !DOWNW(ki,I)=0.5*(wlv+wtv) DOWNW(ki,I)=wlv + !multiply downa by cloud fraction, so it's impact will diminish if + !clouds are mixed away over the course of the longer radiation time step !DOWNA(ki,I)=0.5*ERF(wtv/(sqrt(2.)*sigmaW))-0.5*ERF(wlv/(sqrt(2.)*sigmaW)) - DOWNA(ki,I)=.1/real(NDOWN) + DOWNA(ki,I)=Adn/real(NDOWN) DOWNU(ki,I)=(u(ki-1)*DZ(ki) + u(ki)*DZ(ki-1)) /(DZ(ki)+DZ(ki-1)) DOWNV(ki,I)=(v(ki-1)*DZ(ki) + v(ki)*DZ(ki-1)) /(DZ(ki)+DZ(ki-1)) @@ -7144,16 +7167,21 @@ SUBROUTINE DDMF_JPL(kts,kte,dt,zw,dz,p, & enddo - !print*, " Begin integration of downdrafts:" DO I=1,NDOWN + dp = 500. + dl*real(I) ! diameter of plume (meters) !print *, "Plume # =", I,"=======================" DO k=DD_initK(I)-1,KTS+1,-1 + + !Entrainment from Tian and Kuang (2016), with constraints + wmin = 0.3 + dp*0.0005 + ENT(k,i) = 0.33/(MIN(MAX(-1.0*DOWNW(k+1,I),wmin),0.9)*dp) + !starting at the first interface level below cloud top !EntExp=exp(-ENT(K,I)*dz(k)) !EntExp_M=exp(-ENT(K,I)/3.*dz(k)) - EntExp =ENT(K,I)*dz(k) - EntExp_M=ENT(K,I)*0.333*dz(k) + EntExp =ENT(K,I)*dz(k) !for all scalars + EntExp_M=ENT(K,I)*0.333*dz(k) !test for momentum QTn =DOWNQT(k+1,I) *(1.-EntExp) + QT(k)*EntExp THLn=DOWNTHL(k+1,I)*(1.-EntExp) + THL(k)*EntExp @@ -7187,11 +7215,11 @@ SUBROUTINE DDMF_JPL(kts,kte,dt,zw,dz,p, & BCOEFF*B/mindownw)*MIN(dz(k), 250.) !Do not allow a parcel to accelerate more than 1.25 m/s over 200 m. - !Add max increase of 2.0 m/s for coarse vertical resolution. - IF (Wn < DOWNW(K+1,I) - MIN(1.25*dz(k)/200., 2.0))THEN - Wn = DOWNW(K+1,I) - MIN(1.25*dz(k)/200., 2.0) + !Add max acceleration of -2.0 m/s for coarse vertical resolution. + IF (Wn < DOWNW(K+1,I) - MIN(1.25*dz(k)/200., -2.0))THEN + Wn = DOWNW(K+1,I) - MIN(1.25*dz(k)/200., -2.0) ENDIF - !Add symmetrical max decrease in w + !Add symmetrical max decrease in velocity (less negative) IF (Wn > DOWNW(K+1,I) + MIN(1.25*dz(k)/200., 2.0))THEN Wn = DOWNW(K+1,I) + MIN(1.25*dz(k)/200., 2.0) ENDIF @@ -7237,7 +7265,6 @@ SUBROUTINE DDMF_JPL(kts,kte,dt,zw,dz,p, & ! Even though downdraft starts at different height, average all up to qlTop DO k=qlTop,KTS,-1 DO I=1,NDOWN - IF (I > NDOWN) exit edmf_a_dd(K) =edmf_a_dd(K) +DOWNA(K-1,I) edmf_w_dd(K) =edmf_w_dd(K) +DOWNA(K-1,I)*DOWNW(K-1,I) edmf_qt_dd(K) =edmf_qt_dd(K) +DOWNA(K-1,I)*DOWNQT(K-1,I) @@ -7287,8 +7314,8 @@ SUBROUTINE SCALE_AWARE(dx,PBL1,Psig_bl,Psig_shcu) ! Psig_bl tapers local mixing ! Psig_shcu tapers nonlocal mixing - real(kind_phys), INTENT(IN) :: dx,pbl1 - real(kind_phys), INTENT(OUT) :: Psig_bl,Psig_shcu + real(kind_phys), intent(in) :: dx,pbl1 + real(kind_phys), intent(out) :: Psig_bl,Psig_shcu real(kind_phys) :: dxdh Psig_bl=1.0 @@ -7361,28 +7388,28 @@ FUNCTION esat_blend(t) IMPLICIT NONE - real(kind_phys), INTENT(IN):: t + real(kind_phys), intent(in):: t real(kind_phys):: esat_blend,XC,ESL,ESI,chi !liquid - real(kind_phys), PARAMETER:: J0= .611583699E03 - real(kind_phys), PARAMETER:: J1= .444606896E02 - real(kind_phys), PARAMETER:: J2= .143177157E01 - real(kind_phys), PARAMETER:: J3= .264224321E-1 - real(kind_phys), PARAMETER:: J4= .299291081E-3 - real(kind_phys), PARAMETER:: J5= .203154182E-5 - real(kind_phys), PARAMETER:: J6= .702620698E-8 - real(kind_phys), PARAMETER:: J7= .379534310E-11 - real(kind_phys), PARAMETER:: J8=-.321582393E-13 + real(kind_phys), parameter:: J0= .611583699E03 + real(kind_phys), parameter:: J1= .444606896E02 + real(kind_phys), parameter:: J2= .143177157E01 + real(kind_phys), parameter:: J3= .264224321E-1 + real(kind_phys), parameter:: J4= .299291081E-3 + real(kind_phys), parameter:: J5= .203154182E-5 + real(kind_phys), parameter:: J6= .702620698E-8 + real(kind_phys), parameter:: J7= .379534310E-11 + real(kind_phys), parameter:: J8=-.321582393E-13 !ice - real(kind_phys), PARAMETER:: K0= .609868993E03 - real(kind_phys), PARAMETER:: K1= .499320233E02 - real(kind_phys), PARAMETER:: K2= .184672631E01 - real(kind_phys), PARAMETER:: K3= .402737184E-1 - real(kind_phys), PARAMETER:: K4= .565392987E-3 - real(kind_phys), PARAMETER:: K5= .521693933E-5 - real(kind_phys), PARAMETER:: K6= .307839583E-7 - real(kind_phys), PARAMETER:: K7= .105785160E-9 - real(kind_phys), PARAMETER:: K8= .161444444E-12 + real(kind_phys), parameter:: K0= .609868993E03 + real(kind_phys), parameter:: K1= .499320233E02 + real(kind_phys), parameter:: K2= .184672631E01 + real(kind_phys), parameter:: K3= .402737184E-1 + real(kind_phys), parameter:: K4= .565392987E-3 + real(kind_phys), parameter:: K5= .521693933E-5 + real(kind_phys), parameter:: K6= .307839583E-7 + real(kind_phys), parameter:: K7= .105785160E-9 + real(kind_phys), parameter:: K8= .161444444E-12 XC=MAX(-80.,t - t0c) !note t0c = 273.15, tice is set in module mynn_common to 240 @@ -7412,28 +7439,28 @@ FUNCTION qsat_blend(t, P) IMPLICIT NONE - real(kind_phys), INTENT(IN):: t, P + real(kind_phys), intent(in):: t, P real(kind_phys):: qsat_blend,XC,ESL,ESI,RSLF,RSIF,chi !liquid - real(kind_phys), PARAMETER:: J0= .611583699E03 - real(kind_phys), PARAMETER:: J1= .444606896E02 - real(kind_phys), PARAMETER:: J2= .143177157E01 - real(kind_phys), PARAMETER:: J3= .264224321E-1 - real(kind_phys), PARAMETER:: J4= .299291081E-3 - real(kind_phys), PARAMETER:: J5= .203154182E-5 - real(kind_phys), PARAMETER:: J6= .702620698E-8 - real(kind_phys), PARAMETER:: J7= .379534310E-11 - real(kind_phys), PARAMETER:: J8=-.321582393E-13 + real(kind_phys), parameter:: J0= .611583699E03 + real(kind_phys), parameter:: J1= .444606896E02 + real(kind_phys), parameter:: J2= .143177157E01 + real(kind_phys), parameter:: J3= .264224321E-1 + real(kind_phys), parameter:: J4= .299291081E-3 + real(kind_phys), parameter:: J5= .203154182E-5 + real(kind_phys), parameter:: J6= .702620698E-8 + real(kind_phys), parameter:: J7= .379534310E-11 + real(kind_phys), parameter:: J8=-.321582393E-13 !ice - real(kind_phys), PARAMETER:: K0= .609868993E03 - real(kind_phys), PARAMETER:: K1= .499320233E02 - real(kind_phys), PARAMETER:: K2= .184672631E01 - real(kind_phys), PARAMETER:: K3= .402737184E-1 - real(kind_phys), PARAMETER:: K4= .565392987E-3 - real(kind_phys), PARAMETER:: K5= .521693933E-5 - real(kind_phys), PARAMETER:: K6= .307839583E-7 - real(kind_phys), PARAMETER:: K7= .105785160E-9 - real(kind_phys), PARAMETER:: K8= .161444444E-12 + real(kind_phys), parameter:: K0= .609868993E03 + real(kind_phys), parameter:: K1= .499320233E02 + real(kind_phys), parameter:: K2= .184672631E01 + real(kind_phys), parameter:: K3= .402737184E-1 + real(kind_phys), parameter:: K4= .565392987E-3 + real(kind_phys), parameter:: K5= .521693933E-5 + real(kind_phys), parameter:: K6= .307839583E-7 + real(kind_phys), parameter:: K7= .105785160E-9 + real(kind_phys), parameter:: K8= .161444444E-12 XC=MAX(-80.,t - t0c) @@ -7470,7 +7497,7 @@ FUNCTION xl_blend(t) IMPLICIT NONE - real(kind_phys), INTENT(IN):: t + real(kind_phys), intent(in):: t real(kind_phys):: xl_blend,xlvt,xlst,chi !note: t0c = 273.15, tice is set in mynn_common @@ -7499,11 +7526,11 @@ FUNCTION phim(zet) ! stable conditions [z/L ~ O(10)]. IMPLICIT NONE - real(kind_phys), INTENT(IN):: zet + real(kind_phys), intent(in):: zet real(kind_phys):: dummy_0,dummy_1,dummy_11,dummy_2,dummy_22,dummy_3,dummy_33,dummy_4,dummy_44,dummy_psi - real(kind_phys), PARAMETER :: am_st=6.1, bm_st=2.5, rbm_st=1./bm_st - real(kind_phys), PARAMETER :: ah_st=5.3, bh_st=1.1, rbh_st=1./bh_st - real(kind_phys), PARAMETER :: am_unst=10., ah_unst=34. + real(kind_phys), parameter :: am_st=6.1, bm_st=2.5, rbm_st=1./bm_st + real(kind_phys), parameter :: ah_st=5.3, bh_st=1.1, rbh_st=1./bh_st + real(kind_phys), parameter :: am_unst=10., ah_unst=34. real(kind_phys):: phi_m,phim if ( zet >= 0.0 ) then @@ -7551,11 +7578,11 @@ FUNCTION phih(zet) ! stable conditions [z/L ~ O(10)]. IMPLICIT NONE - real(kind_phys), INTENT(IN):: zet + real(kind_phys), intent(in):: zet real(kind_phys):: dummy_0,dummy_1,dummy_11,dummy_2,dummy_22,dummy_3,dummy_33,dummy_4,dummy_44,dummy_psi - real(kind_phys), PARAMETER :: am_st=6.1, bm_st=2.5, rbm_st=1./bm_st - real(kind_phys), PARAMETER :: ah_st=5.3, bh_st=1.1, rbh_st=1./bh_st - real(kind_phys), PARAMETER :: am_unst=10., ah_unst=34. + real(kind_phys), parameter :: am_st=6.1, bm_st=2.5, rbm_st=1./bm_st + real(kind_phys), parameter :: ah_st=5.3, bh_st=1.1, rbh_st=1./bh_st + real(kind_phys), parameter :: am_unst=10., ah_unst=34. real(kind_phys):: phh,phih if ( zet >= 0.0 ) then diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index ca913c6e3..027c6f090 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -1416,6 +1416,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & qcten1(k) = 0. endif initialize_extended_diagnostics enddo + lsml = lsm(i,j) if (is_aerosol_aware .or. merra2_aerosol_aware) then do k = kts, kte nc1d(k) = nc(i,k,j) @@ -1423,7 +1424,6 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & nifa1d(k) = nifa(i,k,j) enddo else - lsml = lsm(i,j) do k = kts, kte if(lsml == 1) then nc1d(k) = Nt_c_l/rho(k) @@ -5358,14 +5358,15 @@ end subroutine table_ccnAct ! TO_DO ITEM: For radiation cooling producing fog, in which case the !.. updraft velocity could easily be negative, we could use the temp !.. and its tendency to diagnose a pretend postive updraft velocity. - real function activ_ncloud(Tt, Ww, NCCN) + real function activ_ncloud(Tt, Ww, NCCN, lsm_in) implicit none REAL, INTENT(IN):: Tt, Ww, NCCN + INTEGER, INTENT(IN):: lsm_in REAL:: n_local, w_local INTEGER:: i, j, k, l, m, n REAL:: A, B, C, D, t, u, x1, x2, y1, y2, nx, wy, fraction - + REAL:: lower_lim_nuc_frac ! ta_Na = (/10.0, 31.6, 100.0, 316.0, 1000.0, 3160.0, 10000.0/) ntb_arc ! ta_Ww = (/0.01, 0.0316, 0.1, 0.316, 1.0, 3.16, 10.0, 31.6, 100.0/) ntb_arw @@ -5412,6 +5413,14 @@ real function activ_ncloud(Tt, Ww, NCCN) l = 3 m = 2 + if (lsm_in .eq. 1) then ! land + lower_lim_nuc_frac = 0. + else if (lsm_in .eq. 0) then ! water + lower_lim_nuc_frac = 0.15 + else + lower_lim_nuc_frac = 0.15 ! catch-all for anything else + endif + A = tnccn_act(i-1,j-1,k,l,m) B = tnccn_act(i,j-1,k,l,m) C = tnccn_act(i,j,k,l,m) @@ -5426,7 +5435,8 @@ real function activ_ncloud(Tt, Ww, NCCN) ! u = (w_local-ta_Ww(j-1))/(ta_Ww(j)-ta_Ww(j-1)) fraction = (1.0-t)*(1.0-u)*A + t*(1.0-u)*B + t*u*C + (1.0-t)*u*D - + fraction = MAX(fraction, lower_lim_nuc_frac) + ! if (NCCN*fraction .gt. 0.75*Nt_c_max) then ! write(*,*) ' DEBUG-GT ', n_local, w_local, Tt, i, j, k ! endif @@ -5846,6 +5856,7 @@ subroutine calc_effectRad (t1d, p1d, qv1d, qc1d, nc1d, qi1d, ni1d, qs1d, & endif lamc = (nc(k)*am_r*g_ratio(inu_c)/rc(k))**obmr re_qc1d(k) = SNGL(0.5D0 * DBLE(3.+inu_c)/lamc) + if (lsml .ne. 1) re_qc1d(k) = max(re_qc1d(k), 7.0E-6) enddo endif diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index eecc5493c..17f682218 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -26,7 +26,7 @@ MODULE module_sf_mynn ! ! LAND only: ! "iz0tlnd" namelist option is used to select the following momentum options: -! (default) =0: Zilitinkevich (1995); Czil now set to 0.085 +! (default) =0: Zilitinkevich (1995); Czil now set to 0.095 ! =1: Czil_new (modified according to Chen & Zhang 2008) ! =2: Modified Yang et al (2002, 2008) - generalized for all landuse ! =3: constant zt = z0/7.4 (original form; Garratt 1992) @@ -225,7 +225,7 @@ SUBROUTINE SFCLAY_mynn( & ! (water =1: z0 from Davis et al (2008), zt & zq from COARE3.0/3.5 ! only) =2: z0 from Davis et al (2008), zt & zq from Garratt (1992) ! =3: z0 from Taylor and Yelland (2004), zt and zq from COARE 3.0/3.5 -!-- iz0tlnd =0: Zilitinkevich (1995) with Czil=0.085, +!-- iz0tlnd =0: Zilitinkevich (1995) with Czil=0.095, ! (land =1: Czil_new (modified according to Chen & Zhang 2008) ! only) =2: Modified Yang et al (2002, 2008) - generalized for all landuse ! =3: constant zt = z0/7.4 (Garratt 1992) @@ -2604,7 +2604,7 @@ SUBROUTINE zilitinkevich_1995(Z_0,Zt,Zq,restar,ustar,KARMAN,& IF ( IZ0TLND2 .EQ. 1 ) THEN CZIL = 10.0 ** ( -0.40 * ( Z_0 / 0.07 ) ) ELSE - CZIL = 0.085 !0.075 !0.10 + CZIL = 0.095 !0.075 !0.10 END IF Zt = Z_0*EXP(-KARMAN*CZIL*SQRT(restar)) diff --git a/physics/mynnedmf_wrapper.F90 b/physics/mynnedmf_wrapper.F90 index 3c7de235f..46db1c441 100644 --- a/physics/mynnedmf_wrapper.F90 +++ b/physics/mynnedmf_wrapper.F90 @@ -131,7 +131,8 @@ SUBROUTINE mynnedmf_wrapper_run( & & edmf_a,edmf_w,edmf_qt, & & edmf_thl,edmf_ent,edmf_qc, & & sub_thl,sub_sqv,det_thl,det_sqv,& - & nupdraft,maxMF,ktop_plume, & + & maxwidth,maxMF,ztop_plume, & + & ktop_plume, & & dudt, dvdt, dtdt, & & dqdt_water_vapor, dqdt_liquid_cloud, & ! <=== ntqv, ntcw & dqdt_ice, dqdt_snow, & ! <=== ntiw, ntsw @@ -310,9 +311,9 @@ SUBROUTINE mynnedmf_wrapper_run( & real(kind_phys), dimension(:), intent(out) :: & & ch,dtsfc1,dqsfc1,dusfc1,dvsfc1, & & dtsfci_diag,dqsfci_diag,dusfci_diag,dvsfci_diag, & - & maxMF + & maxMF,maxwidth,ztop_plume integer, dimension(:), intent(inout) :: & - & kpbl,nupdraft,ktop_plume + & kpbl,ktop_plume real(kind_phys), dimension(:), intent(inout) :: & & dusfc_cpl,dvsfc_cpl,dtsfc_cpl,dqsfc_cpl @@ -748,7 +749,7 @@ SUBROUTINE mynnedmf_wrapper_run( & & edmf_thl=edmf_thl,edmf_ent=edmf_ent,edmf_qc=edmf_qc,& !output & sub_thl3D=sub_thl,sub_sqv3D=sub_sqv, & & det_thl3D=det_thl,det_sqv3D=det_sqv, & - & nupdraft=nupdraft,maxMF=maxMF, & !output + & maxwidth=maxwidth,maxMF=maxMF,ztop_plume=ztop_plume,& !output & ktop_plume=ktop_plume, & !output & spp_pbl=spp_pbl,pattern_spp_pbl=spp_wts_pbl, & !input & RTHRATEN=htrlw, & !input @@ -1005,8 +1006,8 @@ SUBROUTINE mynnedmf_wrapper_run( & print*,"dudt:",dudt(1,1),dudt(1,2),dudt(1,levs) print*,"dvdt:",dvdt(1,1),dvdt(1,2),dvdt(1,levs) print*,"dqdt:",dqdt_water_vapor(1,1),dqdt_water_vapor(1,2),dqdt_water_vapor(1,levs) - print*,"ktop_plume:",ktop_plume(1)," maxmf:",maxmf(1) - print*,"nup:",nupdraft(1) + print*,"ztop_plume:",ztop_plume(1)," maxmf:",maxmf(1) + print*,"maxwidth:",maxwidth(1) print* endif diff --git a/physics/mynnedmf_wrapper.meta b/physics/mynnedmf_wrapper.meta index ec4706aba..8614d3ba2 100644 --- a/physics/mynnedmf_wrapper.meta +++ b/physics/mynnedmf_wrapper.meta @@ -964,13 +964,14 @@ type = real kind = kind_phys intent = inout -[nupdraft] - standard_name = number_of_plumes - long_name = number of plumes per grid column - units = count +[maxwidth] + standard_name = maximum_width_of_plumes + long_name = maximum width of plumes per grid column + units = m dimensions = (horizontal_loop_extent) - type = integer - intent = inout + type = real + kind = kind_phys + intent = out [maxMF] standard_name = maximum_mass_flux long_name = maximum mass flux within a column @@ -979,6 +980,14 @@ type = real kind = kind_phys intent = out +[ztop_plume] + standard_name = height_of_tallest_plume_in_a_column + long_name = height of tallest plume in a column + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [ktop_plume] standard_name = k_level_of_highest_plume long_name = k-level of highest plume From 14c58871eb4a91fab9d88632b6a1f0e404ad96fb Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Tue, 17 Oct 2023 16:36:31 +0000 Subject: [PATCH 048/249] missed a variable in the argument for activ_ncloud during the intial merge. --- physics/module_mp_thompson.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 027c6f090..d483ec0c2 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -3581,7 +3581,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & !+---+-----------------------------------------------------------------+ ! DROPLET NUCLEATION if (clap .gt. eps) then if (is_aerosol_aware .or. merra2_aerosol_aware) then - xnc = MAX(2., activ_ncloud(temp(k), w1d(k)+rand3, nwfa(k))) + xnc = MAX(2., activ_ncloud(temp(k), w1d(k)+rand3, nwfa(k), lsml)) else if(lsml == 1) then xnc = Nt_c_l From fe5322b0da1fa904f1cb36ff8b1a99b67c14495f Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Wed, 18 Oct 2023 18:53:03 +0000 Subject: [PATCH 049/249] Addressed the reviewer's comments. --- physics/lsm_ruc.F90 | 47 +++++++++++++++++---------------------------- 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index d3754b68c..79bcbf7b1 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -649,38 +649,27 @@ subroutine lsm_ruc_run & ! inputs nsoil = lsoil_ruc do i = 1, im ! i - horizontal loop - ! reassign smcref2 and smcwlt2 to RUC values at kdt=1 - if(kdt == 1) then - if(.not. land(i)) then - !water and sea ice - smcref (i,1) = one - smcwlt (i,1) = zero - xlai (i,1) = zero + if(.not. land(i)) then + !water and sea ice + smcref (i,1) = one + smcwlt (i,1) = zero + xlai (i,1) = zero + elseif (kdt == 1) then + !land + ! reassign smcref2 and smcwlt2 to RUC values at kdt=1 + smcref (i,1) = REFSMC(stype(i)) + smcwlt (i,1) = WLTSMC(stype(i)) + !-- rdlai is .true. when the LAI data is available in the INPUT/sfc_data.nc on cold-start + if(rdlai) then + xlai(i,1) = laixy(i) else - !land - smcref (i,1) = REFSMC(stype(i)) - smcwlt (i,1) = WLTSMC(stype(i)) - - !-- rdlai is .true. when the LAI data is available in the INPUT/sfc_data.nc on cold-start - if(rdlai) then - xlai(i,1) = laixy(i) - else - xlai(i,1) = LAITBL(vtype(i)) - endif + xlai(i,1) = LAITBL(vtype(i)) endif else - !-- if kdt > 1, parameters with sub-grid heterogeneity - if(.not. land(i)) then - !water and sea ice - smcref (i,1) = one - smcwlt (i,1) = zero - xlai (i,1) = zero - else - !land - smcref (i,1) = smcref2 (i) - smcwlt (i,1) = smcwlt2 (i) - xlai (i,1) = laixy (i) - endif + !-- land and kdt > 1, parameters has sub-grid heterogeneity + smcref (i,1) = smcref2 (i) + smcwlt (i,1) = smcwlt2 (i) + xlai (i,1) = laixy (i) endif enddo From 056f42021aa0a12715bbc07bfe85a2222759b41b Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Wed, 18 Oct 2023 19:00:20 +0000 Subject: [PATCH 050/249] Changes in module_sf_ruclsm.F90: 1. Removed commented lines in fire feedback to RUC LSM. 2. The coordinates of a test point are passed to the RUC LSM subroutines to make debug printing more manageable. 3. Reverted change in the TRANSF subroutine to original version. The non-linear root distribution needs scientific evaluation in the retro runs. --- physics/module_sf_ruclsm.F90 | 119 +++++++++++++++++++++++------------ 1 file changed, 79 insertions(+), 40 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 2bb29d440..83d7a04d6 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -1853,7 +1853,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia ilands = ivgtyp - CALL SOIL(debug_print,xlat,xlon, & + CALL SOIL(debug_print,xlat, xlon, testptlat, testptlon,& !--- input variables i,j,iland,isoil,delt,ktau,conflx,nzs,nddzs,nroot, & PRCPMS,RAINF,PATM,QVATM,QCATM,GLW,GSWnew,gswin, & @@ -2068,9 +2068,6 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia eeta = eetas*(one-snowfrac) + eeta*snowfrac qfx = qfxs*(one-snowfrac) + qfx*snowfrac hfx = hfxs*(one-snowfrac) + hfx*snowfrac - !IF ( add_fire_heat_flux ) then ! JLS - ! hfx = hfx + fire_heat_flux - !ENDIF s = ss*(one-snowfrac) + s*snowfrac evapl = evapls*(one-snowfrac) sublim = sublim*snowfrac @@ -2116,9 +2113,6 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia eeta = eetas*(one-snowfrac) + eeta*snowfrac qfx = qfxs*(one-snowfrac) + qfx*snowfrac hfx = hfxs*(one-snowfrac) + hfx*snowfrac - !IF ( add_fire_heat_flux ) then ! JLS - ! hfx = hfx + fire_heat_flux - !ENDIF s = ss*(one-snowfrac) + s*snowfrac prcpl = prcpls*(one-snowfrac) + prcpl*snowfrac fltot = fltots*(one-snowfrac) + fltot*snowfrac @@ -2248,7 +2242,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia if(SEAICE .LT. 0.5_kind_phys) then ! LAND - CALL SOIL(debug_print,xlat,xlon, & + CALL SOIL(debug_print,xlat, xlon, testptlat, testptlon,& !--- input variables i,j,iland,isoil,delt,ktau,conflx,nzs,nddzs,nroot, & PRCPMS,RAINF,PATM,QVATM,QCATM,GLW,GSWnew,GSWin, & @@ -2341,7 +2335,7 @@ END FUNCTION QSN !>\ingroup lsm_ruc_group !> This subroutine calculates energy and moisture budget for vegetated surfaces !! without snow, heat diffusion and Richards eqns in soil. - SUBROUTINE SOIL (debug_print,xlat,xlon, & + SUBROUTINE SOIL (debug_print,xlat,xlon,testptlat,testptlon,& i,j,iland,isoil,delt,ktau,conflx,nzs,nddzs,nroot,& !--- input variables PRCPMS,RAINF,PATM,QVATM,QCATM, & GLW,GSW,GSWin,EMISS,RNET, & @@ -2423,7 +2417,8 @@ SUBROUTINE SOIL (debug_print,xlat,xlon, & INTEGER, INTENT(IN ) :: nroot,ktau,nzs , & nddzs !nddzs=2*(nzs-2) INTEGER, INTENT(IN ) :: i,j,iland,isoil - real (kind_phys), INTENT(IN ) :: DELT,CONFLX,xlat,xlon + real (kind_phys), INTENT(IN ) :: DELT,CONFLX + real (kind_phys), INTENT(IN ) :: xlat,xlon,testptlat,testptlon LOGICAL, INTENT(IN ) :: myj !--- 3-D Atmospheric variables real (kind_phys), & @@ -2647,6 +2642,7 @@ SUBROUTINE SOIL (debug_print,xlat,xlon, & ! hydraulic condeuctivities !****************************************************************** CALL SOILPROP( debug_print, & + xlat, xlon, testptlat, testptlon, & !--- input variables nzs,fwsat,lwsat,tav,keepfr, & soilmois,soiliqw,soilice, & @@ -2682,6 +2678,7 @@ SUBROUTINE SOIL (debug_print,xlat,xlon, & ! TRANSF computes transpiration function !************************************************************** CALL TRANSF(debug_print, & + xlat, xlon, testptlat, testptlon, & !--- input variables nzs,nroot,soiliqw,tabs,lai,gswin, & !--- soil fixed fields @@ -2739,7 +2736,7 @@ SUBROUTINE SOIL (debug_print,xlat,xlon, & ! SOILTEMP soilves heat budget and diffusion eqn. in soil !************************************************************** - CALL SOILTEMP(debug_print,xlat,xlon, & + CALL SOILTEMP(debug_print,xlat,xlon,testptlat,testptlon,& !--- input variables i,j,iland,isoil, & delt,ktau,conflx,nzs,nddzs,nroot, & @@ -2809,6 +2806,7 @@ SUBROUTINE SOIL (debug_print,xlat,xlon, & ! and Richards eqn. !************************************************************************* CALL SOILMOIST (debug_print, & + xlat, xlon, testptlat, testptlon, & !-- input delt,nzs,nddzs,DTDZS,DTDZS2,RIW, & zsmain,zshalf,diffu,hydro, & @@ -3603,6 +3601,7 @@ SUBROUTINE SNOWSOIL ( debug_print,xlat,xlon, & ! hydraulic condeuctivities !****************************************************************** CALL SOILPROP(debug_print, & + xlat, xlon, testptlat, testptlon, & !--- input variables nzs,fwsat,lwsat,tav,keepfr, & soilmois,soiliqw,soilice, & @@ -3653,6 +3652,7 @@ SUBROUTINE SNOWSOIL ( debug_print,xlat,xlon, & ! TRANSF computes transpiration function !************************************************************** CALL TRANSF(debug_print, & + xlat, xlon, testptlat, testptlon, & !--- input variables nzs,nroot,soiliqw,tabs,lai,gswin, & !--- soil fixed fields @@ -3748,7 +3748,7 @@ SUBROUTINE SNOWSOIL ( debug_print,xlat,xlon, & !--- TQCAN FOR SOLUTION OF MOISTURE BALANCE (Smirnova et al. 1996, EQ.22,28) ! AND TSO,ETA PROFILES !************************************************************************* - CALL SOILMOIST (debug_print, & + CALL SOILMOIST (debug_print,xlat,xlon,testptlat,testptlon,& !-- input delt,nzs,nddzs,DTDZS,DTDZS2,RIW, & zsmain,zshalf,diffu,hydro, & @@ -4704,7 +4704,7 @@ END SUBROUTINE SNOWSEAICE !>\ingroup lsm_ruc_group !> This subroutine solves energy budget equation and heat diffusion !! equation. - SUBROUTINE SOILTEMP( debug_print,xlat,xlon, & + SUBROUTINE SOILTEMP( debug_print,xlat,xlon,testptlat,testptlon,& i,j,iland,isoil, & !--- input variables delt,ktau,conflx,nzs,nddzs,nroot, & PRCPMS,RAINF,PATM,TABS,QVATM,QCATM, & @@ -4774,7 +4774,8 @@ SUBROUTINE SOILTEMP( debug_print,xlat,xlon, & INTEGER, INTENT(IN ) :: nroot,ktau,nzs , & nddzs !nddzs=2*(nzs-2) INTEGER, INTENT(IN ) :: i,j,iland,isoil - real (kind_phys), INTENT(IN ) :: DELT,CONFLX,PRCPMS, RAINF,xlat,xlon + real (kind_phys), INTENT(IN ) :: DELT,CONFLX,PRCPMS, RAINF + real (kind_phys), INTENT(IN ) :: xlat, xlon, testptlat, testptlon real (kind_phys), INTENT(INOUT) :: DRYCAN,WETCAN,TRANSUM !--- 3-D Atmospheric variables real (kind_phys), & @@ -5984,6 +5985,7 @@ END SUBROUTINE SNOWTEMP !! This subroutine solves moisture budget and computes soil moisture !! and surface and sub-surface runoffs. SUBROUTINE SOILMOIST ( debug_print, & + xlat, xlon, testptlat, testptlon, & DELT,NZS,NDDZS,DTDZS,DTDZS2,RIW, & !--- input parameters ZSMAIN,ZSHALF,DIFFU,HYDRO, & QSG,QVG,QCG,QCATM,QVATM,PRCP, & @@ -6037,6 +6039,7 @@ SUBROUTINE SOILMOIST ( debug_print, & !--- input variables LOGICAL, INTENT(IN ) :: debug_print real (kind_phys), INTENT(IN ) :: DELT + real (kind_phys), INTENT(IN ) :: xlat, xlon, testptlat, testptlon INTEGER, INTENT(IN ) :: NZS,NDDZS ! input variables @@ -6124,8 +6127,12 @@ SUBROUTINE SOILMOIST ( debug_print, & DENOM=one+X2+X4-Q2*COSMC(K) COSMC(K+1)=Q4/DENOM IF (debug_print ) THEN - print *,'q2,soilmois(kn),DIFFU(KN),x2,HYDRO(KN+1),DTDZS2(KN-1),kn,k' & - ,q2,soilmois(kn),DIFFU(KN),x2,HYDRO(KN+1),DTDZS2(KN-1),kn,k + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'q2,soilmois(kn),DIFFU(KN),x2,HYDRO(KN+1),DTDZS2(KN-1),kn,k' & + ,q2,soilmois(kn),DIFFU(KN),x2,HYDRO(KN+1),DTDZS2(KN-1),kn,k + endif ENDIF RHSMC(K+1)=(SOILMOIS(KN)+Q2*RHSMC(K) & +TRANSP(KN) & @@ -6156,8 +6163,12 @@ SUBROUTINE SOILMOIST ( debug_print, & TOTLIQ=PRCP-DRIP/DELT-(one-VEGFRAC)*DEW*RAS-SMELT IF (debug_print ) THEN -print *,'UMVEG*PRCP,DRIP/DELT,UMVEG*DEW*RAS,SMELT', & - UMVEG*PRCP,DRIP/DELT,UMVEG*DEW*RAS,SMELT + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'UMVEG*PRCP,DRIP/DELT,UMVEG*DEW*RAS,SMELT', & + UMVEG*PRCP,DRIP/DELT,UMVEG*DEW*RAS,SMELT + endif ENDIF FLX=TOTLIQ @@ -6200,7 +6211,7 @@ SUBROUTINE SOILMOIST ( debug_print, & INFMAX1 = zero ENDIF IF (debug_print ) THEN - print *,'INFMAX1 before frozen part',INFMAX1 + print *,'INFMAX1 before frozen part',INFMAX1 ENDIF ! ----------- FROZEN GROUND VERSION -------------------------- @@ -6234,8 +6245,8 @@ SUBROUTINE SOILMOIST ( debug_print, & INFMAX = MAX(INFMAX1,HYDRO(1)*SOILMOIS(1)) INFMAX = MIN(INFMAX, -TOTLIQ) IF (debug_print ) THEN -print *,'INFMAX,INFMAX1,HYDRO(1)*SOILIQW(1),-TOTLIQ', & - INFMAX,INFMAX1,HYDRO(1)*SOILIQW(1),-TOTLIQ + print *,'INFMAX,INFMAX1,HYDRO(1)*SOILIQW(1),-TOTLIQ', & + INFMAX,INFMAX1,HYDRO(1)*SOILIQW(1),-TOTLIQ ENDIF !---- IF (-TOTLIQ.GT.INFMAX)THEN @@ -6285,8 +6296,12 @@ SUBROUTINE SOILMOIST ( debug_print, & END IF IF (debug_print ) THEN - print *,'SOILMOIS,SOILIQW, soilice',SOILMOIS,SOILIQW,soilice*riw - print *,'COSMC,RHSMC',COSMC,RHSMC + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'SOILMOIS,SOILIQW, soilice',SOILMOIS,SOILIQW,soilice*riw + print *,'COSMC,RHSMC',COSMC,RHSMC + endif ENDIF !--- FINAL SOLUTION FOR SOILMOIS ! DO K=2,NZS1 @@ -6312,7 +6327,11 @@ SUBROUTINE SOILMOIST ( debug_print, & END IF END DO IF (debug_print ) THEN - print *,'END soilmois,soiliqw,soilice',soilmois,SOILIQW,soilice*riw + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'END soilmois,soiliqw,soilice',soilmois,SOILIQW,soilice*riw + endif ENDIF MAVAIL=max(.00001_kind_phys,min(one,(SOILMOIS(1)/(REF-QMIN)*(one-snowfrac)+one*snowfrac))) @@ -6324,6 +6343,7 @@ END SUBROUTINE SOILMOIST !! This subroutine computes thermal diffusivity, and diffusional and !! hydraulic condeuctivities in soil. SUBROUTINE SOILPROP( debug_print, & + xlat, xlon, testptlat, testptlon, & nzs,fwsat,lwsat,tav,keepfr, & !--- input variables soilmois,soiliqw,soilice, & soilmoism,soiliqwm,soilicem, & @@ -6357,6 +6377,8 @@ SUBROUTINE SOILPROP( debug_print, & !--- soil properties LOGICAL, INTENT(IN ) :: debug_print INTEGER, INTENT(IN ) :: NZS + real (kind_phys), INTENT(IN ) :: xlat, xlon, testptlat, testptlon + real (kind_phys) , & INTENT(IN ) :: RHOCS, & BCLH, & @@ -6533,6 +6555,7 @@ END SUBROUTINE SOILPROP !> This subroutine solves the transpiration function (EQs. 18,19 in !! Smirnova et al.(1997) \cite Smirnova_1997) SUBROUTINE TRANSF( debug_print, & + xlat,xlon,testptlat,testptlon, & nzs,nroot,soiliqw,tabs,lai,gswin, & !--- input variables dqm,qmin,ref,wilt,zshalf,pc,iland, & !--- soil fixed fields tranf,transum) !--- output variables @@ -6553,6 +6576,7 @@ SUBROUTINE TRANSF( debug_print, & LOGICAL, INTENT(IN ) :: debug_print INTEGER, INTENT(IN ) :: nroot,nzs,iland + real (kind_phys), INTENT(IN ) :: xlat,xlon,testptlat,testptlon real (kind_phys) , & INTENT(IN ) :: GSWin, TABS, lai @@ -6599,7 +6623,7 @@ SUBROUTINE TRANSF( debug_print, & ap4=59.656_kind_phys gx=ap0+ap1*sm1+ap2*sm2+ap3*sm3+ap4*sm4 if(totliq.ge.ref) gx=one - if(totliq.le.zero) gx=zero + if(totliq.le.wilt) gx=zero if(gx.gt.one) gx=one if(gx.lt.zero) gx=zero DID=zshalf(2) @@ -6612,7 +6636,7 @@ SUBROUTINE TRANSF( debug_print, & TRANF(1)=(TOTLIQ-WILT)/(REF-WILT)*DID ENDIF !-- uncomment next line for non-linear root distribution - TRANF(1)=part(1) + !TRANF(1)=part(1) DO K=2,NROOT totliq=soiliqw(k)+qmin @@ -6622,7 +6646,7 @@ SUBROUTINE TRANSF( debug_print, & sm4=sm3*sm1 gx=ap0+ap1*sm1+ap2*sm2+ap3*sm3+ap4*sm4 if(totliq.ge.ref) gx=one - if(totliq.le.zero) gx=zero + if(totliq.le.wilt) gx=zero if(gx.gt.one) gx=one if(gx.lt.zero) gx=zero DID=zshalf(K+1)-zshalf(K) @@ -6636,8 +6660,16 @@ SUBROUTINE TRANSF( debug_print, & /(REF-WILT)*DID ENDIF !-- uncomment next line for non-linear root distribution - TRANF(k)=part(k) + !TRANF(k)=part(k) END DO + IF (debug_print ) THEN + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'soiliqw =',soiliqw,'wilt=',wilt,'qmin= ',qmin + print *,'tranf = ',tranf + endif + ENDIF ! For LAI> 3 => transpiration at potential rate (F.Tardieu, 2013) if(lai > 4._kind_phys) then @@ -6649,7 +6681,11 @@ SUBROUTINE TRANSF( debug_print, & ! pctot=min(0.8,max(pc,pc*lai)) endif IF ( debug_print ) THEN - print *,'pctot,lai,pc',pctot,lai,pc + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'pctot,lai,pc',pctot,lai,pc + endif ENDIF !--- !--- air temperature function @@ -6659,9 +6695,6 @@ SUBROUTINE TRANSF( debug_print, & ELSE FTEM = one / (one + EXP(0.5_kind_phys * (TABS - 314.0_kind_phys))) ENDIF - IF ( debug_print ) THEN - print *,'tabs,ftem',tabs,ftem - ENDIF !--- incoming solar function cmin = one/rsmax_data cmax = one/rstbl(iland) @@ -6684,27 +6717,33 @@ SUBROUTINE TRANSF( debug_print, & else fsol = one endif - IF ( debug_print ) THEN - print *,'GSWin,lai,f1,fsol',gswin,lai,f1,fsol - ENDIF !--- total conductance totcnd =(cmin + (cmax - cmin)*pctot*ftem*fsol)/cmax IF ( debug_print ) THEN - print *,'iland,RGLTBL(iland),RSTBL(iland),RSMAX_DATA,totcnd' & - ,iland,RGLTBL(iland),RSTBL(iland),RSMAX_DATA,totcnd + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'GSWin,Tabs,lai,f1,cmax,cmin,pc,pctot,ftem,fsol',GSWin,Tabs,lai,f1,cmax,cmin,pc,pctot,ftem,fsol + print *,'iland,RGLTBL(iland),RSTBL(iland),RSMAX_DATA,totcnd' & + ,iland,RGLTBL(iland),RSTBL(iland),RSMAX_DATA,totcnd + endif ENDIF !-- TRANSUM - total for the rooting zone transum=zero DO K=1,NROOT ! linear root distribution - TRANF(k)=max(cmin,TRANF(k)*totcnd) + TRANF(k)=max(zero,TRANF(k)*totcnd) transum=transum+tranf(k) END DO IF ( debug_print ) THEN - print *,'transum,TRANF',transum,tranf - endif + if (abs(xlat-testptlat).lt.0.05 .and. & + abs(xlon-testptlon).lt.0.05)then + print *,'xlat,xlon=',xlat,xlon + print *,'transum,TRANF',transum,tranf + endif + ENDIF !----------------------------------------------------------------- END SUBROUTINE TRANSF From ffb091280816bb1aac4ea92b421314c0c695cb3c Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Thu, 19 Oct 2023 17:19:27 +0000 Subject: [PATCH 051/249] Adding back a missing exclamation point in module_bl_mynn.F90 and adding a limit to protect against the ridiculously large z0s when using thin first model levels in module_sf_mynn.F90 --- physics/module_bl_mynn.F90 | 2 +- physics/module_sf_mynn.F90 | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index 943a5c81d..18a385ba7 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -1,5 +1,5 @@ !>\file module_bl_mynn.F90 -! This file contains the entity of MYNN-EDMF PBL scheme. +!! This file contains the entity of MYNN-EDMF PBL scheme. ! ********************************************************************** ! * An improved Mellor-Yamada turbulence closure model * ! * * diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index 17f682218..c2845f290 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -1380,6 +1380,8 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & else ZNTstoch_lnd(I) = ZNT_lnd(I) endif + !add limit to prevent ridiculous values of z0 (more than dz/15) + ZNTstoch_lnd(I) = min(ZNTstoch_lnd(I), dz8w1d(i)*0.0666) !-------------------------------------- ! LAND From 5592fc4fe88ac2c704eccf6fa01b8ff875135726 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 19 Oct 2023 17:42:47 +0000 Subject: [PATCH 052/249] Metafile cleanup --- physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta | 8 ++++---- .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta | 3 ++- .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta | 4 ++-- .../UFS_SCM_NEPTUNE/GFS_radiation_surface.meta | 2 +- physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta | 2 +- physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta | 6 +++--- .../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta | 6 +++--- .../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta | 2 +- physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta | 2 +- .../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta | 2 +- .../Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta | 2 +- .../Morrison_Gettelman}/aerinterp.F90 | 0 physics/h2o_photo/h2o_def.meta | 2 +- physics/o3_photo/ozne_def.meta | 2 +- 14 files changed, 22 insertions(+), 21 deletions(-) rename physics/{Interstitials/UFS_SCM_NEPTUNE => MP/Morrison_Gettelman}/aerinterp.F90 (100%) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta index de3f49a6f..10eb43671 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.meta @@ -200,7 +200,7 @@ [ccpp-table-properties] name = GFS_interstitialtoscreen type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] @@ -399,7 +399,7 @@ [ccpp-table-properties] name = GFS_abort type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] @@ -439,7 +439,7 @@ [ccpp-table-properties] name = GFS_checkland type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] @@ -698,7 +698,7 @@ [ccpp-table-properties] name = GFS_checktracers type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta index 2aec034fd..7df4cf715 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta @@ -3,7 +3,8 @@ type = scheme relative_path = ../../ dependencies = hooks/machine.F - dependencies = Interstitials/GFS/gcycle.F90,Interstitials/GFS/iccn_def.F,Interstitials/GFS/iccninterp.F90,Interstitials/GFS/sfcsub.F + dependencies = Interstitials/UFS_SCM_NEPTUNE/gcycle.F90,Interstitials/UFS_SCM_NEPTUNE/iccn_def.F + dependencies = Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90,Interstitials/UFS_SCM_NEPTUNE/sfcsub.F dependencies = Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta index d033c889b..e1de4d699 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta @@ -3,8 +3,8 @@ type = scheme relative_path = ../../ dependencies = hooks/machine.F - dependencies = Interstitials/GFS/iccn_def.F,Interstitials/GFS/iccninterp.F90,Interstitials/GFS/sfcsub.F - dependencies = Radiation/mersenne_twister.f + dependencies = Interstitials/UFS_SCM_NEPTUNE/iccn_def.F,Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90 + dependencies = Interstitials/UFS_SCM_NEPTUNE/sfcsub.F,Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 dependencies = o3_photo/ozinterp.f90,o3_photo/ozne_def.f diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta index 79837d0bf..686bd3c6c 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta @@ -2,7 +2,7 @@ name = GFS_radiation_surface type = scheme relative_path = ../../ - dependencies = Radiation/iounitdef.f,Radiation/radiation_surface.f + dependencies = Radiation/radiation_surface.f dependencies = SFC_Models/Land/RUC/set_soilveg_ruc.F90,SFC_Models/Land/RUC/namelist_soilveg_ruc.F90 dependencies = hooks/machine.F diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta index c84b9da31..b387c3e33 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.meta @@ -3,7 +3,7 @@ type = scheme relative_path = ../../ dependencies = hooks/machine.F - dependencies = Radiation/iounitdef.f,Radiation/radiation_aerosols.f,Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f + dependencies = Radiation/radiation_aerosols.f,Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f ######################################################################## [ccpp-arg-table] diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta index af95daf52..72495eac5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta @@ -3,10 +3,10 @@ type = scheme relative_path = ../../ dependencies = tools/funcphys.f90,hooks/machine.F - dependencies = MP/Thompson/module_mp_thompson.F90,MP/Thompsonmodule_mp_thompson_make_number_concentrations.F90 - dependencies = Radiation/iounitdef.f,Radiation/RRTMG/radcons.f90,Radiation/radiation_aerosols.f + dependencies = MP/Thompson/module_mp_thompson.F90,MP/Thompson/module_mp_thompson_make_number_concentrations.F90 + dependencies = Radiation/RRTMG/radcons.f90,Radiation/radiation_aerosols.f dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_clouds.f,Radiation/radiation_gases.f - dependencies = Radiation/radlw_param.f,Radiation/radsw_param.f,Radiation/radiation_cloud_overlap.F90 + dependencies = Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_param.f,Radiation/radiation_cloud_overlap.F90 dependencies = SFC_Models/Land/Noah/surface_perturbation.F90 ######################################################################## diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta index 0c199deaa..a9fbf91d9 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.meta @@ -3,9 +3,9 @@ type = scheme relative_path = ../../ dependencies = hooks/machine.F - dependencies = Radiaiton/iounitdef.f,Radiaiton/RRTMG/radcons.f90,Radiaiton/radiation_aerosols.f - dependencies = Radiaiton/radiation_astronomy.f,Radiaiton/radiation_clouds.f,Radiaiton/radiation_gases.f - dependencies = Radiaiton/radlw_main.F90,Radiaiton/radlw_param.f,Radiaiton/radsw_main.F90,Radiaiton/radsw_param.f + dependencies = Radiation/radiation_aerosols.f + dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_clouds.f,Radiation/radiation_gases.f + dependencies = Radiation/RRTMG/radlw_main.F90,Radiation/RRTMG/radlw_param.f,Radiation/RRTMG/radsw_main.F90,Radiation/RRTMG/radsw_param.f dependencies = MP/Thompson/module_mp_thompson.F90 ######################################################################## diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta index c21c2ef7c..5b355849a 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta @@ -2,7 +2,7 @@ name = GFS_rrtmgp_post type = scheme relative_path = ../../ - dependencies = Radiation/iounitdef.f,hooks/machine.F,Radiation/radiation_aerosols.f + dependencies = hooks/machine.F,Radiation/radiation_aerosols.f dependencies = Radiation/RRTMG/radlw_param.f,Radiation/radiation_tools.F90,Radiation/RRTMGP/rte-rrtmgp/extensions/mo_heating_rates.F90 ######################################################################## diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta index ae67ef51b..ddc95c55c 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta @@ -2,7 +2,7 @@ name = GFS_rrtmgp_pre type = scheme relative_path = ../../ - dependencies = tools/funcphys.f90,hooks/machine.F,Radiation/iounitdef.f,Radiation/radiation_aerosols.f + dependencies = tools/funcphys.f90,hooks/machine.F,Radiation/radiation_aerosols.f dependencies = Radiation/radiation_astronomy.f,Radiation/radiation_gases.f,Radiation/radiation_tools.F90 ######################################################################## diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta index 5d21e1910..14c1f91cd 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.meta @@ -3,7 +3,7 @@ type = scheme relative_path = ../../ dependencies = hooks/machine.F,MP/Thompson/module_mp_thompson.F90 - dependencies = Radiation/iounitdef.f,Radiation/radiation_aerosols.f + dependencies = Radiation/radiation_aerosols.f dependencies = Radiation/radiation_gases.f,Radiation/radiation_astronomy.f ######################################################################## diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta index c9fd5950c..9829e3538 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta @@ -2,7 +2,7 @@ name = sgscloud_radpre type = scheme relative_path = ../../ - dependencies = tools/funcphys.f90,Radiation/iounitdef.f,hooks/machine.F,hooks/physcons.F90 + dependencies = tools/funcphys.f90,hooks/machine.F,hooks/physcons.F90 dependencies = hooks/physcons.F90,Radiation/RRTMG/radcons.f90 dependencies = Radiation/radiation_clouds.f,MP/Thompson/module_mp_thompson.F90 diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/aerinterp.F90 b/physics/MP/Morrison_Gettelman/aerinterp.F90 similarity index 100% rename from physics/Interstitials/UFS_SCM_NEPTUNE/aerinterp.F90 rename to physics/MP/Morrison_Gettelman/aerinterp.F90 diff --git a/physics/h2o_photo/h2o_def.meta b/physics/h2o_photo/h2o_def.meta index 3bb9bf94d..92e1d61bd 100644 --- a/physics/h2o_photo/h2o_def.meta +++ b/physics/h2o_photo/h2o_def.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = h2o_def type = module - dependencies = ../../hooks/machine.F + dependencies = ../hooks/machine.F [ccpp-arg-table] name = h2o_def diff --git a/physics/o3_photo/ozne_def.meta b/physics/o3_photo/ozne_def.meta index 3123892bb..bdb51ce8d 100644 --- a/physics/o3_photo/ozne_def.meta +++ b/physics/o3_photo/ozne_def.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ozne_def type = module - dependencies = ../../hooks/machine.F + dependencies = ../hooks/machine.F [ccpp-arg-table] name = ozne_def From e627b189236c8ddc7d6a41683e1526b458413336 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 19 Oct 2023 17:51:25 +0000 Subject: [PATCH 053/249] Move rte-rrtmgp submodule --- .gitmodules | 3 +++ physics/Radiation/RRTMGP/rte-rrtmgp | 1 + 2 files changed, 4 insertions(+) create mode 160000 physics/Radiation/RRTMGP/rte-rrtmgp diff --git a/.gitmodules b/.gitmodules index c82541c5b..24b9cf118 100644 --- a/.gitmodules +++ b/.gitmodules @@ -2,3 +2,6 @@ path = physics/Radiation/RRTMGP/rte-rrtmgp url = https://github.com/earth-system-radiation/rte-rrtmgp branch = main +[submodule "physics/Radiation/RRTMGP/rte-rrtmgp"] + path = physics/Radiation/RRTMGP/rte-rrtmgp + url = https://github.com/earth-system-radiation/rte-rrtmgp diff --git a/physics/Radiation/RRTMGP/rte-rrtmgp b/physics/Radiation/RRTMGP/rte-rrtmgp new file mode 160000 index 000000000..74a0e098b --- /dev/null +++ b/physics/Radiation/RRTMGP/rte-rrtmgp @@ -0,0 +1 @@ +Subproject commit 74a0e098b2163425e4b5466c2dfcf8ae26d560a5 From 91415d42d51059697e8d0c03f8b7f00e3fb7aea3 Mon Sep 17 00:00:00 2001 From: "Xiaqiong.Zhou" Date: Fri, 20 Oct 2023 14:45:01 +0000 Subject: [PATCH 054/249] Add a switch to turn off samfdeepcnv when the MYNN shallow convection is active --- physics/samfdeepcnv.f | 6 ++++-- physics/samfdeepcnv.meta | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 8a36fe34c..94a4cd148 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -83,7 +83,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & & CNV_DQLDT,CLCN,CNV_FICE,CNV_NDROP,CNV_NICE,mp_phys,mp_phys_mg,& & clam,c0s,c1,betal,betas,evef,pgcon,asolfac, & & do_ca, ca_closure, ca_entr, ca_trigger, nthresh,ca_deep, & - & rainevap,sigmain, sigmaout, errmsg,errflg) + & rainevap,sigmain, sigmaout, maxMF, do_mynnedmf, errmsg,errflg) ! use machine , only : kind_phys use funcphys , only : fpvs @@ -99,11 +99,12 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & & prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:) real(kind=kind_phys), dimension(:), intent(in) :: fscav logical, intent(in) :: first_time_step,restart,hwrf_samfdeep, & - & progsigma + & progsigma,do_mynnedmf real(kind=kind_phys), intent(in) :: nthresh 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(out) :: rainevap(:) real(kind=kind_phys), intent(out) :: sigmaout(:,:) logical, intent(in) :: do_ca,ca_closure,ca_entr,ca_trigger @@ -347,6 +348,7 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & ! do i=1,im cnvflg(i) = .true. + if(do_mynnedmf.and.(maxMF(i).gt.0.))cnvflg(i)=.false. sfcpbl(i) = sfclfac * hpbl(i) rn(i)=0. mbdt(i)=10. diff --git a/physics/samfdeepcnv.meta b/physics/samfdeepcnv.meta index bed4d655d..86c713a06 100644 --- a/physics/samfdeepcnv.meta +++ b/physics/samfdeepcnv.meta @@ -450,6 +450,21 @@ type = real kind = kind_phys intent = out +[maxMF] + standard_name = maximum_mass_flux + long_name = maximum mass flux within a column + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[do_mynnedmf] + standard_name = flag_for_mellor_yamada_nakanishi_niino_pbl_scheme + long_name = flag to activate MYNN-EDMF + units = flag + dimensions = () + type = logical + intent = in [qlcn] standard_name = mass_fraction_of_convective_cloud_liquid_water long_name = mass fraction of convective cloud liquid water From a515ec34081d5b55894191b15655e5f83c96de3b Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Mon, 23 Oct 2023 18:19:59 +0000 Subject: [PATCH 055/249] Based on 1-D testing in ESM-SnowMIP a change to computation of snow thermal conductivity is made in module_sf_ruclsm.F90. --- physics/module_sf_ruclsm.F90 | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 83d7a04d6..fe02ccdc8 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -4071,7 +4071,7 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & RHOnewCSN=sheatsn * RHOnewSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. @@ -4088,13 +4088,13 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys !-- fact is added by tgs based on 4 Jan 2017 testing - fact = 5._kind_phys + !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - fact = 2._kind_phys + !fact = 2._kind_phys endif - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. @@ -4535,7 +4535,7 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & RHOCSN=sheatsn* RHOSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. @@ -4552,13 +4552,13 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & if(rhosn < 156._kind_phys .or. (newsn > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys !-- fact is added by tgs based on 4 Jan 2017 testing - fact = 5._kind_phys + !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - fact = 2._kind_phys + !fact = 2._kind_phys endif - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. @@ -5219,7 +5219,7 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & RHOCSN=sheatsn* RHOSN RHOnewCSN=sheatsn* RHOnewSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. @@ -5236,10 +5236,10 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys !-- fact is added by tgs based on 4 Jan 2017 testing - fact = 5._kind_phys + !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - fact = 2._kind_phys + !fact = 2._kind_phys if(debug_print) then print *,'SnowTemp xlat,xlon,rhosn,keff', xlat,xlon,rhosn,keff,keff/rhocsn*fact print *,'SNOWTEMP - 0.265/rhocsn',0.265_kind_phys/rhocsn @@ -5249,7 +5249,7 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & print *,'SNOWTEMP - xlat,xlon,newsnow,rhonewsn,rhosn,fact,keff',xlat,xlon,newsnow, rhonewsn,rhosn,fact,keff endif - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. @@ -5802,7 +5802,7 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & RHOCSN=sheatsn* RHOSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. @@ -5819,10 +5819,10 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys !-- fact is added by tgs based on 4 Jan 2017 testing - fact = 5._kind_phys + !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - fact = 2._kind_phys + !fact = 2._kind_phys if(debug_print) then print *,'End SNOWTEMP - xlat,xlon,rhosn,keff',xlat,xlon,rhosn,keff print *,'End SNOWTEMP - 0.265/rhocsn',0.265/rhocsn @@ -5833,7 +5833,7 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & xlat,xlon,newsnow, rhonewsn,rhosn,fact,keff,keff/rhocsn*fact endif - if(newsnow <= zero .and. snhei > 3.0_kind_phys*SNHEI_crit .and. rhosn > 250._kind_phys) then + if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. From b314eabab45297076deaad068e5d30f1fa6eab68 Mon Sep 17 00:00:00 2001 From: Xiaqiong Zhou Date: Tue, 24 Oct 2023 13:30:32 +0000 Subject: [PATCH 056/249] Fix the undefined dimension issue for maxmf in tests with GNU debug --- physics/samfdeepcnv.f | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 94a4cd148..7bf9cd2f5 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -348,7 +348,9 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & ! do i=1,im cnvflg(i) = .true. - if(do_mynnedmf.and.(maxMF(i).gt.0.))cnvflg(i)=.false. + if(do_mynnedmf) then + if(maxMF(i).gt.0.)cnvflg(i)=.false. + endif sfcpbl(i) = sfclfac * hpbl(i) rn(i)=0. mbdt(i)=10. From ce11da759b562845cee1722ec36e8f46aebd0c67 Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Tue, 24 Oct 2023 17:28:40 +0000 Subject: [PATCH 057/249] In module_sf_ruclsm.F90: clean-up comments, changed the constant for hard snow slab thermal conductivity. --- physics/module_sf_ruclsm.F90 | 76 ++++++++++++------------------------ 1 file changed, 24 insertions(+), 52 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index fe02ccdc8..74d2719d4 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -4071,23 +4071,15 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & RHOnewCSN=sheatsn * RHOnewSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then - !-- some areas with large snow depth have unrealistically - !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. - !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys - else - !-- old version thdifsn = 0.265/RHOCSN - THDIFSN = 0.265_kind_phys/RHOCSN - endif + !-- old version thdifsn = 0.265/RHOCSN + THDIFSN = 0.265_kind_phys/RHOCSN else !-- 07Jun19 - thermal conductivity (K_eff) from Sturm et al.(1997) !-- keff = 10. ** (2.650 * RHOSN*1.e-3 - 1.652) fact = one if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is added by tgs based on 4 Jan 2017 testing + !-- fact is tuning parameter added by tgs based on 4 Jan 2017 testing !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys @@ -4097,9 +4089,10 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. + !-- Based on Sturm et al. keff=0.452 typical for hard snow slabs + !-- with rhosn=488 kg/m^3. Thdifsn = 0.452/(2090*488)=4.431718e-7 !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys + thdifsn = 4.431718e-7_kind_phys else thdifsn = keff/rhocsn * fact endif @@ -4535,23 +4528,15 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & RHOCSN=sheatsn* RHOSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then - !-- some areas with large snow depth have unrealistically - !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. - !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys - else - !-- old version thdifsn = 0.265/RHOCSN - THDIFSN = 0.265_kind_phys/RHOCSN - endif + !-- old version thdifsn = 0.265/RHOCSN + THDIFSN = 0.265_kind_phys/RHOCSN else !-- 07Jun19 - thermal conductivity (K_eff) from Sturm et al.(1997) !-- keff = 10. ** (2.650 * RHOSN*1.e-3 - 1.652) fact = one if(rhosn < 156._kind_phys .or. (newsn > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is added by tgs based on 4 Jan 2017 testing + !-- fact is a tuning parameter !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys @@ -4561,9 +4546,10 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. + !-- Based on Sturm et al. keff=0.452 typical for hard snow slabs + !-- with rhosn=488 kg/m^3. Thdifsn = 0.452/(2090*488)=4.431718e-7 !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys + thdifsn = 4.431718e-7_kind_phys else thdifsn = keff/rhocsn * fact endif @@ -5219,23 +5205,15 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & RHOCSN=sheatsn* RHOSN RHOnewCSN=sheatsn* RHOnewSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then - !-- some areas with large snow depth have unrealistically - !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. - !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys - else - !-- old version thdifsn = 0.265/RHOCSN - THDIFSN = 0.265_kind_phys/RHOCSN - endif + !-- old version thdifsn = 0.265/RHOCSN + THDIFSN = 0.265_kind_phys/RHOCSN else !-- 07Jun19 - thermal conductivity (K_eff) from Sturm et al.(1997) !-- keff = 10. ** (2.650 * RHOSN*1.e-3 - 1.652) fact = one if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is added by tgs based on 4 Jan 2017 testing + !-- fact is a tuning parameter !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys @@ -5252,9 +5230,10 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. + !-- Based on Sturm et al. keff=0.452 typical for hard snow slabs + !-- with rhosn=488 kg/m^3. Thdifsn = 0.452/(2090*488)=4.431718e-7 !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys + thdifsn = 4.431718e-7_kind_phys else thdifsn = keff/rhocsn * fact endif @@ -5802,23 +5781,15 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & RHOCSN=sheatsn* RHOSN if(isncond_opt == 1) then - if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then - !-- some areas with large snow depth have unrealistically - !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. - !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys - else - !-- old version thdifsn = 0.265/RHOCSN - THDIFSN = 0.265_kind_phys/RHOCSN - endif + !-- old version thdifsn = 0.265/RHOCSN + THDIFSN = 0.265_kind_phys/RHOCSN else !-- 07Jun19 - thermal conductivity (K_eff) from Sturm et al.(1997) !-- keff = 10. ** (2.650 * RHOSN*1.e-3 - 1.652) fact = one if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is added by tgs based on 4 Jan 2017 testing + !-- fact is a tuning parameter !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys @@ -5836,9 +5807,10 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then !-- some areas with large snow depth have unrealistically !-- low snow density (in the Rockie's with snow depth > 1 m). - !-- Based on Sturm et al. the 2.5e-6 is typical for hard snow slabs. + !-- Based on Sturm et al. keff=0.452 typical for hard snow slabs + !-- with rhosn=488 kg/m^3. Thdifsn = 0.452/(2090*488)=4.431718e-7 !-- In future a better compaction scheme is needed for these areas. - thdifsn = 2.5e-6_kind_phys + thdifsn = 4.431718e-7_kind_phys else thdifsn = keff/rhocsn * fact endif From 2fc4a64040e36f150af41890270112b1abc3200d Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 24 Oct 2023 22:11:54 +0000 Subject: [PATCH 058/249] Updates to bring out tuning parameters in C3 and SAS convection schemes --- physics/cu_c3_deep.F90 | 26 ++++++++++++++++++-------- physics/cu_c3_driver.F90 | 16 ++++++++++++---- physics/cu_c3_driver.meta | 23 +++++++++++++++++++++++ physics/cu_c3_sh.F90 | 23 ++++++++++++++--------- physics/progsigma_calc.f90 | 31 ++++++++++++++++++++----------- physics/samfdeepcnv.f | 19 +++++++++++-------- physics/samfdeepcnv.meta | 23 +++++++++++++++++++++++ physics/samfshalcnv.f | 19 +++++++++++-------- physics/samfshalcnv.meta | 23 +++++++++++++++++++++++ 9 files changed, 155 insertions(+), 48 deletions(-) diff --git a/physics/cu_c3_deep.F90 b/physics/cu_c3_deep.F90 index 7092840c3..7e907aaba 100644 --- a/physics/cu_c3_deep.F90 +++ b/physics/cu_c3_deep.F90 @@ -97,6 +97,9 @@ subroutine cu_c3_deep_run( & ,tmf & ! instantanious tendency from turbulence ,qmicro & ! instantanious tendency from microphysics ,forceqv_spechum & !instantanious tendency from dynamics + ,betascu & ! Tuning parameter for shallow clouds + ,betamcu & ! Tuning parameter for mid-level clouds + ,betadcu & ! Tuning parameter for deep clouds ,sigmain & ! input area fraction after advection ,sigmaout & ! updated prognostic area fraction ,z1 & ! terrain @@ -233,8 +236,8 @@ subroutine cu_c3_deep_run( & real(kind=kind_phys) & - ,intent (in ) :: & - dtime,ccnclean,fv,r_d + ,intent (in ) :: & + dtime,ccnclean,fv,r_d,betascu,betamcu,betadcu ! @@ -386,13 +389,16 @@ subroutine cu_c3_deep_run( & real(kind=kind_phys), dimension (its:ite) :: pefc real(kind=kind_phys) entdo,dp,subin,detdo,entup, & detup,subdown,entdoj,entupk,detupk,totmas + real(kind=kind_phys) :: & + sigmind,sigminm,sigmins + parameter(sigmind=0.005,sigmins=0.03,sigminm=0.01) real(kind=kind_phys), dimension (its:ite) :: lambau,flux_tun,zws,ztexec,zqexec !$acc declare create(lambau,flux_tun,zws,ztexec,zqexec) integer :: jprnt,jmini,start_k22 logical :: keep_going,flg(its:ite),cnvflg(its:ite) - logical :: flag_shallow + logical :: flag_shallow,flag_mid !$acc declare create(flg) @@ -1988,7 +1994,11 @@ subroutine cu_c3_deep_run( & ! equation 8, call progsigma_calc() to compute updraft area fraction based on a moisture budget if(progsigma)then + flag_mid = .false. flag_shallow = .false. + if(imid.eq.1)then + flag_mid = .true. + endif do k=kts,ktf do i=its,itf del(i,k) = delp(i,k)*0.001 @@ -2003,9 +2013,9 @@ subroutine cu_c3_deep_run( & endif enddo call progsigma_calc(itf,ktf,flag_init,flag_restart,flag_shallow, & - del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,xlv,dtime, & - forceqv_spechum,kbcon,ktop,cnvflg, & - sigmain,sigmaout,sigmab) + flag_mid,del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,xlv,dtime, & + forceqv_spechum,kbcon,ktop,cnvflg,betascu,betamcu,betadcu, & + sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab) endif !$acc end kernels @@ -3147,7 +3157,7 @@ subroutine cup_forcing_ens_3d(closure_n,xland,aa0,aa1,xaa0,mbdt,dtime,ierr,ierr2 ! pcrit,acrit,acritt integer, dimension (its:ite) :: kloc real(kind=kind_phys) :: & - a1,a_ave,xff0,xomg,gravinv!,aclim1,aclim2,aclim3,aclim4 + a1,a_ave,xff0,xomg,gravinv real(kind=kind_phys), dimension (its:ite) :: ens_adj !$acc declare create(kloc,ens_adj) @@ -5748,7 +5758,7 @@ subroutine calculate_updraft_velocity(its,itf,ktf,ite,kts,kte,ierr,progsigma, do k = 2, ktf-1 do i = 1, itf if (ierr(i)==0) then - if(k >= kbcon(i) .and. k < ktcon(i))then + if(k >= kbcon(i) .and. k < ktcon(i) .and. dbyo(i,k)>0.)then gamma = el2orc * qeso(i,k+1) / (to(i,k+1)**2) if(k >= kbcon(i) .and. clw_all(i,k)>0.)then buo(i,k) = buo(i,k) - g * qlk(i,k) diff --git a/physics/cu_c3_driver.F90 b/physics/cu_c3_driver.F90 index 8592e08f9..0ecb81750 100644 --- a/physics/cu_c3_driver.F90 +++ b/physics/cu_c3_driver.F90 @@ -60,7 +60,8 @@ end subroutine cu_c3_driver_init subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& do_ca,progsigma,cactiv,cactiv_m,g,cp,fv,r_d,xlv,r_v,forcet, & forceqv_spechum,phil,delp,raincv,tmf,qmicro,sigmain, & - qv_spechum,t,cld1d,us,vs,t2di,w,qv2di_spechum,p2di,psuri, & + betascu,betamcu,betadcu,qv_spechum,t,cld1d,us,vs,t2di,w, & + qv2di_spechum,p2di,psuri, & hbot,htop,kcnv,xland,hfx2,qfx2,aod_gf,cliw,clcw,ca_deep,rainevap,& pbl,ud_mf,dd_mf,dt_mf,cnvw_moist,cnvc,imfshalcnv, & flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & @@ -97,7 +98,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & do_ca,progsigma - real (kind=kind_phys), intent(in) :: g,cp,fv,r_d,xlv,r_v + real (kind=kind_phys), intent(in) :: g,cp,fv,r_d,xlv,r_v,betascu,betamcu,betadcu logical, intent(in ) :: ldiag3d real(kind=kind_phys), intent(inout) :: dtend(:,:,:) @@ -587,7 +588,7 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& hfx(i)=hfx2(i)*cp*rhoi(i,1) qfx(i)=qfx2(i)*xlv*rhoi(i,1) dx(i) = sqrt(garea(i)) - enddo + enddo do i=its,itf do k=kts,kpbli(i) @@ -669,7 +670,8 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& zus,xmbs,kbcons,ktops,k22s,ierrs,ierrcs, & ! Prog closure flag_init, flag_restart,fv,r_d,delp,tmfq,qmicro, & - forceqv_spechum,sigmain,sigmaout,progsigma,dx, & + forceqv_spechum,betascu,betamcu,betadcu,sigmain, & + sigmaout,progsigma,dx, & ! output tendencies outts,outqs,outqcs,outus,outvs,cnvwt,prets,cupclws, & ! dimesnional variables @@ -714,6 +716,9 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,tmfq & ,qmicro & ,forceqv_spechum & + ,betascu & + ,betamcu & + ,betadcu & ,sigmain & ,sigmaout & ,ter11 & @@ -805,6 +810,9 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,tmfq & ,qmicro & ,forceqv_spechum & + ,betascu & + ,betamcu & + ,betadcu & ,sigmain & ,sigmaout & ,ter11 & diff --git a/physics/cu_c3_driver.meta b/physics/cu_c3_driver.meta index 999b5c2bc..e02116243 100644 --- a/physics/cu_c3_driver.meta +++ b/physics/cu_c3_driver.meta @@ -244,6 +244,29 @@ type = real kind = kind_phys intent = out +[betascu] + standard_name = tuning_param_for_shallow_cu + long_name = tuning param for shallow cu in case prognostic closure is used + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[betamcu] + standard_name = tuning_param_for_midlevel_cu + long_name = tuning param for midlevel cu in case prognostic closure is used + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[betadcu] + standard_name = tuning_param_for_deep_cu + long_name = tuning param for deep cu in case prognostic closure is used + units = none + dimensions = () + type = real + intent = in [phil] standard_name = geopotential long_name = layer geopotential diff --git a/physics/cu_c3_sh.F90 b/physics/cu_c3_sh.F90 index a79e1dfcf..704f2a0fc 100644 --- a/physics/cu_c3_sh.F90 +++ b/physics/cu_c3_sh.F90 @@ -68,7 +68,8 @@ subroutine cu_c3_sh_run ( & hfx,qfx,xland,ichoice,tcrit,dtime, & zuo,xmb_out,kbcon,ktop,k22,ierr,ierrc, & flag_init, flag_restart,fv,r_d,delp,tmf,qmicro, & - forceqv_spechum,sigmain,sigmaout,progsigma,dx, & + forceqv_spechum,betascu,betamcu,betadcu,sigmain,& + sigmaout,progsigma,dx, & outt,outq,outqc,outu,outv,cnvwt,pre,cupclw, & ! output tendencies itf,ktf,its,ite, kts,kte,ipr,tropics) ! dimesnional variables ! @@ -131,7 +132,7 @@ subroutine cu_c3_sh_run ( & real(kind=kind_phys) & ,intent (in ) :: & - dtime,tcrit,fv,r_d + dtime,tcrit,fv,r_d,betascu,betamcu,betadcu !$acc declare sigmaout real(kind=kind_phys), dimension (its:,kts:) & ,intent (out) :: & @@ -234,15 +235,18 @@ subroutine cu_c3_sh_run ( & !$acc cap_max_increment,lambau, & !$acc kstabi,xland1,kbmax,ktopx) - logical :: flag_shallow + logical :: flag_shallow,flag_mid logical, dimension(its:ite) :: cnvflg integer :: & kstart,i,k,ki - real(kind=kind_phys) :: & + real(kind=kind_phys) :: & dz,mbdt,zkbmax, & cap_maxs,trash,trash2,frh,el2orc,gravinv - real(kind=kind_phys) buo_flux,pgeoh,dp,entup,detup,totmas + real(kind=kind_phys) buo_flux,pgeoh,dp,entup,detup,totmas + real(kind=kind_phys) :: & + sigmind,sigminm,sigmins + parameter(sigmind=0.005,sigmins=0.03,sigminm=0.01) real(kind=kind_phys) xff_shal(3),blqe,xkshal character*50 :: ierrc(its:) @@ -672,13 +676,13 @@ subroutine cu_c3_sh_run ( & dz=z_cup(i,k)-z_cup(i,k-1) ! cloud liquid water c1d(i,k)=c1_shal! 0. !.02*up_massdetr(i,k-1) + clw_all(i,k)=max(0.,qco(i,k)-trash) qrco(i,k)= (qco(i,k)-trash)/(1.+(c0_shal+c1d(i,k))*dz) if(qrco(i,k).lt.0.)then ! hli new test 02/12/19 qrco(i,k)=0. !c1d(i,k)=0. endif pwo(i,k)=c0_shal*dz*qrco(i,k)*zuo(i,k) - clw_all(i,k)=qco(i,k)-trash !LB total cloud before rain and detrain ! cloud water vapor qco (i,k)= trash+qrco(i,k) @@ -960,6 +964,7 @@ subroutine cu_c3_sh_run ( & ! equation 8, call progsigma_calc() to compute updraft area fraction based on a moisture budget if(progsigma)then flag_shallow = .true. + flag_mid = .false. do k=kts,ktf do i=its,itf del(i,k) = delp(i,k)*0.001 @@ -974,9 +979,9 @@ subroutine cu_c3_sh_run ( & endif enddo call progsigma_calc(itf,ktf,flag_init,flag_restart,flag_shallow, & - del,tmf,qmicro,dbyo,zdqca,omega_u,zeta,xlv,dtime, & - forceqv_spechum,kbcon,ktop,cnvflg, & - sigmain,sigmaout,sigmab) + flag_mid,del,tmf,qmicro,dbyo,zdqca,omega_u,zeta,xlv,dtime, & + forceqv_spechum,kbcon,ktop,cnvflg,betascu,betamcu,betadcu, & + sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab) endif diff --git a/physics/progsigma_calc.f90 b/physics/progsigma_calc.f90 index c87308602..469df49f6 100644 --- a/physics/progsigma_calc.f90 +++ b/physics/progsigma_calc.f90 @@ -19,10 +19,10 @@ module progsigma !! This subroutine computes a prognostic updraft area fracftion !! used in the closure computations in the samfshalcnv. scheme !!\section gen_progsigma progsigma_calc General Algorithm - subroutine progsigma_calc (im,km,flag_init,flag_restart, & - flag_shallow,del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap, & - delt,qadv,kbcon1,ktcon,cnvflg,sigmain,sigmaout, & - sigmab) + subroutine progsigma_calc (im,km,flag_init,flag_restart,flag_shallow,& + flag_mid,del,tmf,qmicro,dbyo1,zdqca,omega_u,zeta,hvap, & + delt,qadv,kbcon1,ktcon,cnvflg,betascu,betamcu,betadcu, & + sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab) ! ! use machine, only : kind_phys @@ -32,11 +32,12 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, & ! intent in integer, intent(in) :: im,km,kbcon1(im),ktcon(im) - real(kind=kind_phys), intent(in) :: hvap,delt + real(kind=kind_phys), intent(in) :: hvap,delt,betascu,betamcu,betadcu, & + sigmind,sigminm,sigmins real(kind=kind_phys), intent(in) :: qadv(im,km),del(im,km), & qmicro(im,km),tmf(im,km),dbyo1(im,km),zdqca(im,km), & omega_u(im,km),zeta(im,km) - logical, intent(in) :: flag_init,flag_restart,cnvflg(im),flag_shallow + logical, intent(in) :: flag_init,flag_restart,cnvflg(im),flag_shallow,flag_mid real(kind=kind_phys), intent(in) :: sigmain(im,km) ! intent out @@ -53,15 +54,13 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, & real(kind=kind_phys) :: gcvalmx,epsilon,ZZ,cvg,mcon,buy2, & fdqb,dtdyn,dxlim,rmulacvg,tem, & - DEN,betascu,betadcu,dp1,invdelt + DEN,dp1,invdelt !Parameters gcvalmx = 0.1 rmulacvg=10. epsilon=1.E-11 km1=km-1 - betadcu = 2.0 - betascu = 8.0 invdelt = 1./delt !Initialization 2D @@ -206,17 +205,27 @@ subroutine progsigma_calc (im,km,flag_init,flag_restart, & do i= 1, im if(cnvflg(i)) then sigmab(i)=sigmab(i)/betascu - sigmab(i)=MAX(0.03,sigmab(i)) + sigmab(i)=MAX(sigmins,sigmab(i)) + endif + enddo + elseif(flag_mid)then + do i= 1, im + if(cnvflg(i)) then + sigmab(i)=sigmab(i)/betamcu + sigmab(i)=MAX(sigminm,sigmab(i)) endif enddo else do i= 1, im if(cnvflg(i)) then sigmab(i)=sigmab(i)/betadcu - sigmab(i)=MAX(0.01,sigmab(i)) + sigmab(i)=MAX(sigmind,sigmab(i)) endif enddo endif + do i= 1, im + sigmab(i) = MIN(0.95,sigmab(i)) + enddo end subroutine progsigma_calc diff --git a/physics/samfdeepcnv.f b/physics/samfdeepcnv.f index 8a36fe34c..e8faecf14 100644 --- a/physics/samfdeepcnv.f +++ b/physics/samfdeepcnv.f @@ -83,7 +83,8 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & & CNV_DQLDT,CLCN,CNV_FICE,CNV_NDROP,CNV_NICE,mp_phys,mp_phys_mg,& & clam,c0s,c1,betal,betas,evef,pgcon,asolfac, & & do_ca, ca_closure, ca_entr, ca_trigger, nthresh,ca_deep, & - & rainevap,sigmain, sigmaout, errmsg,errflg) + & rainevap,sigmain,sigmaout,betadcu,betamcu,betascu, & + & errmsg,errflg) ! use machine , only : kind_phys use funcphys , only : fpvs @@ -100,14 +101,14 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & real(kind=kind_phys), dimension(:), intent(in) :: fscav logical, intent(in) :: first_time_step,restart,hwrf_samfdeep, & & progsigma - real(kind=kind_phys), intent(in) :: nthresh + 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), intent(out) :: rainevap(:) real(kind=kind_phys), intent(out) :: 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 real(kind=kind_phys), intent(inout) :: qtr(:,:,:), & @@ -213,8 +214,9 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & ! parameters for prognostic sigma closure real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km) - real(kind=kind_phys) gravinv,invdelt - logical flag_shallow + real(kind=kind_phys) gravinv,invdelt,sigmind,sigminm,sigmins + parameter(sigmind=0.01,sigmins=0.03,sigminm=0.01) + logical flag_shallow, flag_mid c physical parameters ! parameter(grav=grav,asolfac=0.958) ! parameter(elocp=hvap/cp,el2orc=hvap*hvap/(rv*cp)) @@ -2930,10 +2932,11 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & enddo flag_shallow = .false. + flag_mid = .false. call progsigma_calc(im,km,first_time_step,restart,flag_shallow, - & del,tmfq,qmicro,dbyo1,zdqca,omega_u,zeta,hvap,delt, - & qadv,kbcon1,ktcon,cnvflg, - & sigmain,sigmaout,sigmab) + & flag_mid,del,tmfq,qmicro,dbyo1,zdqca,omega_u,zeta,hvap, + & delt,qadv,kbcon1,ktcon,cnvflg,betascu,betamcu,betadcu, + & sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab) endif !> - From Han et al.'s (2017) \cite han_et_al_2017 equation 6, calculate cloud base mass flux as a function of the mean updraft velcoity for the grid sizes where the quasi-equilibrium assumption of Arakawa-Schubert is not valid any longer. diff --git a/physics/samfdeepcnv.meta b/physics/samfdeepcnv.meta index bed4d655d..d0d39d830 100644 --- a/physics/samfdeepcnv.meta +++ b/physics/samfdeepcnv.meta @@ -450,6 +450,29 @@ type = real kind = kind_phys intent = out +[betascu] + standard_name = tuning_param_for_shallow_cu + long_name = tuning param for shallow cu in case prognostic closure is used + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[betamcu] + standard_name = tuning_param_for_midlevel_cu + long_name = tuning param for midlevel cu in case prognostic closure is used + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[betadcu] + standard_name = tuning_param_for_deep_cu + long_name = tuning param for deep cu in case prognostic closure is used + units = none + dimensions = () + type = real + intent = in [qlcn] standard_name = mass_fraction_of_convective_cloud_liquid_water long_name = mass fraction of convective cloud liquid water diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index a7682342f..3869ea6ea 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -57,7 +57,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & & rn,kbot,ktop,kcnv,islimsk,garea, & & dot,ncloud,hpbl,ud_mf,dt_mf,cnvw,cnvc, & & clam,c0s,c1,evef,pgcon,asolfac,hwrf_samfshal, & - & sigmain,sigmaout,errmsg,errflg) + & sigmain,sigmaout,betadcu,betamcu,betascu,errmsg,errflg) ! use machine , only : kind_phys use funcphys , only : fpvs @@ -67,7 +67,8 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & integer, intent(in) :: im, km, itc, ntc, ntk, ntr, ncloud integer, intent(in) :: islimsk(:) real(kind=kind_phys), intent(in) :: cliq, cp, cvap, & - & eps, epsm1, fv, grav, hvap, rd, rv, t0c + & eps, epsm1, fv, grav, hvap, rd, rv, t0c, betascu, betadcu, & + & betamcu real(kind=kind_phys), intent(in) :: delt real(kind=kind_phys), intent(in) :: psp(:), delp(:,:), & & prslp(:,:), garea(:), hpbl(:), dot(:,:), phil(:,:), & @@ -159,8 +160,9 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), & omegac(im),zeta(im,km),dbyo1(im,km), & sigmab(im),qadv(im,km) - real(kind=kind_phys) gravinv,dxcrtas,invdelt - logical flag_shallow + real(kind=kind_phys) gravinv,dxcrtas,invdelt,sigmind,sigmins, + & sigminm + logical flag_shallow,flag_mid c physical parameters ! parameter(g=grav,asolfac=0.89) ! parameter(g=grav) @@ -194,7 +196,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & parameter(betaw=.03,dxcrtc0=9.e3) parameter(h1=0.33333333) ! progsigma - parameter(dxcrtas=30.e3) + parameter(dxcrtas=30.e3,sigmind=0.01,sigmins=0.03,sigminm=0.01) c local variables and arrays real(kind=kind_phys) pfld(im,km), to(im,km), qo(im,km), & uo(im,km), vo(im,km), qeso(im,km), @@ -1974,10 +1976,11 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & enddo flag_shallow = .true. + flag_mid = .false. call progsigma_calc(im,km,first_time_step,restart,flag_shallow, - & del,tmfq,qmicro,dbyo1,zdqca,omega_u,zeta,hvap,delt, - & qadv,kbcon1,ktcon,cnvflg, - & sigmain,sigmaout,sigmab) + & flag_mid,del,tmfq,qmicro,dbyo1,zdqca,omega_u,zeta,hvap, + & delt,qadv,kbcon1,ktcon,cnvflg,betascu,betamcu,betadcu, + & sigmind,sigminm,sigmins,sigmain,sigmaout,sigmab) endif !> - From Han et al.'s (2017) \cite han_et_al_2017 equation 6, calculate cloud base mass flux as a function of the mean updraft velcoity. diff --git a/physics/samfshalcnv.meta b/physics/samfshalcnv.meta index c1fffef58..200e33707 100644 --- a/physics/samfshalcnv.meta +++ b/physics/samfshalcnv.meta @@ -482,6 +482,29 @@ type = real kind = kind_phys intent = out +[betascu] + standard_name = tuning_param_for_shallow_cu + long_name = tuning param for shallow cu in case prognostic closure is used + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[betamcu] + standard_name = tuning_param_for_midlevel_cu + long_name = tuning param for midlevel cu in case prognostic closure is used + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[betadcu] + standard_name = tuning_param_for_deep_cu + long_name = tuning param for deep cu in case prognostic closure is used + units = none + dimensions = () + type = real + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 12b400a210854d33e64fd6d211482d9f8ab7add5 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Wed, 25 Oct 2023 21:30:26 +0000 Subject: [PATCH 059/249] Ensure prognostic closure is not used at coarse resolution --- physics/cu_c3_deep.F90 | 2 +- physics/cu_c3_driver.F90 | 16 ++++++++++++---- physics/cu_c3_driver.meta | 7 +++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/physics/cu_c3_deep.F90 b/physics/cu_c3_deep.F90 index 7e907aaba..b7cd5f62d 100644 --- a/physics/cu_c3_deep.F90 +++ b/physics/cu_c3_deep.F90 @@ -5758,7 +5758,7 @@ subroutine calculate_updraft_velocity(its,itf,ktf,ite,kts,kte,ierr,progsigma, do k = 2, ktf-1 do i = 1, itf if (ierr(i)==0) then - if(k >= kbcon(i) .and. k < ktcon(i) .and. dbyo(i,k)>0.)then + if(k >= kbcon(i) .and. k < ktcon(i))then gamma = el2orc * qeso(i,k+1) / (to(i,k+1)**2) if(k >= kbcon(i) .and. clw_all(i,k)>0.)then buo(i,k) = buo(i,k) - g * qlk(i,k) diff --git a/physics/cu_c3_driver.F90 b/physics/cu_c3_driver.F90 index 0ecb81750..5b6be1d6c 100644 --- a/physics/cu_c3_driver.F90 +++ b/physics/cu_c3_driver.F90 @@ -58,7 +58,7 @@ end subroutine cu_c3_driver_init !! !>\section gen_c3_driver Grell-Freitas Cumulus Scheme Driver General Algorithm subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& - do_ca,progsigma,cactiv,cactiv_m,g,cp,fv,r_d,xlv,r_v,forcet, & + do_ca,progsigma,cnx,cactiv,cactiv_m,g,cp,fv,r_d,xlv,r_v,forcet, & forceqv_spechum,phil,delp,raincv,tmf,qmicro,sigmain, & betascu,betamcu,betadcu,qv_spechum,t,cld1d,us,vs,t2di,w, & qv2di_spechum,p2di,psuri, & @@ -93,14 +93,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer :: ishallow_g3 ! depend on imfshalcnv !------------------------------------------------------------- integer :: its,ite, jts,jte, kts,kte - integer, intent(in ) :: im,km,ntracer + integer, intent(in ) :: im,km,ntracer,cnx integer, intent(in ) :: ichoice_in,ichoicem_in,ichoice_s_in logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & - do_ca,progsigma + do_ca real (kind=kind_phys), intent(in) :: g,cp,fv,r_d,xlv,r_v,betascu,betamcu,betadcu logical, intent(in ) :: ldiag3d - + logical, intent(inout) :: progsigma real(kind=kind_phys), intent(inout) :: dtend(:,:,:) !$acc declare copy(dtend) integer, intent(in) :: dtidx(:,:), & @@ -280,6 +280,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& !$acc end kernels endif + + if(progsigma)then + if(cnx < 384)then + progsigma=.false. + write(*,*)'Forcing prognostic closure to .false. due to coarse resolution' + endif + endif + if(ldiag3d) then if(flag_for_dcnv_generic_tend) then cliw_deep_idx=0 diff --git a/physics/cu_c3_driver.meta b/physics/cu_c3_driver.meta index e02116243..71a785318 100644 --- a/physics/cu_c3_driver.meta +++ b/physics/cu_c3_driver.meta @@ -133,6 +133,13 @@ units = flag dimensions = () type = logical + intent = inout +[cnx] + standard_name = number_of_x_points_for_current_cubed_sphere_tile + long_name = number of points in x direction for this cubed sphere face + units = count + dimensions = () + type = integer intent = in [cactiv] standard_name = counter_for_grell_freitas_convection From 454189320fb2b2105284836077b3b66a3dfc5f2e Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Wed, 25 Oct 2023 22:28:07 +0000 Subject: [PATCH 060/249] Further tweaks to improve the MYNN, will update the attached pdf. --- physics/module_bl_mynn.F90 | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index 18a385ba7..f520ae171 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -3868,6 +3868,14 @@ SUBROUTINE mym_condensation (kts,kte, & q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) q1(k) =max(q1_rh, q1(k) ) endif + !ensure adequate RH & q1 when qs is at least 1e-7 (above the PBLH) + if (qs(k)>1.e-7 .and. zagl .gt. pblh2) then + rh_hack =min(1.0, rhcrit + 0.08*(7.0 + log10(qs(k)))) + rh(k) =max(rh(k), rh_hack) + !add rh-based q1 + q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) + q1(k) =max(q1_rh, q1(k) ) + endif q1k = q1(k) ! backup Q1 for later modification @@ -5842,7 +5850,7 @@ SUBROUTINE DMP_mf( & real(kind_phys),dimension(kts:kte+1) :: envi_a,envi_w !environmental variables defined at model interface real(kind_phys):: temp,sublim,qc_ent,qv_ent,qt_ent,thl_ent,detrate, & detrateUV,oow,exc_fac,aratio,detturb,qc_grid,qc_sgs, & - qc_plume,exc_heat,exc_moist,tk_int + qc_plume,exc_heat,exc_moist,tk_int,tvs real(kind_phys), parameter :: Cdet = 1./45. real(kind_phys), parameter :: dzpmax = 300. !limit dz used in detrainment - can be excessing in thick layers !parameter "Csub" determines the propotion of upward vertical velocity that contributes to @@ -5967,16 +5975,17 @@ SUBROUTINE DMP_mf( & else hux = -0.005 ! LAND ! dT/dz must be < - 0.5 K per 100 m. endif + tvs = ts*(1.0+p608*qv(kts)) do k=1,max(1,k50-1) !use "-1" because k50 used interface heights (zw). if (k == 1) then - if ((th(k)-ts)/(0.5*dz(k)) < hux) then + if ((thv(k)-tvs)/(0.5*dz(k)) < hux) then superadiabatic = .true. else superadiabatic = .false. exit endif else - if ((th(k)-th(k-1))/(0.5*(dz(k)+dz(k-1))) < hux) then + if ((thv(k)-thv(k-1))/(0.5*(dz(k)+dz(k-1))) < hux) then superadiabatic = .true. else superadiabatic = .false. @@ -6052,10 +6061,14 @@ SUBROUTINE DMP_mf( & acfac = .5*tanh((fltv2 - 0.01)/0.03) + .5 endif !add a windspeed-dependent adjustment to acfac that tapers off - !the mass-flux scheme linearly above sfc wind speeds of 15 m/s. + !the mass-flux scheme linearly above sfc wind speeds of 10 m/s. !Note: this effect may be better represented by an increase in !entrainment rate for high wind consitions (more ambient turbulence). - ac_wsp = 1.0 - min(max(wspd_pbl - 15.0, 0.0), 10.0)/10.0 + if (wspd_pbl .le. 10.) then + ac_wsp = 1.0 + else + ac_wsp = 1.0 - min((wspd_pbl - 10.0)/15., 1.0) + endif acfac = acfac * ac_wsp ! Find the portion of the total fraction (Atot) of each plume size: @@ -6091,7 +6104,7 @@ SUBROUTINE DMP_mf( & else if ((landsea-1.5).GE.0) then !water: increase factor to compensate for decreased pwmin/pwmax - exc_fac = 0.58*4.0*min(cloud_base/1000., 1.0) + exc_fac = 0.58*4.0 else !land: no need to increase factor - already sufficiently large superadiabatic layers exc_fac = 0.58 From 6d079b8380e0948186e7019644fb38374d31c2fc Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Wed, 25 Oct 2023 20:53:05 -0600 Subject: [PATCH 061/249] Hail diagnostic --- physics/module_mp_thompson.F90 | 102 ++++++++++++------ ...mp_thompson_make_number_concentrations.F90 | 7 +- physics/mp_thompson.F90 | 4 + physics/mp_thompson.meta | 8 ++ 4 files changed, 86 insertions(+), 35 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 271db11d0..d2199bdc6 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -2464,17 +2464,17 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & !+---+-----------------------------------------------------------------+ !> - Calculate y-intercept, slope values for graupel. !+---+-----------------------------------------------------------------+ - do k = kte, kts, -1 - ygra1 = alog10(max(1.E-9, rg(k))) - zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 - N0_exp = 10.**(zans1) - N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) - lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 - lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg - ilamg(k) = 1./lamg - N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) - enddo - + ! do k = kte, kts, -1 + ! ygra1 = alog10(max(1.E-9, rg(k))) + ! zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 + ! N0_exp = 10.**(zans1) + ! N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) + ! lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 + ! lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg + ! ilamg(k) = 1./lamg + ! N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) + ! enddo + call graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) endif !+---+-----------------------------------------------------------------+ @@ -3541,17 +3541,17 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & !+---+-----------------------------------------------------------------+ !> - Calculate y-intercept, slope values for graupel. !+---+-----------------------------------------------------------------+ - do k = kte, kts, -1 - ygra1 = alog10(max(1.E-9, rg(k))) - zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 - N0_exp = 10.**(zans1) - N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) - lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 - lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg - ilamg(k) = 1./lamg - N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) - enddo - + ! do k = kte, kts, -1 + ! ygra1 = alog10(max(1.E-9, rg(k))) + ! zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 + ! N0_exp = 10.**(zans1) + ! N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) + ! lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 + ! lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg + ! ilamg(k) = 1./lamg + ! N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) + ! enddo + call graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) endif !+---+-----------------------------------------------------------------+ @@ -6085,16 +6085,17 @@ subroutine calc_refl10cm (qv1d, qc1d, qr1d, nr1d, qs1d, qg1d, & !+---+-----------------------------------------------------------------+ if (ANY(L_qg .eqv. .true.)) then - do k = kte, kts, -1 - ygra1 = alog10(max(1.E-9, rg(k))) - zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 - N0_exp = 10.**(zans1) - N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) - lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 - lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg - ilamg(k) = 1./lamg - N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) - enddo + ! do k = kte, kts, -1 + ! ygra1 = alog10(max(1.E-9, rg(k))) + ! zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 + ! N0_exp = 10.**(zans1) + ! N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) + ! lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 + ! lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg + ! ilamg(k) = 1./lamg + ! N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) + ! enddo + call graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) endif !+---+-----------------------------------------------------------------+ @@ -6471,6 +6472,43 @@ SUBROUTINE semi_lagrange_sedim(km,dzl,wwl,rql,precip,pfsan,dt,R1) END SUBROUTINE semi_lagrange_sedim +!>\ingroup aathompson +!! @brief Calculates graupel size distribution parameters +!! +!! Calculates graupel intercept and slope parameters for +!! for a vertical column +!! +!! @param[in] kts integer start index for vertical column +!! @param[in] kte integer end index for vertical column +!! @param[in] rand1 real random number for stochastic physics +!! @param[in] rg real array, size(kts:kte) for graupel mass concentration [kg m^3] +!! @param[out] ilamg double array, size(kts:kte) for inverse graupel slope parameter [m] +!! @param[out] N0_g double array, size(kts:kte) for graupel intercept paramter [m-4] +subroutine graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) + + implicit none + + integer, intent(in) :: kts, kte + real, intent(in) :: rand1 + real, intent(in) :: rg(:) + double precision, intent(out) :: ilamg(:), N0_g(:) + + integer :: k + real :: ygra1, zans1, N0_exp, lam_exp, lamg + + do k = kte, kts, -1 + ygra1 = alog10(max(1.e-9, rg(k))) + zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 + N0_exp = 10.**(zans1) + N0_exp = max1(dble(gonv_min), min(N0_exp, dble(gonv_max))) + lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 + lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg + ilamg(k) = 1./lamg + N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) + enddo + +end subroutine graupel_psd_parameters + !+---+-----------------------------------------------------------------+ !+---+-----------------------------------------------------------------+ END MODULE module_mp_thompson diff --git a/physics/module_mp_thompson_make_number_concentrations.F90 b/physics/module_mp_thompson_make_number_concentrations.F90 index 72a1055dd..496942f21 100644 --- a/physics/module_mp_thompson_make_number_concentrations.F90 +++ b/physics/module_mp_thompson_make_number_concentrations.F90 @@ -4,6 +4,7 @@ !>\ingroup aathompson module module_mp_thompson_make_number_concentrations + use machine, only : kind_phys use physcons, only: PI => con_pi implicit none @@ -35,7 +36,7 @@ elemental real function make_IceNumber (Q_ice, temp) !IMPLICIT NONE REAL, PARAMETER:: Ice_density = 890.0 !REAL, PARAMETER:: PI = 3.1415926536 - real, intent(in):: Q_ice, temp + real(kind_phys), intent(in):: Q_ice, temp integer idx_rei real corr, reice, deice double precision lambda @@ -134,7 +135,7 @@ elemental real function make_DropletNumber (Q_cloud, qnwfa) !IMPLICIT NONE - real, intent(in):: Q_cloud, qnwfa + real(kind_phys), intent(in):: Q_cloud, qnwfa !real, parameter:: PI = 3.1415926536 real, parameter:: am_r = PI*1000./6. @@ -173,7 +174,7 @@ elemental real function make_RainNumber (Q_rain, temp) IMPLICIT NONE - real, intent(in):: Q_rain, temp + real(kind_phys), intent(in):: Q_rain, temp double precision:: lambda, N0, qnr !real, parameter:: PI = 3.1415926536 real, parameter:: am_r = PI*1000./6. diff --git a/physics/mp_thompson.F90 b/physics/mp_thompson.F90 index c456e87cd..7b5b83b37 100644 --- a/physics/mp_thompson.F90 +++ b/physics/mp_thompson.F90 @@ -329,6 +329,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & first_time_step, istep, nsteps, & prcp, rain, graupel, ice, snow, sr, & refl_10cm, fullradar_diag, & + max_hail_diam_sfc, & do_radar_ref, aerfld, & mpicomm, mpirank, mpiroot, blkno, & ext_diag, diag3d, reset_diag3d, & @@ -387,6 +388,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & real(kind_phys), intent( out) :: sr(:) ! Radar reflectivity real(kind_phys), intent(inout) :: refl_10cm(:,:) + real(kind_phys), intent(inout) :: max_hail_diam_sfc(:) logical, intent(in ) :: do_radar_ref logical, intent(in) :: sedi_semi integer, intent(in) :: decfl @@ -698,6 +700,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & refl_10cm=refl_10cm, & diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & + max_hail_diam_sfc=max_hail_diam_sfc, & has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & aero_ind_fdb=aero_ind_fdb, rand_perturb_on=spp_mp_opt, & kme_stoch=kme_stoch, & @@ -738,6 +741,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & refl_10cm=refl_10cm, & diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & + max_hail_diam_sfc=max_hail_diam_sfc, & has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & rand_perturb_on=spp_mp_opt, kme_stoch=kme_stoch, & rand_pert=spp_wts_mp, spp_var_list=spp_var_list, & diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta index 5918e4dd9..293dd7625 100644 --- a/physics/mp_thompson.meta +++ b/physics/mp_thompson.meta @@ -610,6 +610,14 @@ type = real kind = kind_phys intent = out +[max_hail_diam_sfc] + standard_name = max_hail_diameter_sfc + long_name = instantaneous maximum hail diameter at lowest model level + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [fullradar_diag] standard_name = do_full_radar_reflectivity long_name = flag for computing full radar reflectivity From ed82327f21b75f0c57562f45c6bce8d3fc25d5f0 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Thu, 26 Oct 2023 10:01:51 -0600 Subject: [PATCH 062/249] Max hail diameter --- physics/module_mp_thompson.F90 | 46 +++++++++++++++++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index d2199bdc6..61c07ba29 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -993,6 +993,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & rainprod, evapprod, & #endif refl_10cm, diagflag, do_radar_ref, & + max_hail_diam_sfc, & vt_dbz_wt, first_time_step, & re_cloud, re_ice, re_snow, & has_reqc, has_reqi, has_reqs, & @@ -1062,6 +1063,8 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & GRAUPELNC, GRAUPELNCV REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: & refl_10cm + REAL, DIMENSION(ims:ime, jms:jme), INTENT(INOUT):: & + max_hail_diam_sfc REAL, DIMENSION(ims:ime, kms:kme, jms:jme), OPTIONAL, INTENT(INOUT):: & vt_dbz_wt LOGICAL, INTENT(IN) :: first_time_step @@ -1679,6 +1682,8 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & (nsteps>1 .and. istep==nsteps) .or. & (nsteps==1 .and. ndt==1)) THEN + max_hail_diam_sfc(i,j) = hail_mass_99th_percentile(kts, kte, qg1d, t1d, p1d) + !> - Call calc_refl10cm() diagflag_present: IF ( PRESENT (diagflag) ) THEN @@ -6496,7 +6501,7 @@ subroutine graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) integer :: k real :: ygra1, zans1, N0_exp, lam_exp, lamg - do k = kte, kts, -1 + do k = kte, kts, -1 ygra1 = alog10(max(1.e-9, rg(k))) zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 N0_exp = 10.**(zans1) @@ -6509,6 +6514,45 @@ subroutine graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) end subroutine graupel_psd_parameters +!>\ingroup aathompson +!! @brief Calculates graupel/hail maximum diameter +!! +!! Calculates graupel/hail maximum diameter (currently the 99th percentile of mass distribtuion) +!! for a vertical column +!! +!! @param[in] kts integer start index for vertical column +!! @param[in] kte integer end index for vertical column +!! @param[in] qg real array, size(kts:kte) for graupel mass mixing ratio [kg kg^-1] +!! @param[in] temperature double array, size(kts:kte) temperature [K] +!! @param[in] pressure double array, size(kts:kte) pressure [Pa] +!! @param[out] max_hail_diam real maximum hail diameter [m] +function hail_mass_99th_percentile(kts, kte, qg, temperature, pressure, qv) result(max_hail_diam) + + implicit none + + integer, intent(in) :: kts, kte + real, intent(in) :: qg(:), temperature(:), pressure(:), qv(:) + real, intent(out) :: max_hail_diam + + real :: rho(:), rg(:), max_hail_column + real, parameter :: random_number = 0. + + max_hail_column = 0. + rg = 0. + do k = kts, kte + rho(k) = 0.622*pressure(k)/(R*temperature(k)*(max(1.e-10, qv(k))+0.622)) + if (qg(k) .gt. R1) then + rg(k) = qg(k)*rho(k) + endif + enddo + + call graupel_psd_parameters(kts, kte, random_number, rg, ilamg, N0_g) + + where(rg .gt. 1.e-9) max_hail_column = 10.05 * ilamg + max_hail_diam = max_hail_column(kts) + +end function hail_mass_99th_percentile + !+---+-----------------------------------------------------------------+ !+---+-----------------------------------------------------------------+ END MODULE module_mp_thompson From f7edbc1db5595cf58370713a50abdd1ba3bd5eda Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 26 Oct 2023 16:49:24 +0000 Subject: [PATCH 063/249] More cleanup --- physics/CONV/C3/cu_c3_driver.meta | 3 +- physics/CONV/Grell_Freitas/cu_gf_driver.meta | 3 +- .../GFS_phys_time_vary.fv3.meta | 4 +- .../GFS_phys_time_vary.scm.meta | 4 +- .../GFS_surface_composites_post.meta | 2 +- .../GFS_surface_generic_pre.meta | 2 +- .../UFS_SCM_NEPTUNE/sgscloud_radpre.meta | 2 +- physics/MP/Morrison_Gettelman/m_micro.meta | 4 +- physics/NOTUSED/gfs_phy_tracer_config.F | 228 ------------------ physics/NOTUSED/gocart_tracer_config_stub.f | 17 -- physics/NOTUSED/rrtmg_lw_pre.F90 | 26 -- physics/NOTUSED/rrtmg_lw_pre.meta | 24 -- .../RRTMGP/rrtmgp_aerosol_optics.meta | 2 +- physics/Radiation/RRTMGP/rrtmgp_lw_main.meta | 2 +- physics/Radiation/RRTMGP/rrtmgp_sw_main.meta | 2 +- physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta | 5 +- .../GFDL/module_sf_exchcoef.f90 | 0 physics/SFC_Layer/MYJ/myjsfc_wrapper.meta | 2 +- physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta | 2 +- physics/SFC_Layer/UFS/sfc_diag.meta | 2 +- physics/SFC_Models/Lake/CLM/clm_lake.meta | 2 +- .../SFC_Models/Lake/Flake/flake_driver.meta | 2 +- physics/SFC_Models/Land/Noah/lsm_noah.meta | 2 +- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 3 +- physics/SFC_Models/Land/RUC/lsm_ruc.meta | 3 +- physics/SFC_Models/Ocean/UFS/sfc_ocean.meta | 2 +- physics/SFC_Models/SeaIce/CICE/sfc_cice.meta | 2 +- physics/SFC_Models/SeaIce/CICE/sfc_sice.meta | 2 +- physics/{h2o_photo => photochem}/h2o_def.f | 0 physics/{h2o_photo => photochem}/h2o_def.meta | 0 .../{h2o_photo => photochem}/h2ointerp.f90 | 0 physics/{h2o_photo => photochem}/h2ophys.f | 0 physics/{h2o_photo => photochem}/h2ophys.meta | 2 +- physics/{o3_photo => photochem}/ozinterp.f90 | 0 physics/{o3_photo => photochem}/ozne_def.f | 0 physics/{o3_photo => photochem}/ozne_def.meta | 0 physics/{o3_photo => photochem}/ozphys.f | 0 physics/{o3_photo => photochem}/ozphys.meta | 2 +- physics/{o3_photo => photochem}/ozphys_2015.f | 0 .../{o3_photo => photochem}/ozphys_2015.meta | 2 +- physics/smoke_dust/rrfs_smoke_postpbl.meta | 2 +- physics/smoke_dust/rrfs_smoke_wrapper.meta | 2 +- 42 files changed, 38 insertions(+), 326 deletions(-) delete mode 100644 physics/NOTUSED/gfs_phy_tracer_config.F delete mode 100644 physics/NOTUSED/gocart_tracer_config_stub.f delete mode 100644 physics/NOTUSED/rrtmg_lw_pre.F90 delete mode 100644 physics/NOTUSED/rrtmg_lw_pre.meta rename physics/{MP => SFC_Layer}/GFDL/module_sf_exchcoef.f90 (100%) rename physics/{h2o_photo => photochem}/h2o_def.f (100%) rename physics/{h2o_photo => photochem}/h2o_def.meta (100%) rename physics/{h2o_photo => photochem}/h2ointerp.f90 (100%) rename physics/{h2o_photo => photochem}/h2ophys.f (100%) rename physics/{h2o_photo => photochem}/h2ophys.meta (98%) rename physics/{o3_photo => photochem}/ozinterp.f90 (100%) rename physics/{o3_photo => photochem}/ozne_def.f (100%) rename physics/{o3_photo => photochem}/ozne_def.meta (100%) rename physics/{o3_photo => photochem}/ozphys.f (100%) rename physics/{o3_photo => photochem}/ozphys.meta (99%) rename physics/{o3_photo => photochem}/ozphys_2015.f (100%) rename physics/{o3_photo => photochem}/ozphys_2015.meta (99%) diff --git a/physics/CONV/C3/cu_c3_driver.meta b/physics/CONV/C3/cu_c3_driver.meta index bb2784642..da3ccc6dd 100644 --- a/physics/CONV/C3/cu_c3_driver.meta +++ b/physics/CONV/C3/cu_c3_driver.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = cu_c3_driver type = scheme - dependencies = cu_c3_deep.F90,cu_c3_sh.F90,../../hooks/machine.F,../../hooks/physcons.F90,../progsigma_calc.f90 + dependencies = ../../hooks/machine.F + dependencies = cu_c3_deep.F90,cu_c3_sh.F90,../progsigma_calc.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.meta b/physics/CONV/Grell_Freitas/cu_gf_driver.meta index db2973c0f..87add2809 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = cu_gf_driver type = scheme - dependencies = cu_gf_deep.F90,cu_gf_sh.F90,../../hooks/machine.F,../../hooks/physcons.F90 + dependencies = ../../hooks/machine.F + dependencies = cu_gf_deep.F90,cu_gf_sh.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta index 7df4cf715..8a35d469c 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta @@ -8,8 +8,8 @@ dependencies = Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 - dependencies = o3_photo/ozinterp.f90,o3_photo/ozne_def.f - dependencies = h2o_photo/h2o_def.f,h2o_photo/h2ointerp.f90 + dependencies = photochem/ozinterp.f90,photochem/ozne_def.f + dependencies = photochem/h2o_def.f,photochem/h2ointerp.f90 dependencies = GWD/cires_tauamf_data.F90 ######################################################################## diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta index e1de4d699..86c052b0e 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta @@ -7,8 +7,8 @@ dependencies = Interstitials/UFS_SCM_NEPTUNE/sfcsub.F,Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 - dependencies = o3_photo/ozinterp.f90,o3_photo/ozne_def.f - dependencies = h2o_photo/h2o_def.f,h2o_photo/h2ointerp.f90 + dependencies = photochem/ozinterp.f90,photochem/ozne_def.f + dependencies = photochem/h2o_def.f,photochem/h2ointerp.f90 dependencies = GWD/cires_tauamf_data.F90 ######################################################################## diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta index 35b54544a..7224d7221 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta @@ -3,7 +3,7 @@ name = GFS_surface_composites_post type = scheme relative_path = ../../ - dependencies = hooks/machine.F,SFC_Layer/GFS_sfc/sfc_diff.f + dependencies = hooks/machine.F,SFC_Layer/UFS/sfc_diff.f ######################################################################## [ccpp-arg-table] diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta index 63fb9b96c..bbf7dd5c3 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta @@ -2,7 +2,7 @@ name = GFS_surface_generic_pre type = scheme relative_path = ../../ - dependencies = hooks/machine.F,Land/Noah/surface_perturbation.F90 + dependencies = hooks/machine.F,SFC_Models/Land/Noah/surface_perturbation.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta index 9829e3538..a9635efa5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta @@ -2,7 +2,7 @@ name = sgscloud_radpre type = scheme relative_path = ../../ - dependencies = tools/funcphys.f90,hooks/machine.F,hooks/physcons.F90 + dependencies = tools/funcphys.f90,hooks/machine.F dependencies = hooks/physcons.F90,Radiation/RRTMG/radcons.f90 dependencies = Radiation/radiation_clouds.f,MP/Thompson/module_mp_thompson.F90 diff --git a/physics/MP/Morrison_Gettelman/m_micro.meta b/physics/MP/Morrison_Gettelman/m_micro.meta index 4b6df18c7..16efc5cc4 100644 --- a/physics/MP/Morrison_Gettelman/m_micro.meta +++ b/physics/MP/Morrison_Gettelman/m_micro.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = m_micro type = scheme - dependencies = ../../hooks/machine.F,../../hooks/physcons.F90,aer_cloud.F,aerclm_def.F,cldmacro.F,cldwat2m_micro.F,micro_mg_utils.F90,micro_mg2_0.F90,micro_mg3_0.F90,wv_saturation.F + dependencies = ../../hooks/machine.F,../../hooks/physcons.F90 + dependencies = aer_cloud.F,aerclm_def.F,cldmacro.F,cldwat2m_micro.F + dependencies = micro_mg_utils.F90,micro_mg2_0.F90,micro_mg3_0.F90,wv_saturation.F ######################################################################## [ccpp-arg-table] diff --git a/physics/NOTUSED/gfs_phy_tracer_config.F b/physics/NOTUSED/gfs_phy_tracer_config.F deleted file mode 100644 index 647919a23..000000000 --- a/physics/NOTUSED/gfs_phy_tracer_config.F +++ /dev/null @@ -1,228 +0,0 @@ - -! -!! ! Module: gfs_phy_tracer_config -! -! ! Description: gfs physics tracer configuration module -! -! ! Revision history: -! Oct 16 2009 Sarah Lu, adopted from dyn fc -! Nov 21 2009 Sarah Lu, chem tracer specified from ChemRegistry -! Dec 10 2009 Sarah Lu, add doing_GOCART -! Jan 12 2010 Sarah Lu, add trcindx -! Feb 08 2009 Sarah Lu, ri/cpi added to gfs_phy_tracer_type -! Aug 17 2010 Sarah Lu, remove debug print -! Oct 16 2010 Sarah Lu, add fscav -! Aug 08 2011 Jun Wang, remove gocart dependency when not running GOCART -! Sep 17 2011 Sarah Lu, revise chem tracer initialization -! Nov 11 2011 Sarah Lu, allocate but not assign value for cpi/ri array -! Apr 06 2012 Henry Juang, relax hardwire num_tracer, add tracer 4 and 5 -! Apr 23 2012 Jun Wang, remove save attibute for gfs_phy_tracer (already defined) -! --- -- 2016 Anning Cheng add ntiw,ntlnc,ntinc -! May 03 2016 S Moorthi add nto, nto2 -! ------------------------------------------------------------------------- -! - module gfs_phy_tracer_config - use machine , only : kind_phys - - implicit none - SAVE -! -! tracer specification: add fscav -! - type gfs_phy_tracer_type - character*20 , pointer :: chem_name(:) ! chem_tracer name - character*20 , pointer :: vname(:) ! variable name - real(kind=kind_phys), pointer :: ri(:) - real(kind=kind_phys), pointer :: cpi(:) - real(kind=kind_phys), pointer :: fscav(:) - integer :: ntrac, ntrac_met, ntrac_chem - logical :: doing_DU, doing_SU, doing_SS - &, doing_OC, doing_BC, doing_GOCART - endtype gfs_phy_tracer_type - - type (gfs_phy_tracer_type) :: gfs_phy_tracer -! -! misc tracer options -! - logical :: glbsum = .true. -! - -! --- public interface - public tracer_config_init, trcindx - - contains - -! ------------------------------------------------------------------- -! ------------------------------------------------------------------- -! subroutine tracer_config_init (gfs_phy_tracer,ntrac, - subroutine tracer_config_init (ntrac,ntoz,ntcw,ncld, - & ntiw,ntlnc,ntinc, - & fprcp,ntrw,ntsw,ntrnc,ntsnc, - & ntke,nto,nto2,me) - -c -c This subprogram sets up gfs_phy_tracer -c - implicit none -! input - integer, intent(in) :: me, ntoz,ntcw,ntke, - & ntiw,ntlnc,ntinc,nto,nto2, - & fprcp,ntrw,ntsw,ntrnc,ntsnc -! output -! type (gfs_phy_tracer_type), intent(out) :: gfs_phy_tracer -! input/output - integer, intent(inout) :: ntrac -! local - integer :: i, j, status, ierr - character*20 :: rgname - -! initialize ntrac_chem (the default is no chemistry) - gfs_phy_tracer%ntrac_chem = 0 - gfs_phy_tracer%doing_GOCART = .false. - -! initialize chem tracers - call gocart_tracer_config(me) - -! input ntrac is meteorological tracers - gfs_phy_tracer%ntrac_met = ntrac - -! update ntrac = total number of tracers - gfs_phy_tracer%ntrac = gfs_phy_tracer%ntrac_met + - & gfs_phy_tracer%ntrac_chem - ntrac = gfs_phy_tracer%ntrac - - if(me==0) then - print *, 'LU_TRCp: ntrac_met =',gfs_phy_tracer%ntrac_met - print *, 'LU_TRCp: ntrac_chem=',gfs_phy_tracer%ntrac_chem - print *, 'LU_TRCp: ntrac =',gfs_phy_tracer%ntrac - endif - -! Set up tracer name, cpi, and ri - if ( gfs_phy_tracer%ntrac > 0 ) then - allocate(gfs_phy_tracer%vname(ntrac), stat=status) - if( status /= 0 ) then - print *,'LU_TRC: alloc error - gfs_dyn_tracer :',status,me - return - endif - allocate(gfs_phy_tracer%ri(0:ntrac), stat=status) - if( status /= 0 ) then - print *,'LU_TRC: alloc error - gfs_dyn_tracer :',status,me - return - endif - allocate(gfs_phy_tracer%cpi(0:ntrac), stat=status) - if( status /= 0 ) then - print *,'LU_TRC: alloc error - gfs_dyn_tracer :',status,me - return - endif - allocate(gfs_phy_tracer%fscav(ntrac), stat=status) - if( status /= 0 ) then - print *,'LU_TRC: alloc error - gfs_dyn_tracer :',status,me - return - endif - -!--- fill in met tracers - gfs_phy_tracer%vname(1) = 'spfh' - if(ntcw > 0) gfs_phy_tracer%vname(ntcw) = 'clwmr' - if(ntiw > 0) gfs_phy_tracer%vname(ntiw) = 'climr' - if(ntlnc > 0) gfs_phy_tracer%vname(ntlnc) = 'lnc' - if(ntinc > 0) gfs_phy_tracer%vname(ntinc) = 'inc' - if(ntrw > 0) gfs_phy_tracer%vname(ntrw) = 'rnmr' - if(ntsw > 0) gfs_phy_tracer%vname(ntsw) = 'snwmr' - if(ntrnc > 0) gfs_phy_tracer%vname(ntrnc) = 'rnc' - if(ntsnc > 0) gfs_phy_tracer%vname(ntsnc) = 'snc' - if(ntke > 0) gfs_phy_tracer%vname(ntke) = 'tke' -#ifdef MULTI_GASES - print *,' ++++ ntoz nto nto2 ',ntoz,nto,nto2 - if(ntoz > 0) gfs_phy_tracer%vname(ntoz) = 'spo3' - if(nto > 0) gfs_phy_tracer%vname(nto) = 'spo' - if(nto2 > 0) gfs_phy_tracer%vname(nto2) = 'spo2' -#else - if(ntoz > 0) gfs_phy_tracer%vname(ntoz) = 'o3mr' - if(nto > 0) gfs_phy_tracer%vname(nto) = 'o' - if(nto2 > 0) gfs_phy_tracer%vname(nto2) = 'o2' -#endif - - - gfs_phy_tracer%fscav(1:gfs_phy_tracer%ntrac_met) = 0. - -!--- fill in chem tracers - if ( gfs_phy_tracer%ntrac_chem > 0 ) then - do i = 1,gfs_phy_tracer%ntrac_chem - j = i + gfs_phy_tracer%ntrac_met - rgname = trim(gfs_phy_tracer%chem_name(i)) - if(me==0)print *, 'LU_TRC_phy: vname=',j,rgname - gfs_phy_tracer%vname(j) = rgname - enddo - endif - - endif !! - - return - - end subroutine tracer_config_init -! ------------------------------------------------------------------- -! ------------------------------------------------------------------- - function trcindx( specname, tracer ) - implicit none - - character*(*), intent(in) :: specname - type (gfs_phy_tracer_type), intent(in) :: tracer - - character*10 :: name1, name2 - integer :: i, trcindx - -! -- set default value - trcindx = -999 - -! -- convert specname to upper case - call fixchar(specname, name1, 1) - do i = 1, tracer%ntrac - call fixchar(tracer%vname(i), name2, 1) - if( name1 == name2 ) then - trcindx = i - exit - endif - enddo - - return - end function trcindx - -! ------------------------------------------------------------------- - subroutine fixchar(name_in, name_out, option) - implicit none - - character*(*), intent(in) :: name_in - character*(*), intent(out) :: name_out - integer, intent(in) :: option - - character*10 :: temp - integer :: i, ic - - name_out= ' ' - temp = trim(adjustl(name_in)) - do i = 1, len_trim(temp) - ic = IACHAR(temp(i:i)) - if(option == 1 ) then !<--- convert to upper case - if(ic .ge. 97 .and. ic .le. 122) then - name_out(i:i) = CHAR( IC-32 ) - else - name_out(i:i) = temp(i:i) - endif - endif - if(option == 2 ) then !<--- convert to lower case - if(ic .ge. 65 .and. ic .le. 90) then - name_out(i:i) = CHAR( IC+32 ) - else - name_out(i:i) = temp(i:i) - endif - endif - - enddo - name_out = trim(name_out) - return - - end subroutine fixchar - -! ========================================================================= - - end module gfs_phy_tracer_config diff --git a/physics/NOTUSED/gocart_tracer_config_stub.f b/physics/NOTUSED/gocart_tracer_config_stub.f deleted file mode 100644 index d6df297c7..000000000 --- a/physics/NOTUSED/gocart_tracer_config_stub.f +++ /dev/null @@ -1,17 +0,0 @@ -! -!! ! Subroutine : gocart_tracer_config -! -! ! Description: stub for resetting gfs phys when gocart is running -! -! ! Revision history: -! Aug 09 2011 Jun Wang, initial code -! ------------------------------------------------------------------------- -! - subroutine gocart_tracer_config() -! - -! print *,'TRAC_CONFIG: gocart is not running.' - - return - - end subroutine gocart_tracer_config diff --git a/physics/NOTUSED/rrtmg_lw_pre.F90 b/physics/NOTUSED/rrtmg_lw_pre.F90 deleted file mode 100644 index 2b63d98c5..000000000 --- a/physics/NOTUSED/rrtmg_lw_pre.F90 +++ /dev/null @@ -1,26 +0,0 @@ -!>\file rrtmg_lw_pre.F90 -!! - module rrtmg_lw_pre - contains - -!>\defgroup rrtmg_lw_pre GFS RRTMG-LW scheme pre -!! This module contains RRTMG-LW pre module. -!> @{ -!> \section arg_table_rrtmg_lw_pre_run Argument Table -!! \htmlinclude rrtmg_lw_pre_run.html -!! - subroutine rrtmg_lw_pre_run (errmsg, errflg) - - implicit none - - character(len=*), intent( out) :: errmsg - integer, intent( out) :: errflg - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - end subroutine rrtmg_lw_pre_run - -!> @} - end module rrtmg_lw_pre diff --git a/physics/NOTUSED/rrtmg_lw_pre.meta b/physics/NOTUSED/rrtmg_lw_pre.meta deleted file mode 100644 index 9f6ec07c8..000000000 --- a/physics/NOTUSED/rrtmg_lw_pre.meta +++ /dev/null @@ -1,24 +0,0 @@ -[ccpp-table-properties] - name = rrtmg_lw_pre - type = scheme - dependencies = - -######################################################################## -[ccpp-arg-table] - name = rrtmg_lw_pre_run - type = scheme -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out diff --git a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta index 0847877d6..37ec2e9a0 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrtmgp_aerosol_optics type = scheme - dependencies = ../iounitdef.f,../../hooks/machine.F,../radiation_aerosols.f,../radiation_tools.F90 + dependencies = ../../hooks/machine.F,../radiation_aerosols.f,../radiation_tools.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta index 011376985..779389581 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta @@ -7,7 +7,7 @@ dependencies = rte-rrtmgp/rte/mo_source_functions.F90,rte-rrtmgp/rte/mo_rte_lw.F90,rte-rrtmgp/rte/mo_fluxes.F90 dependencies = rte-rrtmgp/rte/kernels/mo_fluxes_broadband_kernels.F90, rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90 dependencies = rrtmgp_lw_gas_optics.F90, rrtmgp_lw_cloud_optics.F90,rrtmgp_sampling.F90 - dependencies = ../../GFS/GFS_rrtmgp_pre.F90 + dependencies = ../../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta index 932e2195e..711d01bc1 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta @@ -7,7 +7,7 @@ dependencies = rte-rrtmgp/rte/mo_rte_sw.F90,rte-rrtmgp/rte/mo_fluxes.F90 dependencies = rte-rrtmgp/rte/kernels/mo_fluxes_broadband_kernels.F90, rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90 dependencies = rrtmgp_sw_gas_optics.F90, rrtmgp_sw_cloud_optics.F90,rrtmgp_sampling.F90 - dependencies = ../../GFS/GFS_rrtmgp_pre.F90 + dependencies = ../../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta b/physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta index b0d613eed..ac98437e9 100644 --- a/physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta +++ b/physics/SFC_Layer/GFDL/gfdl_sfc_layer.meta @@ -1,8 +1,9 @@ [ccpp-table-properties] name = gfdl_sfc_layer type = scheme - relative_path = ../../ - dependencies = hooks/machine.F,SFC_Layer/module_sf_exchcoef.f90,SFC_Models/Land/RUC/namelist_soilveg_ruc.F90,Land/Noahmp/noahmp_tables.f90 + dependencies = ../../hooks/machine.F,module_sf_exchcoef.f90 + dependencies = ../../SFC_Models/Land/RUC/namelist_soilveg_ruc.F90 + dependencies = ../../SFC_Models/Land/Noahmp/noahmp_tables.f90 ######################################################################## [ccpp-arg-table] diff --git a/physics/MP/GFDL/module_sf_exchcoef.f90 b/physics/SFC_Layer/GFDL/module_sf_exchcoef.f90 similarity index 100% rename from physics/MP/GFDL/module_sf_exchcoef.f90 rename to physics/SFC_Layer/GFDL/module_sf_exchcoef.f90 diff --git a/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta index 9805db619..0ae09985e 100644 --- a/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta +++ b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = myjsfc_wrapper type = scheme - dependencies = ../../hooks/machine.f,module_SF_JSFC.F90 + dependencies = ../../hooks/machine.F,module_SF_JSFC.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta index a76df3790..0e1c96c02 100644 --- a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta +++ b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = mynnsfc_wrapper type = scheme - dependencies = ../../hooks/machine.F,module_sf_mynn.F90 + dependencies = ../../hooks/machine.F,../../hooks/physcons.F90,module_sf_mynn.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Layer/UFS/sfc_diag.meta b/physics/SFC_Layer/UFS/sfc_diag.meta index 6a82c2c61..f4f83ab04 100644 --- a/physics/SFC_Layer/UFS/sfc_diag.meta +++ b/physics/SFC_Layer/UFS/sfc_diag.meta @@ -2,7 +2,7 @@ name = sfc_diag type = scheme relative_path = ../../ - dependencies = tools/funcphys.f90,hooks/machine.F + dependencies = tools/funcphys.f90,hooks/machine.F,hooks/physcons.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.meta b/physics/SFC_Models/Lake/CLM/clm_lake.meta index 3a519244a..a02aee9c6 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.meta +++ b/physics/SFC_Models/Lake/CLM/clm_lake.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = clm_lake type = scheme - dependencies = ../../hooks/machine.F + dependencies = ../../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/Lake/Flake/flake_driver.meta b/physics/SFC_Models/Lake/Flake/flake_driver.meta index 8b295bc27..22ab62d1e 100644 --- a/physics/SFC_Models/Lake/Flake/flake_driver.meta +++ b/physics/SFC_Models/Lake/Flake/flake_driver.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = flake_driver type = scheme - dependencies = ../../hooks/machine.F,flake.F90 + dependencies = ../../../hooks/machine.F,flake.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.meta b/physics/SFC_Models/Land/Noah/lsm_noah.meta index 2dc612d5b..07f4045a2 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.meta +++ b/physics/SFC_Models/Land/Noah/lsm_noah.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = lsm_noah type = scheme - dependencies = ../../tools/funcphys.f90,../../hooks/machine.F + dependencies = ../../../tools/funcphys.f90,../../../hooks/machine.F dependencies = ../set_soilveg.f,sflx.f,surface_perturbation.F90 ######################################################################## diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 55a787cd7..e7a73ef99 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = noahmpdrv type = scheme - dependencies = ../../tools/funcphys.f90,../../hooks/machine.F,module_sf_noahmp_glacier.F90,module_sf_noahmplsm.F90,noahmp_tables.f90,../set_soilveg.f + dependencies = ../../../tools/funcphys.f90,../../../hooks/machine.F + dependencies = module_sf_noahmp_glacier.F90,module_sf_noahmplsm.F90,noahmp_tables.f90,../set_soilveg.f ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/Land/RUC/lsm_ruc.meta b/physics/SFC_Models/Land/RUC/lsm_ruc.meta index f02d6de67..c05eb30e8 100644 --- a/physics/SFC_Models/Land/RUC/lsm_ruc.meta +++ b/physics/SFC_Models/Land/RUC/lsm_ruc.meta @@ -1,7 +1,8 @@ [ccpp-table-properties] name = lsm_ruc type = scheme - dependencies = ../../hooks/machine.F,module_sf_ruclsm.F90,module_soil_pre.F90,namelist_soilveg_ruc.F90,set_soilveg_ruc.F90 + dependencies = ../../../hooks/machine.F,../../../hooks/physcons.F90 + dependencies = module_sf_ruclsm.F90,module_soil_pre.F90,namelist_soilveg_ruc.F90,set_soilveg_ruc.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta index ea575a071..848c2e3ed 100644 --- a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta +++ b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sfc_ocean type = scheme - dependencies = ../../tools/funcphys.f90,../../hooks/machine.F + dependencies = ../../../tools/funcphys.f90,../../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta index 52fa28a3d..c44f9d6b5 100644 --- a/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta +++ b/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sfc_cice type = scheme - relative_path = ../../ + relative_path = ../../../ dependencies = hooks/machine.F ######################################################################## diff --git a/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta index 7277c0511..828a83939 100644 --- a/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta +++ b/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sfc_sice type = scheme - relative_path = ../../ + relative_path = ../../../ dependencies = tools/funcphys.f90,hooks/machine.F ######################################################################## diff --git a/physics/h2o_photo/h2o_def.f b/physics/photochem/h2o_def.f similarity index 100% rename from physics/h2o_photo/h2o_def.f rename to physics/photochem/h2o_def.f diff --git a/physics/h2o_photo/h2o_def.meta b/physics/photochem/h2o_def.meta similarity index 100% rename from physics/h2o_photo/h2o_def.meta rename to physics/photochem/h2o_def.meta diff --git a/physics/h2o_photo/h2ointerp.f90 b/physics/photochem/h2ointerp.f90 similarity index 100% rename from physics/h2o_photo/h2ointerp.f90 rename to physics/photochem/h2ointerp.f90 diff --git a/physics/h2o_photo/h2ophys.f b/physics/photochem/h2ophys.f similarity index 100% rename from physics/h2o_photo/h2ophys.f rename to physics/photochem/h2ophys.f diff --git a/physics/h2o_photo/h2ophys.meta b/physics/photochem/h2ophys.meta similarity index 98% rename from physics/h2o_photo/h2ophys.meta rename to physics/photochem/h2ophys.meta index d8a9eabab..9e9b03647 100644 --- a/physics/h2o_photo/h2ophys.meta +++ b/physics/photochem/h2ophys.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = h2ophys type = scheme - dependencies = ../../hooks/machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/o3_photo/ozinterp.f90 b/physics/photochem/ozinterp.f90 similarity index 100% rename from physics/o3_photo/ozinterp.f90 rename to physics/photochem/ozinterp.f90 diff --git a/physics/o3_photo/ozne_def.f b/physics/photochem/ozne_def.f similarity index 100% rename from physics/o3_photo/ozne_def.f rename to physics/photochem/ozne_def.f diff --git a/physics/o3_photo/ozne_def.meta b/physics/photochem/ozne_def.meta similarity index 100% rename from physics/o3_photo/ozne_def.meta rename to physics/photochem/ozne_def.meta diff --git a/physics/o3_photo/ozphys.f b/physics/photochem/ozphys.f similarity index 100% rename from physics/o3_photo/ozphys.f rename to physics/photochem/ozphys.f diff --git a/physics/o3_photo/ozphys.meta b/physics/photochem/ozphys.meta similarity index 99% rename from physics/o3_photo/ozphys.meta rename to physics/photochem/ozphys.meta index 631dcb332..a1f7e4eb2 100644 --- a/physics/o3_photo/ozphys.meta +++ b/physics/photochem/ozphys.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ozphys type = scheme - dependencies = ../../hooks/machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/o3_photo/ozphys_2015.f b/physics/photochem/ozphys_2015.f similarity index 100% rename from physics/o3_photo/ozphys_2015.f rename to physics/photochem/ozphys_2015.f diff --git a/physics/o3_photo/ozphys_2015.meta b/physics/photochem/ozphys_2015.meta similarity index 99% rename from physics/o3_photo/ozphys_2015.meta rename to physics/photochem/ozphys_2015.meta index 7da8cdf27..632dbc340 100644 --- a/physics/o3_photo/ozphys_2015.meta +++ b/physics/photochem/ozphys_2015.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = ozphys_2015 type = scheme - dependencies = ../../hooks/machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.meta b/physics/smoke_dust/rrfs_smoke_postpbl.meta index 339f6ca03..e65d182d3 100755 --- a/physics/smoke_dust/rrfs_smoke_postpbl.meta +++ b/physics/smoke_dust/rrfs_smoke_postpbl.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_postpbl type = scheme - dependencies = machine.F + dependencies = ../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index b084cdd66..b079b12c9 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_wrapper type = scheme - dependencies = machine.F,dep_dry_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90 + dependencies = ../hooks/machine.F,dep_dry_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90 ######################################################################## [ccpp-arg-table] From 81563de9686260bc5f1c85fe350d48e56fdf7afc Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 26 Oct 2023 19:17:33 +0000 Subject: [PATCH 064/249] move setting of flag from run to init phase --- physics/cu_c3_driver.F90 | 26 ++++++++++++++------------ physics/cu_c3_driver.meta | 21 ++++++++++++++------- 2 files changed, 28 insertions(+), 19 deletions(-) diff --git a/physics/cu_c3_driver.F90 b/physics/cu_c3_driver.F90 index 5b6be1d6c..c911ff5e4 100644 --- a/physics/cu_c3_driver.F90 +++ b/physics/cu_c3_driver.F90 @@ -30,7 +30,8 @@ module cu_c3_driver !! \htmlinclude cu_c3_driver_init.html !! subroutine cu_c3_driver_init(imfshalcnv, imfshalcnv_c3, imfdeepcnv, & - imfdeepcnv_c3,mpirank, mpiroot, errmsg, errflg) + imfdeepcnv_c3,progsigma, cnx, mpirank, mpiroot, & + errmsg, errflg) implicit none @@ -38,6 +39,8 @@ subroutine cu_c3_driver_init(imfshalcnv, imfshalcnv_c3, imfdeepcnv, & integer, intent(in) :: imfdeepcnv, imfdeepcnv_c3 integer, intent(in) :: mpirank integer, intent(in) :: mpiroot + integer, intent(in) :: cnx + logical, intent(inout) :: progsigma character(len=*), intent( out) :: errmsg integer, intent( out) :: errflg @@ -45,6 +48,13 @@ subroutine cu_c3_driver_init(imfshalcnv, imfshalcnv_c3, imfdeepcnv, & errmsg = '' errflg = 0 + if(progsigma)then + if(cnx < 384)then + progsigma=.false. + write(*,*)'Forcing prognostic closure to .false. due to coarse resolution' + endif + endif + end subroutine cu_c3_driver_init ! @@ -58,7 +68,7 @@ end subroutine cu_c3_driver_init !! !>\section gen_c3_driver Grell-Freitas Cumulus Scheme Driver General Algorithm subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& - do_ca,progsigma,cnx,cactiv,cactiv_m,g,cp,fv,r_d,xlv,r_v,forcet, & + do_ca,progsigma,cactiv,cactiv_m,g,cp,fv,r_d,xlv,r_v,forcet, & forceqv_spechum,phil,delp,raincv,tmf,qmicro,sigmain, & betascu,betamcu,betadcu,qv_spechum,t,cld1d,us,vs,t2di,w, & qv2di_spechum,p2di,psuri, & @@ -93,14 +103,14 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer :: ishallow_g3 ! depend on imfshalcnv !------------------------------------------------------------- integer :: its,ite, jts,jte, kts,kte - integer, intent(in ) :: im,km,ntracer,cnx + integer, intent(in ) :: im,km,ntracer integer, intent(in ) :: ichoice_in,ichoicem_in,ichoice_s_in logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend, & do_ca real (kind=kind_phys), intent(in) :: g,cp,fv,r_d,xlv,r_v,betascu,betamcu,betadcu logical, intent(in ) :: ldiag3d - logical, intent(inout) :: progsigma + logical, intent(in ) :: progsigma real(kind=kind_phys), intent(inout) :: dtend(:,:,:) !$acc declare copy(dtend) integer, intent(in) :: dtidx(:,:), & @@ -280,14 +290,6 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& !$acc end kernels endif - - if(progsigma)then - if(cnx < 384)then - progsigma=.false. - write(*,*)'Forcing prognostic closure to .false. due to coarse resolution' - endif - endif - if(ldiag3d) then if(flag_for_dcnv_generic_tend) then cliw_deep_idx=0 diff --git a/physics/cu_c3_driver.meta b/physics/cu_c3_driver.meta index 71a785318..801b1e9d7 100644 --- a/physics/cu_c3_driver.meta +++ b/physics/cu_c3_driver.meta @@ -49,6 +49,20 @@ dimensions = () type = integer intent = in +[progsigma] + standard_name = do_prognostic_updraft_area_fraction + long_name = flag for prognostic sigma in cumuls scheme + units = flag + dimensions = () + type = logical + intent = inout +[cnx] + standard_name = number_of_x_points_for_current_cubed_sphere_tile + long_name = number of points in x direction for this cubed sphere face + units = count + dimensions = () + type = integer + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -133,13 +147,6 @@ units = flag dimensions = () type = logical - intent = inout -[cnx] - standard_name = number_of_x_points_for_current_cubed_sphere_tile - long_name = number of points in x direction for this cubed sphere face - units = count - dimensions = () - type = integer intent = in [cactiv] standard_name = counter_for_grell_freitas_convection From e861277c1ffe8fdcb1b026240f98077bb7a91473 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Thu, 26 Oct 2023 21:10:37 +0000 Subject: [PATCH 065/249] address review comments --- physics/cu_c3_sh.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/cu_c3_sh.F90 b/physics/cu_c3_sh.F90 index 704f2a0fc..736292092 100644 --- a/physics/cu_c3_sh.F90 +++ b/physics/cu_c3_sh.F90 @@ -676,7 +676,7 @@ subroutine cu_c3_sh_run ( & dz=z_cup(i,k)-z_cup(i,k-1) ! cloud liquid water c1d(i,k)=c1_shal! 0. !.02*up_massdetr(i,k-1) - clw_all(i,k)=max(0.,qco(i,k)-trash) + clw_all(i,k)=max(0._kind_phys,qco(i,k)-trash) qrco(i,k)= (qco(i,k)-trash)/(1.+(c0_shal+c1d(i,k))*dz) if(qrco(i,k).lt.0.)then ! hli new test 02/12/19 qrco(i,k)=0. From 1000af768a289c9a139f92a7d50c7a56bd2de5c9 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 27 Oct 2023 18:21:27 +0000 Subject: [PATCH 066/249] Fixes after debug --- physics/module_mp_thompson.F90 | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 61c07ba29..9f81bb3f3 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -1682,7 +1682,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & (nsteps>1 .and. istep==nsteps) .or. & (nsteps==1 .and. ndt==1)) THEN - max_hail_diam_sfc(i,j) = hail_mass_99th_percentile(kts, kte, qg1d, t1d, p1d) + max_hail_diam_sfc(i,j) = hail_mass_99th_percentile(kts, kte, qg1d, t1d, p1d, qv1d) !> - Call calc_refl10cm() @@ -6525,6 +6525,7 @@ end subroutine graupel_psd_parameters !! @param[in] qg real array, size(kts:kte) for graupel mass mixing ratio [kg kg^-1] !! @param[in] temperature double array, size(kts:kte) temperature [K] !! @param[in] pressure double array, size(kts:kte) pressure [Pa] +!! @param[in] qv real array, size(kts:kte) water vapor mixing ratio [kg kg^-1] !! @param[out] max_hail_diam real maximum hail diameter [m] function hail_mass_99th_percentile(kts, kte, qg, temperature, pressure, qv) result(max_hail_diam) @@ -6532,9 +6533,11 @@ function hail_mass_99th_percentile(kts, kte, qg, temperature, pressure, qv) resu integer, intent(in) :: kts, kte real, intent(in) :: qg(:), temperature(:), pressure(:), qv(:) - real, intent(out) :: max_hail_diam + real :: max_hail_diam - real :: rho(:), rg(:), max_hail_column + integer :: k + real :: rho(kts:kte), rg(kts:kte), max_hail_column(kts:kte) + double precision :: ilamg(kts:kte), N0_g(kts:kte) real, parameter :: random_number = 0. max_hail_column = 0. From ddf6a5ca1a740f79cd8c58f8ecf84d47f0f4905d Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 27 Oct 2023 18:29:56 +0000 Subject: [PATCH 067/249] real to double for graupel psd parameters --- physics/module_mp_thompson.F90 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 9f81bb3f3..211a044c9 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -6499,7 +6499,8 @@ subroutine graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) double precision, intent(out) :: ilamg(:), N0_g(:) integer :: k - real :: ygra1, zans1, N0_exp, lam_exp, lamg + real :: ygra1, zans1 + double precision :: N0_exp, lam_exp, lamg do k = kte, kts, -1 ygra1 = alog10(max(1.e-9, rg(k))) From dbfd4e639334271831b1c260fdceb116a93d8bf6 Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Fri, 27 Oct 2023 23:06:11 +0000 Subject: [PATCH 068/249] Updating snow cloud fractions in MYNN-EDMF and removing redundant logic in sgscloud_radpre.F90 --- physics/module_bl_mynn.F90 | 26 ++++++++++++++------------ physics/mynnedmf_wrapper.F90 | 28 +++++++++++++++------------- physics/sgscloud_radpre.F90 | 6 +++--- 3 files changed, 32 insertions(+), 28 deletions(-) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index f520ae171..a2ba17c65 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -519,7 +519,7 @@ SUBROUTINE mynn_bl_driver( & real(kind_phys), dimension(kts:kte) :: & &thl,tl,qv1,qc1,qi1,qs1,sqw, & &el, dfm, dfh, dfq, tcd, qcd, pdk, pdt, pdq, pdc, & - &vt, vq, sgm + &vt, vq, sgm, kzero real(kind_phys), dimension(kts:kte) :: & &thetav,sh,sm,u1,v1,w1,p1, & &ex1,dz1,th1,tk1,rho1,qke1,tsq1,qsq1,cov1, & @@ -635,6 +635,7 @@ SUBROUTINE mynn_bl_driver( & maxwidth(its:ite)=0. maxmf(its:ite)=0. maxKHtopdown(its:ite)=0. + kzero(kts:kte)=0. ! DH* CHECK HOW MUCH OF THIS INIT IF-BLOCK IS ACTUALLY NEEDED FOR RESTARTS !> - Within the MYNN-EDMF, there is a dependecy check for the first time step, @@ -743,7 +744,7 @@ SUBROUTINE mynn_bl_driver( & !keep snow out for now - increases ceiling bias sqw(k)=sqv(k)+sqc(k)+sqi(k)!+sqs(k) thl(k)=th1(k) - xlvcp/ex1(k)*sqc(k) & - & - xlscp/ex1(k)*(sqi(k)+sqs(k)) + & - xlscp/ex1(k)*(sqi(k))!+sqs(k)) !Use form from Tripoli and Cotton (1981) with their !suggested min temperature to improve accuracy. !thl(k)=th(i,k)*(1.- xlvcp/MAX(tk1(k),TKmin)*sqc(k) & @@ -990,10 +991,10 @@ SUBROUTINE mynn_bl_driver( & else zw(k)=zw(k-1)+dz(i,k-1) endif - !keep snow out for now - increases ceiling bias + !keep snow out for now - increases ceiling bias sqw(k)= sqv(k)+sqc(k)+sqi(k)!+sqs(k) thl(k)= th1(k) - xlvcp/ex1(k)*sqc(k) & - & - xlscp/ex1(k)*(sqi(k)+sqs(k)) + & - xlscp/ex1(k)*(sqi(k))!+sqs(k)) !Use form from Tripoli and Cotton (1981) with their !suggested min temperature to improve accuracy. !thl(k)=th(i,k)*(1.- xlvcp/MAX(tk1(k),TKmin)*sqc(k) & @@ -1223,9 +1224,9 @@ SUBROUTINE mynn_bl_driver( & call mynn_tendencies(kts,kte,i, & &delt, dz1, rho1, & &u1, v1, th1, tk1, qv1, & - &qc1, qi1, qs1, qnc1, qni1, & + &qc1, qi1, kzero, qnc1, qni1, & !kzero replaces qs1 - not mixing snow &ps(i), p1, ex1, thl, & - &sqv, sqc, sqi, sqs, sqw, & + &sqv, sqc, sqi, kzero, sqw, & !kzero replaces sqs - not mixing snow &qnwfa1, qnifa1, qnbca1, ozone1, & &ust(i),flt,flq,flqv,flqc, & &wspd(i),uoce(i),voce(i), & @@ -3850,11 +3851,11 @@ SUBROUTINE mym_condensation (kts,kte, & q1(k) = qmq / sgm(k) ! Q1, the normalized saturation !Add condition for falling/settling into low-RH layers, so at least - !some cloud fraction is applied for all qc and qi. + !some cloud fraction is applied for all qc, qs, and qi. rh_hack= rh(k) !ensure adequate RH & q1 when qi is at least 1e-9 if (qi(k)>1.e-9) then - rh_hack =min(1.0, rhcrit + 0.06*(9.0 + log10(qi(k)))) + rh_hack =min(1.0, rhcrit + 0.07*(9.0 + log10(qi(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) @@ -3869,8 +3870,8 @@ SUBROUTINE mym_condensation (kts,kte, & q1(k) =max(q1_rh, q1(k) ) endif !ensure adequate RH & q1 when qs is at least 1e-7 (above the PBLH) - if (qs(k)>1.e-7 .and. zagl .gt. pblh2) then - rh_hack =min(1.0, rhcrit + 0.08*(7.0 + log10(qs(k)))) + if (qs(k)>1.e-8 .and. zagl .gt. pblh2) then + rh_hack =min(1.0, rhcrit + 0.07*(8.0 + log10(qs(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) @@ -4614,7 +4615,8 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & !============================================ ! MIX SNOW ( sqs ) !============================================ -IF (bl_mynn_cloudmix > 0 .AND. FLAG_QS) THEN +!hard-code to not mix snow +IF (bl_mynn_cloudmix > 0 .AND. .false.) THEN k=kts !rho-weighted: @@ -4981,7 +4983,7 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & !=================== ! CLOUD SNOW TENDENCY !=================== - IF (FLAG_QS) THEN + IF (.false.) THEN !disabled DO k=kts,kte Dqs(k)=(sqs2(k)/(1.-sqs2(k)) - qs(k))/delt ENDDO diff --git a/physics/mynnedmf_wrapper.F90 b/physics/mynnedmf_wrapper.F90 index 46db1c441..487753027 100644 --- a/physics/mynnedmf_wrapper.F90 +++ b/physics/mynnedmf_wrapper.F90 @@ -326,6 +326,7 @@ SUBROUTINE mynnedmf_wrapper_run( & integer :: idtend real(kind_phys), dimension(im) :: dusfci1,dvsfci1,dtsfci1,dqsfci1 real(kind_phys), allocatable :: save_qke_adv(:,:) + real(kind_phys), dimension(levs) :: kzero ! Initialize CCPP error handling variables errmsg = '' @@ -356,6 +357,7 @@ SUBROUTINE mynnedmf_wrapper_run( & !print*,"in MYNN, initflag=",initflag endif + kzero = zero !generic zero array !initialize arrays for test EMIS_ANT_NO = 0. @@ -392,7 +394,7 @@ SUBROUTINE mynnedmf_wrapper_run( & FLAG_QNI= .true. FLAG_QC = .true. FLAG_QNC= .true. - FLAG_QS = .false. !.true. + FLAG_QS = .true. FLAG_QNWFA= nssl_ccn_on ! ERM: Perhaps could use this field for CCN field? FLAG_QNIFA= .false. FLAG_QNBCA= .false. @@ -401,7 +403,7 @@ SUBROUTINE mynnedmf_wrapper_run( & sqv(i,k) = qgrs_water_vapor(i,k) sqc(i,k) = qgrs_liquid_cloud(i,k) sqi(i,k) = qgrs_ice(i,k) - sqs(i,k) = 0.0 !qgrs_snow(i,k) + sqs(i,k) = qgrs_snow(i,k) ozone(i,k) = qgrs_ozone(i,k) qnc(i,k) = qgrs_cloud_droplet_num_conc(i,k) qni(i,k) = qgrs_cloud_ice_num_conc(i,k) @@ -419,7 +421,7 @@ SUBROUTINE mynnedmf_wrapper_run( & FLAG_QI = .true. FLAG_QNI= .true. FLAG_QC = .true. - FLAG_QS = .false. + FLAG_QS = .true. !pipe it in, but do not mix FLAG_QNC= .true. FLAG_QNWFA= .true. FLAG_QNIFA= .true. @@ -429,7 +431,7 @@ SUBROUTINE mynnedmf_wrapper_run( & sqv(i,k) = qgrs_water_vapor(i,k) sqc(i,k) = qgrs_liquid_cloud(i,k) sqi(i,k) = qgrs_ice(i,k) - sqs(i,k) = 0. !qgrs_snow(i,k) + sqs(i,k) = qgrs_snow(i,k) qnc(i,k) = qgrs_cloud_droplet_num_conc(i,k) qni(i,k) = qgrs_cloud_ice_num_conc(i,k) ozone(i,k) = qgrs_ozone(i,k) @@ -442,7 +444,7 @@ SUBROUTINE mynnedmf_wrapper_run( & FLAG_QI = .true. FLAG_QNI= .true. FLAG_QC = .true. - FLAG_QS = .false. + FLAG_QS = .true. FLAG_QNC= .true. FLAG_QNWFA= .false. FLAG_QNIFA= .false. @@ -452,7 +454,7 @@ SUBROUTINE mynnedmf_wrapper_run( & sqv(i,k) = qgrs_water_vapor(i,k) sqc(i,k) = qgrs_liquid_cloud(i,k) sqi(i,k) = qgrs_ice(i,k) - sqs(i,k) = 0. !qgrs_snow(i,k) + sqs(i,k) = qgrs_snow(i,k) qnc(i,k) = qgrs_cloud_droplet_num_conc(i,k) qni(i,k) = qgrs_cloud_ice_num_conc(i,k) ozone(i,k) = qgrs_ozone(i,k) @@ -465,7 +467,7 @@ SUBROUTINE mynnedmf_wrapper_run( & FLAG_QI = .true. FLAG_QNI= .true. FLAG_QC = .true. - FLAG_QS = .false. + FLAG_QS = .true. FLAG_QNC= .false. FLAG_QNWFA= .false. FLAG_QNIFA= .false. @@ -475,7 +477,7 @@ SUBROUTINE mynnedmf_wrapper_run( & sqv(i,k) = qgrs_water_vapor(i,k) sqc(i,k) = qgrs_liquid_cloud(i,k) sqi(i,k) = qgrs_ice(i,k) - sqs(i,k) = 0. !qgrs_snow(i,k) + sqs(i,k) = qgrs_snow(i,k) qnc(i,k) = 0. qni(i,k) = qgrs_cloud_ice_num_conc(i,k) ozone(i,k) = qgrs_ozone(i,k) @@ -566,7 +568,7 @@ SUBROUTINE mynnedmf_wrapper_run( & call moisture_check2(levs, delt, & delp(i,:), exner(i,:), & sqv(i,:), sqc(i,:), & - sqi(i,:), sqs(i,:), & + sqi(i,:), kzero(:), & t3d(i,:) ) enddo @@ -835,7 +837,7 @@ SUBROUTINE mynnedmf_wrapper_run( & dqdt_cloud_droplet_num_conc(i,k) = RQNCBLTEN(i,k) dqdt_ice(i,k) = RQIBLTEN(i,k) !/(1.0 + qv(i,k)) dqdt_ice_num_conc(i,k) = RQNIBLTEN(i,k) - dqdt_snow(i,k) = 0.0 !RQSBLTEN(i,k) !/(1.0 + qv(i,k)) + dqdt_snow(i,k) = RQSBLTEN(i,k) !/(1.0 + qv(i,k)) !dqdt_ozone(i,k) = 0.0 dqdt_water_aer_num_conc(i,k) = RQNWFABLTEN(i,k) dqdt_ice_aer_num_conc(i,k) = RQNIFABLTEN(i,k) @@ -870,7 +872,7 @@ SUBROUTINE mynnedmf_wrapper_run( & dqdt_cloud_droplet_num_conc(i,k) = RQNCBLTEN(i,k) dqdt_ice(i,k) = RQIBLTEN(i,k) !/(1.0 + qv(i,k)) dqdt_ice_num_conc(i,k) = RQNIBLTEN(i,k) - dqdt_snow(i,k) = 0.0 !RQSBLTEN(i,k) !/(1.0 + qv(i,k)) + dqdt_snow(i,k) = RQSBLTEN(i,k) !/(1.0 + qv(i,k)) enddo enddo if(ldiag3d .and. .not. flag_for_pbl_generic_tend) then @@ -888,7 +890,7 @@ SUBROUTINE mynnedmf_wrapper_run( & dqdt_liquid_cloud(i,k) = RQCBLTEN(i,k) !/(1.0 + qv(i,k)) dqdt_ice(i,k) = RQIBLTEN(i,k) !/(1.0 + qv(i,k)) dqdt_ice_num_conc(i,k) = RQNIBLTEN(i,k) - dqdt_snow(i,k) = 0.0 !RQSBLTEN(i,k) !/(1.0 + qv(i,k)) + dqdt_snow(i,k) = RQSBLTEN(i,k) !/(1.0 + qv(i,k)) !dqdt_ozone(i,k) = 0.0 enddo enddo @@ -918,7 +920,7 @@ SUBROUTINE mynnedmf_wrapper_run( & dqdt_cloud_droplet_num_conc(i,k) = RQNCBLTEN(i,k) dqdt_ice(i,k) = RQIBLTEN(i,k) !/(1.0 + qv(i,k)) dqdt_ice_num_conc(i,k) = RQNIBLTEN(i,k) - !dqdt_snow(i,k) = RQSBLTEN(i,k) !/(1.0 + qv(i,k)) + dqdt_snow(i,k) = RQSBLTEN(i,k) !/(1.0 + qv(i,k)) IF ( nssl_ccn_on ) THEN ! dqdt_cccn(i,k) = RQNWFABLTEN(i,k) ENDIF diff --git a/physics/sgscloud_radpre.F90 b/physics/sgscloud_radpre.F90 index 44ab87bcc..936393d5b 100644 --- a/physics/sgscloud_radpre.F90 +++ b/physics/sgscloud_radpre.F90 @@ -216,10 +216,10 @@ subroutine sgscloud_radpre_run( & qi(i,k) = ice_frac*qi_bl(i,k) !eff radius cloud ice (microns), from Mishra et al. (2014, JGR Atmos, fig 6b) - if(qi(i,k)>1.E-8)clouds5(i,k)=max(173.45 + 2.14*Tc, 20.) + clouds5(i,k)=max(173.45 + 2.14*Tc, 20.) !eff radius cloud ice (microns), from Mishra et al. (2014, JGR Atmos, fig 8b) !iwc = qi(i,k)*1.0e6*rho(i,k) - !IF(qi(i,k)>1.E-8)clouds5(i,k)=MAX(139.7 + 1.76*Tc + 13.49*LOG(iwc), 20.) + !clouds5(i,k)=MAX(139.7 + 1.76*Tc + 13.49*LOG(iwc), 20.) !calculate the ice water path using additional BL clouds clouds4(i,k) = max(0.0, qi(i,k) * gfac * delp(i,k)) @@ -229,7 +229,7 @@ subroutine sgscloud_radpre_run( & qs(i,k) = snow_frac*qi_bl(i,k) !eff radius cloud ice (microns), from Mishra et al. (2014, JGR Atmos, fig 6b) - if(qs(i,k)>1.E-8)clouds9(i,k)=max(2.*(173.45 + 2.14*Tc), 50.) + clouds9(i,k)=max(2.*(173.45 + 2.14*Tc), 50.) !calculate the snow water path using additional BL clouds clouds8(i,k) = max(0.0, qs(i,k) * gfac * delp(i,k)) From 872f48820b8194275268b5d6add33cf0e7731025 Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Sun, 29 Oct 2023 20:25:12 +0000 Subject: [PATCH 069/249] Addressing comments from Dustin --- physics/module_sf_mynn.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index c2845f290..048a5c696 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -1381,7 +1381,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ZNTstoch_lnd(I) = ZNT_lnd(I) endif !add limit to prevent ridiculous values of z0 (more than dz/15) - ZNTstoch_lnd(I) = min(ZNTstoch_lnd(I), dz8w1d(i)*0.0666) + ZNTstoch_lnd(I) = min(ZNTstoch_lnd(I), dz8w1d(i)*0.0666_kind_phys) !-------------------------------------- ! LAND From 277bd480032dfa3ab518f12e17cd145d8590ebce Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Sun, 29 Oct 2023 20:26:23 +0000 Subject: [PATCH 070/249] Addressing comments from Dustin --- physics/module_bl_mynn.F90 | 53 +++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 30 deletions(-) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index a2ba17c65..4b47b43a7 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -3046,7 +3046,6 @@ SUBROUTINE mym_turbulence ( & ! q-variance (pdq), and covariance (pdc) pdk(k) = elq*( sm(k)*gm(k) & & +sh(k)*gh(k)+gamv ) + & -!fix? & TKEprodTD(k) & 0.5*TKEprodTD(k) ! xmchen pdt(k) = elh*( sh(k)*dtl(k)+gamt )*dtl(k) pdq(k) = elh*( sh(k)*dqw(k)+gamq )*dqw(k) @@ -3091,7 +3090,6 @@ SUBROUTINE mym_turbulence ( & !qBUOY1D(k) = elq*(sh(k)*(-dTdz*grav/thl(k)) + gamv) !! ORIGINAL CODE !! Buoyncy term takes the TKEprodTD(k) production now -!fix? qBUOY1D(k) = elq*(sh(k)*gh(k)+gamv)+TKEprodTD(k) !staggered qBUOY1D(k) = elq*(sh(k)*gh(k)+gamv)+0.5*TKEprodTD(k) ! xmchen !!!Dissipation Term (now it evaluated in mym_predict) @@ -3801,7 +3799,7 @@ SUBROUTINE mym_condensation (kts,kte, & !Diagnostic statistical scheme of Chaboureau and Bechtold (2002), JAS !but with use of higher-order moments to estimate sigma - pblh2=MAX(10.,pblh1) + pblh2=MAX(10._kind_phys,pblh1) zagl = 0. dzm1 = 0. DO k = kts,kte-1 @@ -3811,7 +3809,7 @@ SUBROUTINE mym_condensation (kts,kte, & t = th(k)*exner(k) xl = xl_blend(t) ! obtain latent heat qsat_tk= qsat_blend(t, p(k)) ! saturation water vapor mixing ratio at tk and p - rh(k) = MAX(MIN(1.00,qw(k)/MAX(1.E-10,qsat_tk)),0.001) + rh(k) = MAX(MIN(1.0_kind_phys,qw(k)/MAX(1.E-10,qsat_tk)),0.001_kind_phys) !dqw/dT: Clausius-Clapeyron dqsl = qsat_tk*ep_2*xlv/( r_d*t**2 ) @@ -3840,7 +3838,7 @@ SUBROUTINE mym_condensation (kts,kte, & !sgm(k) = max( sgm(k), qsat_tk*0.035 ) !introduce vertical grid spacing dependence on min sgm - wt = max(500. - max(dz(k)-100.,0.0), 0.0)/500. !=1 for dz < 100 m, =0 for dz > 600 m + wt = max(500. - max(dz(k)-100.,0.0), 0.0_kind_phys)/500. !=1 for dz < 100 m, =0 for dz > 600 m sgm(k) = sgm(k) + sgm(k)*0.2*(1.0-wt) !inflate sgm for coarse dz !allow min sgm to vary with dz and z. @@ -3855,7 +3853,7 @@ SUBROUTINE mym_condensation (kts,kte, & rh_hack= rh(k) !ensure adequate RH & q1 when qi is at least 1e-9 if (qi(k)>1.e-9) then - rh_hack =min(1.0, rhcrit + 0.07*(9.0 + log10(qi(k)))) + rh_hack =min(1.0_kind_phys, rhcrit + 0.07*(9.0 + log10(qi(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) @@ -3863,7 +3861,7 @@ SUBROUTINE mym_condensation (kts,kte, & endif !ensure adequate RH & q1 when qc is at least 1e-6 if (qc(k)>1.e-6) then - rh_hack =min(1.0, rhcrit + 0.09*(6.0 + log10(qc(k)))) + rh_hack =min(1.0_kind_phys, rhcrit + 0.09*(6.0 + log10(qc(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) @@ -3871,7 +3869,7 @@ SUBROUTINE mym_condensation (kts,kte, & endif !ensure adequate RH & q1 when qs is at least 1e-7 (above the PBLH) if (qs(k)>1.e-8 .and. zagl .gt. pblh2) then - rh_hack =min(1.0, rhcrit + 0.07*(8.0 + log10(qs(k)))) + rh_hack =min(1.0_kind_phys, rhcrit + 0.07*(8.0 + log10(qs(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) @@ -3953,10 +3951,10 @@ SUBROUTINE mym_condensation (kts,kte, & elseif (q1k .ge. -2.5 .and. q1k .lt. -1.7) then Fng = 3.0 + exp(-3.8*(q1k+1.7)) else - Fng = min(23.9 + exp(-1.6*(q1k+2.5)), 60.) + Fng = min(23.9 + exp(-1.6*(q1k+2.5)), 60._kind_phys) endif - cfmax = min(cldfra_bl1D(k), 0.6) + cfmax = min(cldfra_bl1D(k), 0.6_kind_phys) !Further limit the cf going into vt & vq near the surface zsl = min(max(25., 0.1*pblh2), 100.) wt = min(zagl/zsl, 1.0) !=0 at z=0 m, =1 above ekman layer @@ -4921,9 +4919,6 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & sqi2(k) = 0.0 ! if sqw2 > qsat sqc2(k) = 0.0 ENDIF - !dqv(k) = (sqv2(k) - sqv(k))/delt - !dqc(k) = (sqc2(k) - sqc(k))/delt - !dqi(k) = (sqi2(k) - sqi(k))/delt ENDDO ENDIF @@ -4932,7 +4927,7 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & ! WATER VAPOR TENDENCY !===================== DO k=kts,kte - Dqv(k)=(sqv2(k)/(1.-sqv2(k)) - qv(k))/delt + Dqv(k)=(sqv2(k) - sqv(k))/delt !if (sqv2(k) < 0.0)print*,"neg qv:",sqv2(k),k ENDDO @@ -4943,7 +4938,7 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & !print*,"FLAG_QC:",FLAG_QC IF (FLAG_QC) THEN DO k=kts,kte - Dqc(k)=(sqc2(k)/(1.-sqv2(k)) - qc(k))/delt + Dqc(k)=(sqc2(k) - sqc(k))/delt !if (sqc2(k) < 0.0)print*,"neg qc:",sqc2(k),k ENDDO ELSE @@ -4971,7 +4966,7 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & !=================== IF (FLAG_QI) THEN DO k=kts,kte - Dqi(k)=(sqi2(k)/(1.-sqv2(k)) - qi(k))/delt + Dqi(k)=(sqi2(k) - sqi(k))/delt !if (sqi2(k) < 0.0)print*,"neg qi:",sqi2(k),k ENDDO ELSE @@ -4985,7 +4980,7 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & !=================== IF (.false.) THEN !disabled DO k=kts,kte - Dqs(k)=(sqs2(k)/(1.-sqs2(k)) - qs(k))/delt + Dqs(k)=(sqs2(k) - sqs(k))/delt ENDDO ELSE DO k=kts,kte @@ -5009,10 +5004,11 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & ELSE !-MIX CLOUD SPECIES? !CLOUDS ARE NOT NIXED (when bl_mynn_cloudmix == 0) DO k=kts,kte - Dqc(k)=0. + Dqc(k) =0. Dqnc(k)=0. - Dqi(k)=0. + Dqi(k) =0. Dqni(k)=0. + Dqs(k) =0. ENDDO ENDIF @@ -6007,30 +6003,27 @@ SUBROUTINE DMP_mf( & ! Criteria (1) maxwidth = min(dx*dcut, lmax) !Criteria (2) - maxwidth = min(maxwidth, 1.1*PBLH) + maxwidth = min(maxwidth, 1.1_kind_phys*PBLH) ! Criteria (3) if ((landsea-1.5) .lt. 0) then !land - maxwidth = MIN(maxwidth, 0.5*cloud_base) + maxwidth = MIN(maxwidth, 0.5_kind_phys*cloud_base) else !water - maxwidth = MIN(maxwidth, 0.9*cloud_base) + maxwidth = MIN(maxwidth, 0.9_kind_phys*cloud_base) endif ! Criteria (4) - wspd_pbl=SQRT(MAX(u(kts)**2 + v(kts)**2, 0.01)) + wspd_pbl=SQRT(MAX(u(kts)**2 + v(kts)**2, 0.01_kind_phys)) !Note: area fraction (acfac) is modified below ! Criteria (5) - only a function of flt (not fltv) if ((landsea-1.5).LT.0) then !land - !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.050)/0.03) + .5),1000.), 0.) - !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.040)/0.03) + .5),1000.), 0.) - width_flx = MAX(MIN(1000.*(0.6*tanh((fltv - 0.040)/0.04) + .5),1000.), 0.) + width_flx = MAX(MIN(1000.*(0.6*tanh((fltv - 0.040)/0.04) + .5),1000._kind_phys), 0._kind_phys) else !water - !width_flx = MAX(MIN(1000.*(0.6*tanh((flt - 0.003)/0.01) + .5),1000.), 0.) - width_flx = MAX(MIN(1000.*(0.6*tanh((fltv - 0.007)/0.02) + .5),1000.), 0.) + width_flx = MAX(MIN(1000.*(0.6*tanh((fltv - 0.007)/0.02) + .5),1000._kind_phys), 0._kind_phys) endif maxwidth = MIN(maxwidth, width_flx) minwidth = lmin !allow min plume size to increase in large flux conditions (eddy diffusivity should be !large enough to handle the representation of small plumes). - if (maxwidth .ge. (lmax - 1.0) .and. fltv .gt. 0.2)minwidth = lmin + dlmin*min((fltv-0.2)/0.3, 1.) + if (maxwidth .ge. (lmax - 1.0) .and. fltv .gt. 0.2)minwidth = lmin + dlmin*min((fltv-0.2)/0.3, 1._kind_phys) if (maxwidth .le. minwidth) then ! deactivate MF component nup2 = 0 @@ -6048,7 +6041,7 @@ SUBROUTINE DMP_mf( & ! Find coef C for number size density N cn = 0. d =-1.9 !set d to value suggested by Neggers 2015 (JAMES). - dl = (maxwidth - minwidth)/real(nup-1) + dl = (maxwidth - minwidth)/real(nup-1,kind=kind_phys) do i=1,NUP ! diameter of plume l = minwidth + dl*real(i-1) From b2dc0bf4eb3de74c43cf447ecac18578a4587167 Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Sun, 29 Oct 2023 20:51:30 +0000 Subject: [PATCH 071/249] Adding some comments to describe overall changes. --- physics/module_bl_mynn.F90 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index 4b47b43a7..a636a4fe8 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -232,6 +232,18 @@ ! bl_mynn_cloudpdf = 2 (Chab-Becht). ! Removed WRF_CHEM dependencies. ! Many miscellaneous tweaks. +! v4.5.2 / CCPP +! Some code optimization. Removed many conditions from loops. Redesigned the mass- +! flux scheme to use 8 plumes instead of a variable n plumes. This results in +! the removal of the output variable "nudprafts" and adds maxwidth and ztop_plume. +! Revision option bl_mynn_cloudpdf = 2, which now ensures cloud fractions for all +! optically relevant mixing ratios (tip from Greg Thompson). Also, added flexibility +! for tuning near-surface cloud fractions to remove excess fog/low ceilings. +! Now outputs all SGS cloud mixing ratios as grid-mean values, not in-cloud. This +! results in a change in the pre-radiation code to no longer multiply mixing ratios +! by cloud fractions. +! Lots of code cleanup: removal of test code, comments, changing text case, etc. +! Many misc tuning/tweaks. ! ! Many of these changes are now documented in references listed above. !==================================================================== From 5658192be2595309ba44e258c86d831275149991 Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Mon, 30 Oct 2023 19:12:02 +0000 Subject: [PATCH 072/249] fix typo --- physics/module_bl_mynn.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index a636a4fe8..e522b65eb 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -3879,7 +3879,7 @@ SUBROUTINE mym_condensation (kts,kte, & q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) q1(k) =max(q1_rh, q1(k) ) endif - !ensure adequate RH & q1 when qs is at least 1e-7 (above the PBLH) + !ensure adequate RH & q1 when qs is at least 1e-8 (above the PBLH) if (qs(k)>1.e-8 .and. zagl .gt. pblh2) then rh_hack =min(1.0_kind_phys, rhcrit + 0.07*(8.0 + log10(qs(k)))) rh(k) =max(rh(k), rh_hack) From d4835d1bfe04f1dd3753f08b9d7f1baa37942a1f Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 30 Oct 2023 19:31:09 +0000 Subject: [PATCH 073/249] Address reviewers comments. --- CMakeLists.txt | 54 +++++++++---------- physics/SFC_Models/Land/Noah/lsm_noah.meta | 2 +- .../Land/{ => Noah}/namelist_soilveg.f | 0 .../SFC_Models/Land/{ => Noah}/set_soilveg.f | 0 physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 3 +- 5 files changed, 30 insertions(+), 29 deletions(-) rename physics/SFC_Models/Land/{ => Noah}/namelist_soilveg.f (100%) rename physics/SFC_Models/Land/{ => Noah}/set_soilveg.f (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 97591a2ee..bac0637a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -79,37 +79,37 @@ get_filename_component(LOCAL_CURRENT_SOURCE_DIR ${FULL_PATH_TO_CMAKELISTS} DIREC #------------------------------------------------------------------------------ # List of files that need to be compiled without OpenMP -set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_gas_optics.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_constants.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_gas_concentrations.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_rrtmgp_util_string.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/kernels/mo_gas_optics_kernels.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_rrtmgp_clr_all_sky.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_fluxes_byband.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/solar_variability/mo_solar_variability.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_heating_rates.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_fluxes_bygpoint.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/mo_compute_bc.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/cloud_optics/mo_cloud_sampling.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/extensions/cloud_optics/mo_cloud_optics.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_config.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_source_functions.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_sw.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_fluxes.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_lw.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_util_array.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/kernels/mo_optical_props_kernels.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/kernels/mo_fluxes_broadband_kernels.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_rte_kind.F90 - ${LOCAL_CURRENT_SOURCE_DIR}/physics/rte-rrtmgp/rte/mo_optical_props.F90) +set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rrtmgp/mo_gas_optics.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rrtmgp/mo_rrtmgp_constants.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rrtmgp/mo_gas_concentrations.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rrtmgp/mo_rrtmgp_util_string.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rrtmgp/kernels/mo_gas_optics_kernels.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rrtmgp/mo_gas_optics_rrtmgp.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/mo_rrtmgp_clr_all_sky.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/mo_fluxes_byband.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/solar_variability/mo_solar_variability.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/mo_heating_rates.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/mo_fluxes_bygpoint.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/mo_compute_bc.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/cloud_optics/mo_cloud_sampling.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/extensions/cloud_optics/mo_cloud_optics.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_rte_config.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_source_functions.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_rte_sw.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_fluxes.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_rte_lw.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_rte_util_array.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/kernels/mo_rte_solver_kernels.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/kernels/mo_optical_props_kernels.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/kernels/mo_fluxes_broadband_kernels.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_rte_kind.F90 + ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte-rrtmgp/rte/mo_optical_props.F90) # List of files that need to be compiled with different precision set(SCHEMES_DYNAMICS) -if(${LOCAL_CURRENT_SOURCE_DIR}/physics/fv_sat_adj.F90 IN_LIST SCHEMES) - list(APPEND SCHEMES_DYNAMICS ${LOCAL_CURRENT_SOURCE_DIR}/physics/fv_sat_adj.F90) +if(${LOCAL_CURRENT_SOURCE_DIR}/physics/MP/GFDL/fv_sat_adj.F90fv_sat_adj.F90 IN_LIST SCHEMES) + list(APPEND SCHEMES_DYNAMICS ${LOCAL_CURRENT_SOURCE_DIR}/physics/MP/GFDL/fv_sat_adj.F90/fv_sat_adj.F90) endif() # Remove files that need to be compiled with different precision diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.meta b/physics/SFC_Models/Land/Noah/lsm_noah.meta index 07f4045a2..44cb6aa5b 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.meta +++ b/physics/SFC_Models/Land/Noah/lsm_noah.meta @@ -2,7 +2,7 @@ name = lsm_noah type = scheme dependencies = ../../../tools/funcphys.f90,../../../hooks/machine.F - dependencies = ../set_soilveg.f,sflx.f,surface_perturbation.F90 + dependencies = set_soilveg.f,sflx.f,surface_perturbation.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/Land/namelist_soilveg.f b/physics/SFC_Models/Land/Noah/namelist_soilveg.f similarity index 100% rename from physics/SFC_Models/Land/namelist_soilveg.f rename to physics/SFC_Models/Land/Noah/namelist_soilveg.f diff --git a/physics/SFC_Models/Land/set_soilveg.f b/physics/SFC_Models/Land/Noah/set_soilveg.f similarity index 100% rename from physics/SFC_Models/Land/set_soilveg.f rename to physics/SFC_Models/Land/Noah/set_soilveg.f diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index e7a73ef99..64372bdb8 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -2,7 +2,8 @@ name = noahmpdrv type = scheme dependencies = ../../../tools/funcphys.f90,../../../hooks/machine.F - dependencies = module_sf_noahmp_glacier.F90,module_sf_noahmplsm.F90,noahmp_tables.f90,../set_soilveg.f + dependencies = module_sf_noahmp_glacier.F90,module_sf_noahmplsm.F90,noahmp_tables.f90 + dependencies = ../Noah/set_soilveg.f ######################################################################## [ccpp-arg-table] From 1d3118299e53cf4a6d25367f27caefbe586d2909 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 31 Oct 2023 02:42:41 +0000 Subject: [PATCH 074/249] More metatdata changes --- .../Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta | 2 +- .../Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta index 8a35d469c..f35510ed2 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta @@ -7,7 +7,7 @@ dependencies = Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90,Interstitials/UFS_SCM_NEPTUNE/sfcsub.F dependencies = Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 - dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 + dependencies = SFC_Models/Land/Noah/namelist_soilveg.f,SFC_Models/Land/Noah/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 dependencies = photochem/ozinterp.f90,photochem/ozne_def.f dependencies = photochem/h2o_def.f,photochem/h2ointerp.f90 dependencies = GWD/cires_tauamf_data.F90 diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta index 86c052b0e..c885e7c2a 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta @@ -6,7 +6,7 @@ dependencies = Interstitials/UFS_SCM_NEPTUNE/iccn_def.F,Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90 dependencies = Interstitials/UFS_SCM_NEPTUNE/sfcsub.F,Radiation/mersenne_twister.f dependencies = MP/Morrison_Gettelman/aerclm_def.F,MP/Morrison_Gettelman/aerinterp.F90 - dependencies = SFC_Models/Land/namelist_soilveg.f,SFC_Models/Land/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 + dependencies = SFC_Models/Land/Noah/namelist_soilveg.f,SFC_Models/Land/Noah/set_soilveg.f,SFC_Models/Land/Noahmp/noahmp_tables.f90 dependencies = photochem/ozinterp.f90,photochem/ozne_def.f dependencies = photochem/h2o_def.f,photochem/h2ointerp.f90 dependencies = GWD/cires_tauamf_data.F90 From e0991a8a2c653ffe989d2e77ea2ecc018512b294 Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Thu, 2 Nov 2023 19:57:39 +0000 Subject: [PATCH 075/249] Removed requested by the reviewer commented lines. --- physics/module_sf_ruclsm.F90 | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 74d2719d4..47c03c49d 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -1521,7 +1521,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia ENDIF if(snhei.gt.0.0081_kind_phys*rhowater/rhosn) then -!*** Update snow density for current temperature (Koren et al. 1999) +!*** Update snow density for current temperature (Koren et al 1999,doi:10.1029/1999JD900232.) BSN=delt/3600._kind_phys*c1sn*exp(0.08_kind_phys*min(zero,tsnav)-c2sn*rhosn*1.e-3_kind_phys) if(bsn*snwe*100._kind_phys.lt.1.e-4_kind_phys) goto 777 XSN=rhosn*(exp(bsn*snwe*100._kind_phys)-one)/(bsn*snwe*100._kind_phys) @@ -4079,11 +4079,8 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & fact = one if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is tuning parameter added by tgs based on 4 Jan 2017 testing - !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - !fact = 2._kind_phys endif if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then @@ -4536,11 +4533,8 @@ SUBROUTINE SNOWSEAICE( debug_print,xlat,xlon, & fact = one if(rhosn < 156._kind_phys .or. (newsn > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is a tuning parameter - !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - !fact = 2._kind_phys endif if(newsnow <= zero .and. snhei > one .and. rhosn > 250._kind_phys) then @@ -5213,11 +5207,8 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & fact = one if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is a tuning parameter - !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - !fact = 2._kind_phys if(debug_print) then print *,'SnowTemp xlat,xlon,rhosn,keff', xlat,xlon,rhosn,keff,keff/rhocsn*fact print *,'SNOWTEMP - 0.265/rhocsn',0.265_kind_phys/rhocsn @@ -5789,11 +5780,8 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & fact = one if(rhosn < 156._kind_phys .or. (newsnow > zero .and. rhonewsn < 156._kind_phys)) then keff = 0.023_kind_phys + 0.234_kind_phys * rhosn * 1.e-3_kind_phys - !-- fact is a tuning parameter - !fact = 5._kind_phys else keff = 0.138_kind_phys - 1.01_kind_phys * rhosn*1.e-3_kind_phys + 3.233_kind_phys * rhosn**2 * 1.e-6_kind_phys - !fact = 2._kind_phys if(debug_print) then print *,'End SNOWTEMP - xlat,xlon,rhosn,keff',xlat,xlon,rhosn,keff print *,'End SNOWTEMP - 0.265/rhocsn',0.265/rhocsn From 0dce0a55dbced9c3dcae8da900b836b3128138d5 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Thu, 2 Nov 2023 20:03:59 +0000 Subject: [PATCH 076/249] Convective reflectivity added for NSSL,Thompson mp,SAS,GF shal/deep --- physics/GFS_MP_generic_post.F90 | 71 ++++++++++++++++++++++++++++++-- physics/GFS_MP_generic_post.meta | 58 ++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 4 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index 201c0e817..4b4907aea 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -21,7 +21,8 @@ module GFS_MP_generic_post subroutine GFS_MP_generic_post_run( & im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, & imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rhowater, rainmin, dtf, & - frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, snow, graupel, save_t, save_q, & + frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice,phil,htop,refl_10cm, & + imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf,snow, graupel, save_t, save_q, & rain0, ice0, snow0, graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp,& totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, & pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, exticeden, & @@ -40,12 +41,14 @@ subroutine GFS_MP_generic_post_run( integer, intent(in) :: imp_physics_nssl, iopt_lake_clm, iopt_lake, lkm logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, exticeden integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:) - +!aligo + integer, intent(in) :: imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf + integer, dimension (:), intent(in) :: htop integer :: dfi_radar_max_intervals real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour real(kind=kind_phys), intent(in) :: radar_tten_limits(:) integer :: ix_dfi_radar(:) - real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0 + real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0,refl_10cm real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin, rhowater real(kind=kind_phys), dimension(:), intent(in) :: rain1, xlat, xlon, tsfc @@ -53,7 +56,7 @@ subroutine GFS_MP_generic_post_run( real(kind=kind_phys), dimension(:), intent(in) :: 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 + 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 @@ -112,6 +115,18 @@ subroutine GFS_MP_generic_post_run( real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr real :: rhonewsnow,rhoprcpice,rhonewgr,rhonewice +!aligo + real(kind_phys), parameter :: dbzmin=-20.0 + real(kind_phys) :: cuprate + real(kind_phys) :: ze, ze_conv, dbz_sum + + real(kind_phys), dimension(1:im,1:levs) :: zo + real(kind_phys), dimension(1:im) :: zfrz + real(kind_phys), dimension(1:im) :: factor + real(kind_phys) ze_mp, fctz, delz, xlatd,xlond + logical :: lfrz + + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -121,6 +136,54 @@ subroutine GFS_MP_generic_post_run( do i = 1, im rain(i) = rainc(i) + frain * rain1(i) ! time-step convective plus explicit enddo +! +! Combine convective reflectivity with MP reflectivity for selected +! parameterizations. + if (imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl .and. imfdeepcnv == imfdeepcnv_samf .or. imfdeepcnv == imfdeepcnv_gf .or. imfshalcnv == imfshalcnv_gf) then + do i=1,im + lfrz = .true. + zfrz(i) = phil(i,1) / con_g + do k = levs, 2, -1 + zo(i,k) = phil(i,k) / con_g + if (gt0(i,k) >= 273.16 .and. lfrz) then + zfrz(i) = zo(i,k) + lfrz = .false. + endif + enddo + enddo + + do i=1,im + factor(i) = 0.0 + enddo + + do i=1,im + if(rainc (i) > 0.0 .or. htop(i) > 0) then + factor(i) = -2./max(1000., zo(i,htop(i)) - zfrz(i)) + endif + enddo + +! combine the reflectivity from both Thompson MP and samfdeep convection + + do k=1,levs + do i=1,im + if(rainc(i) > 0. .and. k <= htop(i)) then + fctz = 0.0 + delz = zo(i,k) - zfrz(i) + if(delz <0.0) then + fctz = 1. ! wrong + else + fctz = 10.**(factor(i)*delz) + endif + cuprate = rainc(i) * 3.6e6 / dtp ! cu precip rate (mm/h) + ze_conv = 300.0 * cuprate**1.4 + ze_conv = fctz * ze_conv + ze_mp = 10._kind_phys ** (0.1 * refl_10cm(i,k)) + dbz_sum = max(DBZmin, 10.*log10(ze_mp + ze_conv)) + refl_10cm(i,k) = dbz_sum + endif + enddo + enddo + endif ! compute surface snowfall, graupel/sleet, freezing rain and precip ice density if (imp_physics == imp_physics_gfdl .or. imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl ) then diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index 7cd2ca4b5..9bc7dcffe 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -254,6 +254,64 @@ type = real kind = kind_phys intent = in +[phil] + standard_name = geopotential + long_name = layer geopotential + units = m2 s-2 + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = in +[htop] + standard_name = vertical_index_at_cloud_top + long_name = index for cloud top + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent = out +[refl_10cm] + standard_name = radar_reflectivity_10cm + long_name = instantaneous refl_10cm + units = dBZ + dimensions = (horizontal_loop_extent,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[imfshalcnv] + standard_name = control_for_shallow_convection_scheme + long_name = flag for mass-flux shallow convection scheme + units = flag + dimensions = () + type = integer + intent = in +[imfshalcnv_gf] + standard_name = identifier_for_grell_freitas_shallow_convection + long_name = flag for Grell-Freitas shallow convection scheme + units = flag + dimensions = () + type = integer + intent = in +[imfdeepcnv] + standard_name = control_for_deep_convection_scheme + long_name = flag for mass-flux deep convection scheme + units = flag + dimensions = () + type = integer + intent = in +[imfdeepcnv_gf] + standard_name = identifier_for_grell_freitas_deep_convection + long_name = flag for Grell-Freitas deep convection scheme + units = flag + dimensions = () + type = integer + intent = in +[imfdeepcnv_samf] + standard_name = identifer_for_scale_aware_mass_flux_deep_convection + long_name = flag for SAMF deep convection scheme + units = flag + dimensions = () + type = integer + intent = in [tsfc] standard_name = surface_skin_temperature long_name = surface skin temperature From 6d62ab84c22b60033dec92d7f90ac3643b83da8c Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Fri, 3 Nov 2023 16:57:46 +0000 Subject: [PATCH 077/249] Better range checks for output in surface layer, tweaked cloud fractions. last commit before reg tests --- physics/module_bl_mynn.F90 | 21 +++++++++++---------- physics/module_sf_mynn.F90 | 6 +++--- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index e522b65eb..6840f80bf 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -3638,7 +3638,8 @@ SUBROUTINE mym_condensation (kts,kte, & real(kind_phys), parameter :: qpct_sfc=0.025 real(kind_phys), parameter :: qpct_pbl=0.030 real(kind_phys), parameter :: qpct_trp=0.040 - real(kind_phys), parameter :: rhcrit =0.83 !for hom pdf min sigma + real(kind_phys), parameter :: rhcrit =0.83 !for cloudpdf = 2 + real(kind_phys), parameter :: rhmax =1.01 !for cloudpdf = 2 integer :: i,j,k real(kind_phys):: erf @@ -3821,7 +3822,7 @@ SUBROUTINE mym_condensation (kts,kte, & t = th(k)*exner(k) xl = xl_blend(t) ! obtain latent heat qsat_tk= qsat_blend(t, p(k)) ! saturation water vapor mixing ratio at tk and p - rh(k) = MAX(MIN(1.0_kind_phys,qw(k)/MAX(1.E-10,qsat_tk)),0.001_kind_phys) + rh(k) = MAX(MIN(rhmax, qw(k)/MAX(1.E-10,qsat_tk)),0.001_kind_phys) !dqw/dT: Clausius-Clapeyron dqsl = qsat_tk*ep_2*xlv/( r_d*t**2 ) @@ -3863,28 +3864,28 @@ SUBROUTINE mym_condensation (kts,kte, & !Add condition for falling/settling into low-RH layers, so at least !some cloud fraction is applied for all qc, qs, and qi. rh_hack= rh(k) - !ensure adequate RH & q1 when qi is at least 1e-9 - if (qi(k)>1.e-9) then - rh_hack =min(1.0_kind_phys, rhcrit + 0.07*(9.0 + log10(qi(k)))) + !ensure adequate RH & q1 when qi is at least 1e-9 (above the PBLH) + if (qi(k)>1.e-9 .and. zagl .gt. pblh2) then + rh_hack =min(rhmax, rhcrit + 0.07*(9.0 + log10(qi(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 - q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) + q1_rh =-3. + 3.*(rh(k)-rhcrit)/(1.-rhcrit) q1(k) =max(q1_rh, q1(k) ) endif !ensure adequate RH & q1 when qc is at least 1e-6 if (qc(k)>1.e-6) then - rh_hack =min(1.0_kind_phys, rhcrit + 0.09*(6.0 + log10(qc(k)))) + rh_hack =min(rhmax, rhcrit + 0.09*(6.0 + log10(qc(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 - q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) + q1_rh =-3. + 3.*(rh(k)-rhcrit)/(1.-rhcrit) q1(k) =max(q1_rh, q1(k) ) endif !ensure adequate RH & q1 when qs is at least 1e-8 (above the PBLH) if (qs(k)>1.e-8 .and. zagl .gt. pblh2) then - rh_hack =min(1.0_kind_phys, rhcrit + 0.07*(8.0 + log10(qs(k)))) + rh_hack =min(rhmax, rhcrit + 0.07*(8.0 + log10(qs(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 - q1_rh =-3. + 3.*(rh_hack-rhcrit)/(1.-rhcrit) + q1_rh =-3. + 3.*(rh(k)-rhcrit)/(1.-rhcrit) q1(k) =max(q1_rh, q1(k) ) endif diff --git a/physics/module_sf_mynn.F90 b/physics/module_sf_mynn.F90 index 048a5c696..3d847348d 100644 --- a/physics/module_sf_mynn.F90 +++ b/physics/module_sf_mynn.F90 @@ -947,7 +947,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_lnd(I) = TSK_lnd(I)*THCON(I) !(K) THVSK_lnd(I) = THSK_lnd(I)*(1.+EP1*qsfc_lnd(I)) - if(THVSK_lnd(I) < 170. .or. THVSK_lnd(I) > 360.) & + if(THVSK_lnd(I) < 160. .or. THVSK_lnd(I) > 390.) & print *,'THVSK_lnd(I)',itimestep,i,THVSK_lnd(I),THSK_lnd(i),tsurf_lnd(i),tskin_lnd(i),qsfc_lnd(i) endif if(icy(i)) then @@ -956,7 +956,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_ice(I) = TSK_ice(I)*THCON(I) !(K) THVSK_ice(I) = THSK_ice(I)*(1.+EP1*qsfc_ice(I)) !(K) - if(THVSK_ice(I) < 170. .or. THVSK_ice(I) > 360.) & + if(THVSK_ice(I) < 160. .or. THVSK_ice(I) > 390.) & print *,'THVSK_ice(I)',itimestep,i,THVSK_ice(I),THSK_ice(i),tsurf_ice(i),tskin_ice(i),qsfc_ice(i) endif if(wet(i)) then @@ -965,7 +965,7 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & ! CONVERT SKIN TEMPERATURES TO POTENTIAL TEMPERATURE: THSK_wat(I) = TSK_wat(I)*THCON(I) !(K) THVSK_wat(I) = THSK_wat(I)*(1.+EP1*QVSH(I)) !(K) - if(THVSK_wat(I) < 170. .or. THVSK_wat(I) > 360.) & + if(THVSK_wat(I) < 160. .or. THVSK_wat(I) > 390.) & print *,'THVSK_wat(I)',i,THVSK_wat(I),THSK_wat(i),tsurf_wat(i),tskin_wat(i),qsfc_wat(i) endif endif ! flag_iter From 360a612a4ff606096acb32c09c3e7276c4075224 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Fri, 3 Nov 2023 13:48:20 -0500 Subject: [PATCH 078/249] Update GFS_phys_time_vary.fv3.F90 to compile without '-fallow-argument-mismatch' --- physics/GFS_phys_time_vary.fv3.F90 | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index 4b6909f74..2d0b35d79 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -830,7 +830,6 @@ subroutine GFS_phys_time_vary_timestep_init ( real(kind_phys) :: rannie(cny) real(kind_phys) :: rndval(cnx*cny*nrcm) real(kind_dbl_prec) :: rinc(5) - real(kind_sngl_prec) :: rinc4(5) ! Initialize CCPP error handling variables errmsg = '' @@ -850,7 +849,7 @@ subroutine GFS_phys_time_vary_timestep_init ( !$OMP shared(ozpl,ddy_o3,h2o_phys,jindx1_h,jindx2_h,h2opl,ddy_h,iaerclm,master) & !$OMP shared(levs,prsl,iccn,jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci) & !$OMP shared(ddx_ci,in_nm,ccn_nm,do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau) & -!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys,rjday,n1,n2,idat,jdat,rinc,rinc4) & +!$OMP shared(ddy_j2tau,tau_amf,iflip,ozphys,rjday,n1,n2,idat,jdat,rinc) & !$OMP shared(w3kindreal,w3kindint,jdow,jdoy,jday) & !$OMP private(iseed,iskip,i,j,k) @@ -910,13 +909,7 @@ subroutine GFS_phys_time_vary_timestep_init ( idat(5)=idate(1) rinc=0. rinc(2)=fhour - call w3kind(w3kindreal,w3kindint) - if(w3kindreal==4) then - rinc4=rinc - CALL w3movdat(rinc4,idat,jdat) - else - CALL w3movdat(rinc,idat,jdat) - endif + CALL w3movdat(rinc,idat,jdat) jdow = 0 jdoy = 0 jday = 0 From ce7a3c013f24d0442ced8d9cc6a30250520504c8 Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 3 Nov 2023 13:35:30 -0600 Subject: [PATCH 079/249] Updates to Thompson MP after code review --- physics/module_mp_thompson.F90 | 32 +------------------ ...mp_thompson_make_number_concentrations.F90 | 7 ++-- 2 files changed, 4 insertions(+), 35 deletions(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index b1e5875da..fd5a6e770 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -2469,16 +2469,6 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & !+---+-----------------------------------------------------------------+ !> - Calculate y-intercept, slope values for graupel. !+---+-----------------------------------------------------------------+ - ! do k = kte, kts, -1 - ! ygra1 = alog10(max(1.E-9, rg(k))) - ! zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 - ! N0_exp = 10.**(zans1) - ! N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) - ! lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 - ! lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg - ! ilamg(k) = 1./lamg - ! N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) - ! enddo call graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) endif @@ -3546,16 +3536,6 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & !+---+-----------------------------------------------------------------+ !> - Calculate y-intercept, slope values for graupel. !+---+-----------------------------------------------------------------+ - ! do k = kte, kts, -1 - ! ygra1 = alog10(max(1.E-9, rg(k))) - ! zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 - ! N0_exp = 10.**(zans1) - ! N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) - ! lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 - ! lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg - ! ilamg(k) = 1./lamg - ! N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) - ! enddo call graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) endif @@ -6101,16 +6081,6 @@ subroutine calc_refl10cm (qv1d, qc1d, qr1d, nr1d, qs1d, qg1d, & !+---+-----------------------------------------------------------------+ if (ANY(L_qg .eqv. .true.)) then - ! do k = kte, kts, -1 - ! ygra1 = alog10(max(1.E-9, rg(k))) - ! zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 - ! N0_exp = 10.**(zans1) - ! N0_exp = MAX(DBLE(gonv_min), MIN(N0_exp, DBLE(gonv_max))) - ! lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 - ! lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg - ! ilamg(k) = 1./lamg - ! N0_g(k) = N0_exp/(cgg(2)*lam_exp) * lamg**cge(2) - ! enddo call graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) endif @@ -6517,7 +6487,7 @@ subroutine graupel_psd_parameters(kts, kte, rand1, rg, ilamg, N0_g) ygra1 = alog10(max(1.e-9, rg(k))) zans1 = 3.4 + 2./7.*(ygra1+8.) + rand1 N0_exp = 10.**(zans1) - N0_exp = max1(dble(gonv_min), min(N0_exp, dble(gonv_max))) + N0_exp = max(dble(gonv_min), min(N0_exp, dble(gonv_max))) lam_exp = (N0_exp*am_g*cgg(1)/rg(k))**oge1 lamg = lam_exp * (cgg(3)*ogg2*ogg1)**obmg ilamg(k) = 1./lamg diff --git a/physics/module_mp_thompson_make_number_concentrations.F90 b/physics/module_mp_thompson_make_number_concentrations.F90 index 496942f21..72a1055dd 100644 --- a/physics/module_mp_thompson_make_number_concentrations.F90 +++ b/physics/module_mp_thompson_make_number_concentrations.F90 @@ -4,7 +4,6 @@ !>\ingroup aathompson module module_mp_thompson_make_number_concentrations - use machine, only : kind_phys use physcons, only: PI => con_pi implicit none @@ -36,7 +35,7 @@ elemental real function make_IceNumber (Q_ice, temp) !IMPLICIT NONE REAL, PARAMETER:: Ice_density = 890.0 !REAL, PARAMETER:: PI = 3.1415926536 - real(kind_phys), intent(in):: Q_ice, temp + real, intent(in):: Q_ice, temp integer idx_rei real corr, reice, deice double precision lambda @@ -135,7 +134,7 @@ elemental real function make_DropletNumber (Q_cloud, qnwfa) !IMPLICIT NONE - real(kind_phys), intent(in):: Q_cloud, qnwfa + real, intent(in):: Q_cloud, qnwfa !real, parameter:: PI = 3.1415926536 real, parameter:: am_r = PI*1000./6. @@ -174,7 +173,7 @@ elemental real function make_RainNumber (Q_rain, temp) IMPLICIT NONE - real(kind_phys), intent(in):: Q_rain, temp + real, intent(in):: Q_rain, temp double precision:: lambda, N0, qnr !real, parameter:: PI = 3.1415926536 real, parameter:: am_r = PI*1000./6. From 551e50387c12192ded6965a83818db4bdad41144 Mon Sep 17 00:00:00 2001 From: joeolson42 Date: Fri, 3 Nov 2023 19:53:45 +0000 Subject: [PATCH 080/249] removing the effective radii limit due to concerns by GFS developers --- physics/module_mp_thompson.F90 | 1 - 1 file changed, 1 deletion(-) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index fd5a6e770..4e0e2b79e 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -5849,7 +5849,6 @@ subroutine calc_effectRad (t1d, p1d, qv1d, qc1d, nc1d, qi1d, ni1d, qs1d, & endif lamc = (nc(k)*am_r*g_ratio(inu_c)/rc(k))**obmr re_qc1d(k) = SNGL(0.5D0 * DBLE(3.+inu_c)/lamc) - if (lsml .ne. 1) re_qc1d(k) = max(re_qc1d(k), 7.0E-6) enddo endif From 571cb5941ad1089c207469145c78f57820773dce Mon Sep 17 00:00:00 2001 From: Anders Jensen Date: Fri, 3 Nov 2023 18:44:48 -0600 Subject: [PATCH 081/249] Bug fix for divide by zero in hail size --- physics/module_mp_thompson.F90 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/physics/module_mp_thompson.F90 b/physics/module_mp_thompson.F90 index 4e0e2b79e..44e552160 100644 --- a/physics/module_mp_thompson.F90 +++ b/physics/module_mp_thompson.F90 @@ -6527,6 +6527,8 @@ function hail_mass_99th_percentile(kts, kte, qg, temperature, pressure, qv) resu rho(k) = 0.622*pressure(k)/(R*temperature(k)*(max(1.e-10, qv(k))+0.622)) if (qg(k) .gt. R1) then rg(k) = qg(k)*rho(k) + else + rg(k) = R1 endif enddo From a61a78b08528ea132f9e42a0921f012f2524dc1a Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Sun, 5 Nov 2023 16:34:39 +0000 Subject: [PATCH 082/249] Bug fix: htop set to intent in and modified if condition for convective reflectivity --- physics/GFS_MP_generic_post.F90 | 3 ++- physics/GFS_MP_generic_post.meta | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index 4b4907aea..682263fc4 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -139,7 +139,8 @@ subroutine GFS_MP_generic_post_run( ! ! Combine convective reflectivity with MP reflectivity for selected ! parameterizations. - if (imp_physics == imp_physics_thompson .or. imp_physics == imp_physics_nssl .and. imfdeepcnv == imfdeepcnv_samf .or. imfdeepcnv == imfdeepcnv_gf .or. imfshalcnv == imfshalcnv_gf) then + if ( (imp_physics==imp_physics_thompson .or. imp_physics==imp_physics_nssl) .and. & + (imfdeepcnv==imfdeepcnv_samf .or. imfdeepcnv==imfdeepcnv_gf .or. imfshalcnv==imfshalcnv_gf) ) then do i=1,im lfrz = .true. zfrz(i) = phil(i,1) / con_g diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index 9bc7dcffe..0660a533a 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -268,7 +268,7 @@ units = index dimensions = (horizontal_loop_extent) type = integer - intent = out + intent = in [refl_10cm] standard_name = radar_reflectivity_10cm long_name = instantaneous refl_10cm From 9d59ccac9ff77742ae9e417102291b1c08a36fa8 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Mon, 6 Nov 2023 10:49:52 -0500 Subject: [PATCH 083/249] add kind_phys where missing --- physics/module_nst_water_prop.f90 | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/physics/module_nst_water_prop.f90 b/physics/module_nst_water_prop.f90 index 6a183da52..7f0f480ae 100644 --- a/physics/module_nst_water_prop.f90 +++ b/physics/module_nst_water_prop.f90 @@ -42,7 +42,7 @@ module module_nst_water_prop ! ------------------------------------------------------ !>\ingroup gfs_nst_main_mod !! This subroutine computes thermal expansion coefficient (alpha) -!! and saline contraction coefficient (beta). +!! and saline contraction coefficient (beta). subroutine rhocoef(t, s, rhoref, alpha, beta) ! ------------------------------------------------------ @@ -124,7 +124,7 @@ end subroutine density !====================== ! !>\ingroup gfs_nst_main_mod -!! This subroutine computes the fraction of the solar radiation absorbed +!! This subroutine computes the fraction of the solar radiation absorbed !! by the depth z following Paulson and Simpson (1981) \cite paulson_and_simpson_1981 . elemental subroutine sw_ps_9b(z,fxp) ! @@ -138,10 +138,11 @@ elemental subroutine sw_ps_9b(z,fxp) ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2) ! implicit none - real,intent(in):: z - real,intent(out):: fxp - real, dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & - ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) + real(kind=kind_phys), intent(in) :: z + real(kind=kind_phys), intent(out) :: fxp + real(kind=kind_phys), dimension(9), parameter :: & + f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & + ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) ! if(z>0) then fxp=1.0-(f(1)*exp(-z/gamma(1))+f(2)*exp(-z/gamma(2))+f(3)*exp(-z/gamma(3))+ & @@ -159,7 +160,7 @@ end subroutine sw_ps_9b !====================== ! !>\ingroup gfs_nst_main_mod -!! This subroutine +!! This subroutine elemental subroutine sw_ps_9b_aw(z,aw) ! ! d(fw)/d(z) for 9-band @@ -171,10 +172,11 @@ elemental subroutine sw_ps_9b_aw(z,aw) ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2) ! implicit none - real,intent(in):: z - real,intent(out):: aw - real, dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & - ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) + real(kind=kind_phys), intent(in) :: z + real(kind=kind_phys), intent(out) :: aw + real(kind=kind_phys), dimension(9), parameter :: & + f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & + ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) ! if(z>0) then aw=(f(1)/gamma(1))*exp(-z/gamma(1))+(f(2)/gamma(2))*exp(-z/gamma(2))+(f(3)/gamma(3))*exp(-z/gamma(3))+ & From 793ec64226a3f9bcabe6cf67c937b5b473ac7c24 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 9 Nov 2023 12:54:23 -0500 Subject: [PATCH 084/249] add extra condition in line 2655 of module_sf_noahmp_glacier.F90 to avoid FPE errors in some tests --- physics/module_sf_noahmp_glacier.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/module_sf_noahmp_glacier.F90 b/physics/module_sf_noahmp_glacier.F90 index 6e34c43af..fcbe40a70 100644 --- a/physics/module_sf_noahmp_glacier.F90 +++ b/physics/module_sf_noahmp_glacier.F90 @@ -2652,7 +2652,7 @@ subroutine snowwater_glacier (nsnow ,nsoil ,imelt ,dt ,sfctmp , & !in !to obtain equilibrium state of snow in glacier region - if(sneqv > mwd) then ! 100 mm -> maximum water depth + if(sneqv > mwd .and. isnow /= 0) then ! 100 mm -> maximum water depth bdsnow = snice(0) / dzsnso(0) snoflow = (sneqv - mwd) snice(0) = snice(0) - snoflow From d595541a964499d15c9664092dbbe76f21487763 Mon Sep 17 00:00:00 2001 From: tanyasmirnova Date: Thu, 9 Nov 2023 23:43:13 +0000 Subject: [PATCH 085/249] Computation of surface fire heat for use in LSM to rrfs_smoke_wrapper. Also, added the fraction of grid cell that is burned out. --- physics/smoke_dust/module_plumerise1.F90 | 4 ---- physics/smoke_dust/module_smoke_plumerise.F90 | 12 ++---------- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 18 +++++++++++------- physics/smoke_dust/rrfs_smoke_wrapper.meta | 8 ++++++++ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/physics/smoke_dust/module_plumerise1.F90 b/physics/smoke_dust/module_plumerise1.F90 index 189bf981a..3c23faa6a 100755 --- a/physics/smoke_dust/module_plumerise1.F90 +++ b/physics/smoke_dust/module_plumerise1.F90 @@ -38,7 +38,6 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & t_phy,q_vap, & ! RAR: moist is replaced with q_vap rho_phy,vvel,u_phy,v_phy,p_phy, & z_at_w,z,g,con_cp,con_rd, & ! scale_fire_emiss is part of config_flags - fire_heat_flux,dxy, & plume_frp, k_min, k_max, & ! RAR: ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & @@ -67,8 +66,6 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & real(kind=kind_phys), INTENT(IN ) :: g, con_cp, con_rd real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: ebb_smoke real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(OUT ) :: flam_frac - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(OUT ) :: fire_heat_flux - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: dxy ! real(kind=kind_phys), DIMENSION( ims:ime, 1, jms:jme ), & ! INTENT(IN ) :: ebu_in @@ -187,7 +184,6 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & !num_ebu, eburn_in, eburn_out, & u_in, v_in, w_in, theta_in ,pi_in, & rho_phyin, qv_in, zmid, z_lev, & - fire_heat_flux(i,j),dxy(i,j), & plume_frp(i,j,1), k_min(i,j), & k_max(i,j), dbg_opt, g, con_cp, & con_rd, cpor, errmsg, errflg ) diff --git a/physics/smoke_dust/module_smoke_plumerise.F90 b/physics/smoke_dust/module_smoke_plumerise.F90 index 9c0dfa49d..61be06181 100755 --- a/physics/smoke_dust/module_smoke_plumerise.F90 +++ b/physics/smoke_dust/module_smoke_plumerise.F90 @@ -28,7 +28,6 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & ! firesize,mean_fct, & ! nspecies,eburn_in,eburn_out, & up,vp,wp,theta,pp,dn0,rv,zt_rams,zm_rams, & - fire_heat_flux, dxy, & frp_inst,k1,k2, dbg_opt, g, cp, rgas, & cpor, errmsg, errflg ) @@ -44,9 +43,6 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & integer :: ng,m1,m2,m3,ia,iz,ja,jz,ibcon,mynum,i,j,k,imm,ixx,ispc !,nspecies - real(kind=kind_phys), intent(in) :: dxy - real(kind=kind_phys), intent(out) :: fire_heat_flux ! JLS - INTEGER, INTENT (OUT) :: k1,k2 character(*), intent(inout) :: errmsg integer, intent(inout) :: errflg @@ -110,7 +106,6 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & IF (frp_inst Date: Thu, 9 Nov 2023 23:56:17 +0000 Subject: [PATCH 086/249] Small changes to fire feedback to RUC LSM. One more variable is added: fraction of grid cell burned by the fire. This fraction is used to take into account fire's effect on surface albedo. Also, added some debug prints. These changes will change the results only when fire feedback is turned on. The default is .false. --- physics/lsm_ruc.F90 | 24 ++++++++++++++++-------- physics/lsm_ruc.meta | 8 ++++++++ physics/module_sf_ruclsm.F90 | 17 +++++++++++++++-- 3 files changed, 39 insertions(+), 10 deletions(-) diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index 79bcbf7b1..ba1b1b4e9 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -360,6 +360,7 @@ subroutine lsm_ruc_run & ! inputs & cm_ice, ch_ice, snowfallac_ice, acsnow_ice, snowmt_ice, & & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & & add_fire_heat_flux, fire_heat_flux_out, & + & frac_grid_burned_out, & ! --- out & rhosnf, sbsno, & & cmm_lnd, chh_lnd, cmm_ice, chh_ice, & @@ -431,7 +432,8 @@ subroutine lsm_ruc_run & ! inputs ! --- in real (kind_phys), dimension(:), intent(in) :: & & rainnc, rainc, ice, snow, graupel, rhonewsn1 - real (kind_phys), dimension(:), intent(in) :: fire_heat_flux_out + real (kind_phys), dimension(:), intent(in) :: fire_heat_flux_out, & + frac_grid_burned_out logical, intent(in) :: add_fire_heat_flux ! --- in/out: ! --- on RUC levels @@ -984,13 +986,6 @@ subroutine lsm_ruc_run & ! inputs snoalb1d_lnd(i,j) = snoalb(i) albbck_lnd(i,j) = min(0.9_kind_phys,albbcksol(i)) !sfalb_lnd_bck(i) - IF ( add_fire_heat_flux .and. fire_heat_flux_out(i) > 0) then ! JLS - ! limit albedo and greenness in the areas affected by the fire - albbck_lnd(i,j) = min(0.1_kind_phys,albbck_lnd(i,j)) - shdfac(i,j) = min(50._kind_phys,shdfac(i,j)) ! % - ENDIF - - !-- spp_lsm if (spp_lsm == 1) then !-- spp for LSM is dimentioned as (1:lsoil_ruc) @@ -1013,6 +1008,19 @@ subroutine lsm_ruc_run & ! inputs alb_lnd(i,j) = albbck_lnd(i,j) * (one-sncovr_lnd(i,j)) + snoalb(i) * sncovr_lnd(i,j) ! sfalb_lnd(i) solnet_lnd(i,j) = dswsfc(i)*(one-alb_lnd(i,j)) !..net sw rad flx (dn-up) at sfc in w/m2 + IF ( add_fire_heat_flux .and. fire_heat_flux_out(i) > 0) then ! JLS + if (debug_print) then + print *,'alb_lnd before fire, xlat/xlon ', alb_lnd(i,j), xlat_d(i),xlon_d(i) + print *,'fire_heat_flux_out, frac_grid_burned_out, xlat/xlon ', & + fire_heat_flux_out(i),frac_grid_burned_out(i),xlat_d(i),xlon_d(i) + endif + ! limit albedo in the areas affected by the fire + alb_lnd(i,j) = alb_lnd(i,j) * (one-frac_grid_burned_out(i)) + 0.08_kind_phys*frac_grid_burned_out(i) + if (debug_print) then + print *,'alb_lnd after fire, xlat/xlon ', alb_lnd(i,j), xlat_d(i),xlon_d(i) + endif + ENDIF + cmc(i,j) = canopy(i) ! [mm] soilt_lnd(i,j) = tsurf_lnd(i) ! sanity check for snow temperature tsnow diff --git a/physics/lsm_ruc.meta b/physics/lsm_ruc.meta index 4cc6a9419..9bc7fa10a 100644 --- a/physics/lsm_ruc.meta +++ b/physics/lsm_ruc.meta @@ -1762,6 +1762,14 @@ type = real kind = kind_phys intent = in +[frac_grid_burned_out] + standard_name = fraction_of_grid_cell_burning + long_name = ration of the burnt area to the grid cell area + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 47c03c49d..52fbc8123 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -1825,7 +1825,10 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia UPFLUX = T3 *SOILT XINET = EMISS_snowfree*(GLW-UPFLUX) RNET = GSWnew + XINET - IF ( add_fire_heat_flux ) then ! JLS + IF ( add_fire_heat_flux .and. fire_heat_flux >0 ) then ! JLS + IF (debug_print ) THEN + print *,'RNET snow-free, fire_heat_flux, xlat/xlon',RNET, fire_heat_flux,xlat,xlon + ENDIF RNET = RNET + fire_heat_flux ENDIF @@ -1949,7 +1952,10 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia if (SEAICE .LT. 0.5_kind_phys) then ! LAND - IF ( add_fire_heat_flux ) then ! JLS + IF ( add_fire_heat_flux .and. fire_heat_flux>0 ) then ! JLS + IF (debug_print ) THEN + print *,'RNET snow, fire_heat_flux, xlat/xlon',RNET, fire_heat_flux,xlat,xlon + ENDIF RNET = RNET + fire_heat_flux ENDIF if(snow_mosaic==one)then @@ -2242,6 +2248,13 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia if(SEAICE .LT. 0.5_kind_phys) then ! LAND + IF ( add_fire_heat_flux .and. fire_heat_flux>0) then ! JLS + IF (debug_print ) THEN + print *,'RNET no snow, fire_heat_flux, xlat/xlon',RNET, fire_heat_flux,xlat,xlon + endif + RNET = RNET + fire_heat_flux + ENDIF + CALL SOIL(debug_print,xlat, xlon, testptlat, testptlon,& !--- input variables i,j,iland,isoil,delt,ktau,conflx,nzs,nddzs,nroot, & From 6397387e0eb523039806d43e06d7ecf762fc48f5 Mon Sep 17 00:00:00 2001 From: Denise Worthen Date: Fri, 10 Nov 2023 07:14:05 -0700 Subject: [PATCH 087/249] clean up type mix-matches * add one,zero and half * fix instances of reals compared to integer and integers used in real expressions --- physics/module_nst_water_prop.f90 | 119 +++++++++++++++--------------- 1 file changed, 60 insertions(+), 59 deletions(-) diff --git a/physics/module_nst_water_prop.f90 b/physics/module_nst_water_prop.f90 index 7f0f480ae..5d71ce82d 100644 --- a/physics/module_nst_water_prop.f90 +++ b/physics/module_nst_water_prop.f90 @@ -12,6 +12,8 @@ module module_nst_water_prop public :: rhocoef,density,sw_rad,sw_rad_aw,sw_rad_sum,sw_rad_upper,sw_rad_upper_aw,sw_rad_skin,grv,solar_time_from_julian,compjd, & sw_ps_9b,sw_ps_9b_aw,get_dtzm_point,get_dtzm_2d + integer, parameter :: kp = kind_phys + real (kind=kind_phys), parameter :: zero = 0.0_kp, one = 1.0_kp, half=0.5_kp ! interface sw_ps_9b module procedure sw_ps_9b @@ -78,7 +80,7 @@ subroutine rhocoef(t, s, rhoref, alpha, beta) + 7.6438e-5 * tc**2 - 8.2467e-7 * tc**3 & + 5.3875e-9 * tc**4 - 1.5 * 5.72466e-3 * s**.5 & + 1.5 * 1.0227e-4 * tc * s**.5 & - - 1.5 * 1.6546e-6 * tc**2 * s**.5 & + - 1.5 * 1.6546e-6 * tc**2 * s**.5 & + 2.0 * 4.8314e-4 * s beta = beta / rhoref @@ -104,7 +106,7 @@ subroutine density(t, s, rho) ! introduction to dynamical oceanography, pp310). ! compression effects are not included - rho = 0.0 + rho = zero tc = t - t0k ! effect of temperature on density (lines 1-3) @@ -144,12 +146,12 @@ elemental subroutine sw_ps_9b(z,fxp) f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) ! - if(z>0) then - fxp=1.0-(f(1)*exp(-z/gamma(1))+f(2)*exp(-z/gamma(2))+f(3)*exp(-z/gamma(3))+ & + if(z>zero) then + fxp=one-(f(1)*exp(-z/gamma(1))+f(2)*exp(-z/gamma(2))+f(3)*exp(-z/gamma(3))+ & f(4)*exp(-z/gamma(4))+f(5)*exp(-z/gamma(5))+f(6)*exp(-z/gamma(6))+ & f(7)*exp(-z/gamma(7))+f(8)*exp(-z/gamma(8))+f(9)*exp(-z/gamma(9))) else - fxp=0. + fxp=zero endif ! end subroutine sw_ps_9b @@ -178,12 +180,12 @@ elemental subroutine sw_ps_9b_aw(z,aw) f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) ! - if(z>0) then + if(z>zero) then aw=(f(1)/gamma(1))*exp(-z/gamma(1))+(f(2)/gamma(2))*exp(-z/gamma(2))+(f(3)/gamma(3))*exp(-z/gamma(3))+ & (f(1)/gamma(4))*exp(-z/gamma(4))+(f(2)/gamma(5))*exp(-z/gamma(5))+(f(6)/gamma(6))*exp(-z/gamma(6))+ & (f(1)/gamma(7))*exp(-z/gamma(7))+(f(2)/gamma(8))*exp(-z/gamma(8))+(f(9)/gamma(9))*exp(-z/gamma(9)) else - aw=0. + aw=zero endif ! end subroutine sw_ps_9b_aw @@ -212,12 +214,12 @@ elemental subroutine sw_fairall_6exp_v1(z,fxp) real(kind=kind_phys),dimension(9) :: zgamma real(kind=kind_phys),dimension(9) :: f_c ! - if(z>0) then + if(z>zero) then zgamma=z/gamma - f_c=f*(1.-1./zgamma*(1-exp(-zgamma))) + f_c=f*(one-one/zgamma*(one-exp(-zgamma))) fxp=sum(f_c) else - fxp=0. + fxp=zero endif ! end subroutine sw_fairall_6exp_v1 @@ -251,15 +253,15 @@ elemental subroutine sw_fairall_6exp_v1_aw(z,aw) real(kind=kind_phys),dimension(9) :: zgamma real(kind=kind_phys),dimension(9) :: f_aw ! - if(z>0) then + if(z>zero) then zgamma=z/gamma - f_aw=(f/z)*((gamma/z)*(1-exp(-zgamma))-exp(-zgamma)) + f_aw=(f/z)*((gamma/z)*(one-exp(-zgamma))-exp(-zgamma)) aw=sum(f_aw) ! write(*,'(a,f6.2,f12.6,9f10.4)') 'z,aw in sw_rad_aw : ',z,aw,f_aw else - aw=0. + aw=zero endif ! end subroutine sw_fairall_6exp_v1_aw @@ -293,9 +295,9 @@ elemental subroutine sw_fairall_6exp_v1_sum(z,sum) ! f_sum=(zgamma/z)*exp(-zgamma) ! sum=sum(f_sum) - sum=(1.0/gamma(1))*exp(-z/gamma(1))+(1.0/gamma(2))*exp(-z/gamma(2))+(1.0/gamma(3))*exp(-z/gamma(3))+ & - (1.0/gamma(4))*exp(-z/gamma(4))+(1.0/gamma(5))*exp(-z/gamma(5))+(1.0/gamma(6))*exp(-z/gamma(6))+ & - (1.0/gamma(7))*exp(-z/gamma(7))+(1.0/gamma(8))*exp(-z/gamma(8))+(1.0/gamma(9))*exp(-z/gamma(9)) + sum=(one/gamma(1))*exp(-z/gamma(1))+(one/gamma(2))*exp(-z/gamma(2))+(one/gamma(3))*exp(-z/gamma(3))+ & + (one/gamma(4))*exp(-z/gamma(4))+(one/gamma(5))*exp(-z/gamma(5))+(one/gamma(6))*exp(-z/gamma(6))+ & + (one/gamma(7))*exp(-z/gamma(7))+(one/gamma(8))*exp(-z/gamma(8))+(one/gamma(9))*exp(-z/gamma(9)) ! end subroutine sw_fairall_6exp_v1_sum ! @@ -321,10 +323,10 @@ elemental subroutine sw_fairall_simple_v1(f_sol_0,z,df_sol_z) real(kind=kind_phys),intent(in):: z,f_sol_0 real(kind=kind_phys),intent(out):: df_sol_z ! - if(z>0) then - df_sol_z=f_sol_0*(0.137+11.0*z-6.6e-6/z*(1.-exp(-z/8.e-4))) + if(z>zero) then + df_sol_z=f_sol_0*(0.137+11.0*z-6.6e-6/z*(one-exp(-z/8.e-4))) else - df_sol_z=0. + df_sol_z=zero endif ! end subroutine sw_fairall_simple_v1 @@ -352,10 +354,10 @@ elemental subroutine sw_wick_v1(f_sol_0,z,df_sol_z) real(kind=kind_phys),intent(in):: z,f_sol_0 real(kind=kind_phys),intent(out):: df_sol_z ! - if(z>0) then - df_sol_z=f_sol_0*(0.065+11.0*z-6.6e-5/z*(1.-exp(-z/8.e-4))) + if(z>zero) then + df_sol_z=f_sol_0*(0.065+11.0*z-6.6e-5/z*(one-exp(-z/8.e-4))) else - df_sol_z=0. + df_sol_z=zero endif ! end subroutine sw_wick_v1 @@ -388,11 +390,11 @@ elemental subroutine sw_soloviev_3exp_v1(f_sol_0,z,df_sol_z) real(kind=kind_phys), dimension(3), parameter :: f=(/0.45,0.27,0.28/) & ,gamma=(/12.8,0.357,0.014/) ! - if(z>0) then - f_c = f*gamma(int(1-exp(-z/gamma))) - df_sol_z = f_sol_0*(1.0-sum(f_c)/z) + if(z>zero) then + f_c = f*gamma(int(one-exp(-z/gamma))) + df_sol_z = f_sol_0*(one-sum(f_c)/z) else - df_sol_z = 0. + df_sol_z = zero endif ! end subroutine sw_soloviev_3exp_v1 @@ -416,14 +418,14 @@ elemental subroutine sw_soloviev_3exp_v2(f_sol_0,z,df_sol_z) real(kind=kind_phys),intent(in):: z,f_sol_0 real(kind=kind_phys),intent(out):: df_sol_z ! - if(z>0) then - df_sol_z=f_sol_0*(1.0 & - -(0.28*0.014*(1.-exp(-z/0.014)) & - +0.27*0.357*(1.-exp(-z/0.357)) & - +.45*12.82*(1.-exp(-z/12.82)))/z & + if(z>zero) then + df_sol_z=f_sol_0*(one & + -(0.28*0.014*(one-exp(-z/0.014)) & + + 0.27*0.357*(one-exp(-z/0.357)) & + + 0.45*12.82*(one-exp(-z/12.82)))/z & ) else - df_sol_z=0. + df_sol_z=zero endif ! end subroutine sw_soloviev_3exp_v2 @@ -445,15 +447,15 @@ elemental subroutine sw_soloviev_3exp_v2_aw(z,aw) real(kind=kind_phys),intent(out):: aw real(kind=kind_phys):: fxp ! - if(z>0) then - fxp=(1.0 & - -(0.28*0.014*(1.-exp(-z/0.014)) & - + 0.27*0.357*(1.-exp(-z/0.357)) & - + 0.45*12.82*(1.-exp(-z/12.82)))/z & + if(z>zero) then + fxp=(one & + -(0.28*0.014*(one-exp(-z/0.014)) & + + 0.27*0.357*(one-exp(-z/0.357)) & + + 0.45*12.82*(one-exp(-z/12.82)))/z & ) - aw=1.0-fxp-(0.28*exp(-z/0.014)+0.27*exp(-z/0.357)+0.45*exp(-z/12.82)) + aw=one-fxp-(0.28*exp(-z/0.014)+0.27*exp(-z/0.357)+0.45*exp(-z/12.82)) else - aw=0. + aw=zero endif end subroutine sw_soloviev_3exp_v2_aw ! @@ -475,10 +477,10 @@ elemental subroutine sw_ohlmann_v1(z,fxp) real(kind=kind_phys),intent(in):: z real(kind=kind_phys),intent(out):: fxp ! - if(z>0) then - fxp=.065+11.*z-6.6e-5/z*(1.-exp(-z/8.0e-4)) + if(z>zero) then + fxp=.065+11.*z-6.6e-5/z*(one-exp(-z/8.0e-4)) else - fxp=0. + fxp=zero endif ! end subroutine sw_ohlmann_v1 @@ -497,7 +499,7 @@ function grv(lat) phi=lat*pi/180 x=sin(phi) - grv=gamma*(1+(c1*x**2)+(c2*x**4)+(c3*x**6)+(c4*x**8)) + grv=gamma*(one+(c1*x**2)+(c2*x**4)+(c3*x**6)+(c4*x**8)) !print *,'grav=',grv,lat end function grv @@ -511,14 +513,14 @@ subroutine solar_time_from_julian(jday,xlon,soltim) real(kind=kind_phys), intent(in) :: jday real(kind=kind_phys), intent(in) :: xlon real(kind=kind_phys), intent(out) :: soltim - real(kind=kind_phys) :: fjd,xhr,xmin,xsec,intime + real(kind=kind_phys) :: fjd,xhr,xmin,xsec,intime integer :: nn ! fjd=jday-floor(jday) fjd=jday - xhr=floor(fjd*24.0)-sign(12.0,fjd-0.5) - xmin=nint(fjd*1440.0)-(xhr+sign(12.0,fjd-0.5))*60 - xsec=0 + xhr=floor(fjd*24.0)-sign(12.0,fjd-half) + xmin=nint(fjd*1440.0)-(xhr+sign(12.0,fjd-half))*60.0 + xsec=zero intime=xhr+xmin/60.0+xsec/3600.0+24.0 soltim=mod(xlon/15.0+intime,24.0)*3600.0 end subroutine solar_time_from_julian @@ -570,7 +572,7 @@ subroutine compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd) jd=iw3jdn(jyr,jmnth,jday) if(jhr.lt.12) then jd=jd-1 - fjd=0.5+jhr/24.+jmn/1440. + fjd=half+jhr/24.+jmn/1440. else fjd=(jhr-12)/24.+jmn/1440. endif @@ -618,35 +620,35 @@ subroutine get_dtzm_point(xt,xz,dt_cool,zc,z1,z2,dtm) ! ! get the mean warming in the range of z=z1 to z=z2 ! - dtw = 0.0 - if ( xt > 0.0 ) then + dtw = zero + if ( xt > zero ) then dt_warm = (xt+xt)/xz ! Tw(0) if ( z1 < z2) then if ( z2 < xz ) then - dtw = dt_warm*(1.0-(z1+z2)/(xz+xz)) + dtw = dt_warm*(one-(z1+z2)/(xz+xz)) elseif ( z1 < xz .and. z2 >= xz ) then - dtw = 0.5*(1.0-z1/xz)*dt_warm*(xz-z1)/(z2-z1) + dtw = half*(one-z1/xz)*dt_warm*(xz-z1)/(z2-z1) endif elseif ( z1 == z2 ) then if ( z1 < xz ) then - dtw = dt_warm*(1.0-z1/xz) + dtw = dt_warm*(one-z1/xz) endif endif endif ! ! get the mean cooling in the range of z=z1 to z=z2 ! - dtc = 0.0 - if ( zc > 0.0 ) then + dtc = zero + if ( zc > zero ) then if ( z1 < z2) then if ( z2 < zc ) then - dtc = dt_cool*(1.0-(z1+z2)/(zc+zc)) + dtc = dt_cool*(one-(z1+z2)/(zc+zc)) elseif ( z1 < zc .and. z2 >= zc ) then - dtc = 0.5*(1.0-z1/zc)*dt_cool*(zc-z1)/(z2-z1) + dtc = half*(one-z1/zc)*dt_cool*(zc-z1)/(z2-z1) endif elseif ( z1 == z2 ) then if ( z1 < zc ) then - dtc = dt_cool*(1.0-z1/zc) + dtc = dt_cool*(one-z1/zc) endif endif endif @@ -706,7 +708,6 @@ subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm) ! Local variables integer :: i,j real (kind=kind_phys) :: dt_warm, dtw, dtc, xzi - real (kind=kind_phys), parameter :: zero=0.0, half=0.5, one=1.0 !$omp parallel do num_threads (nth) private(j,i,dtw,dtc,xzi) From 3714e76763a91841712bc38f1f7ef4cc2fe01730 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Mon, 13 Nov 2023 10:19:49 -0500 Subject: [PATCH 088/249] add parameter zero and clean up nst_parameters * fix type mis-match in call to int_epn using parameter zero in module_nst_model --- physics/module_nst_model.f90 | 196 ++++++++++++++++-------------- physics/module_nst_parameters.f90 | 50 ++++---- physics/physcons.F90 | 4 +- 3 files changed, 129 insertions(+), 121 deletions(-) diff --git a/physics/module_nst_model.f90 b/physics/module_nst_model.f90 index 980035fe6..d47ab838b 100644 --- a/physics/module_nst_model.f90 +++ b/physics/module_nst_model.f90 @@ -1,5 +1,5 @@ !>\file module_nst_model.f90 -!! This file contains the diurnal thermocline layer model (DTM) of +!! This file contains the diurnal thermocline layer model (DTM) of !! the GFS NSST scheme. !>\defgroup dtm_module GFS NSST Diurnal Thermocline Model @@ -12,7 +12,7 @@ module nst_module ! -! the module of diurnal thermocline layer model +! the module of diurnal thermocline layer model ! use machine , only : kind_phys use module_nst_parameters, only: z_w_max,z_w_min,z_w_ini,eps_z_w,eps_conv, & @@ -23,6 +23,14 @@ module nst_module use module_nst_water_prop, only: sw_rad_skin,sw_ps_9b,sw_ps_9b_aw implicit none + private + + integer, parameter :: kp = kind_phys + real (kind=kind_phys), parameter :: zero = 0.0_kp, one = 1.0_kp + + public :: dtm_1p, dtm_1p_fca, dtm_1p_tla, dtm_1p_mwa, dtm_1p_mda, dtm_1p_mta, convdepth + public :: cal_w, cal_ttop, cool_skin, dtl_reset + contains !>\ingroup gfs_nst_main_mod @@ -72,12 +80,12 @@ subroutine dtm_1p(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & ! logical lprnt ! if (lprnt) print *,' first xt=',xt - if ( xt <= 0.0 ) then ! dtl doesn't exist yet + if ( xt <= zero ) then ! dtl doesn't exist yet call dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& beta,alon,sinlat,soltim,grav,le,xt,xs,xu,xv,xz,xzts,xtts) - elseif ( xt > 0.0 ) then ! dtl already exists + elseif ( xt > zero ) then ! dtl already exists ! -! forward the system one time step +! forward the system one time step ! call eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha, & beta,alon,sinlat,soltim,grav,le,d_conv, & @@ -150,7 +158,7 @@ subroutine eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& xtts0 = xtts xzts0 = xzts speed = max(1.0e-8, xu0*xu0+xv0*xv0) - + alat = asin(sinlat)*rad2deg fc = const_rot*sinlat @@ -177,7 +185,7 @@ subroutine eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& ! if (lprnt) print *,' xt1=',xt1,' xz1=',xz1,' xz0=',xz0,' dzw=',dzw, & ! 'timestep=',timestep,tox,toy,xu0,xv0,rho,drho,grav,rich - if ( xt1 <= 0.0 .or. xz1 <= 0.0 .or. xz1 > z_w_max ) then + if ( xt1 <= zero .or. xz1 <= zero .or. xz1 > z_w_max ) then call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) return endif @@ -189,7 +197,7 @@ subroutine eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& +( (tox*xu0+toy*xv0)/rho+(3.0*drho-alpha*i0*aw*xz0/(rho*cp_w)) & *grav*xz0*xz0/(4.0*rich) )*xzts0 )) xtts1 = xtts0 + timestep*(i0*aw*xzts0-q_ts)/(rho*cp_w) - + ! if ( 2.0*xt1/xz1 > 0.001 ) then ! write(*,'(a,i5,2f8.3,4f8.2,f10.6,10f8.4)') 'eulerm_01 : ',kdt,alat,alon,soltim/3600.,i0,q,q_warm,sep,& ! 2.0*xt1/xz1,2.0*xs1/xz1,2.0*xu1/xz1,2.0*xv1/xz1,xz1,xtts1,xzts1,d_conv,t_fcl,te @@ -210,7 +218,7 @@ subroutine eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& ! if (lprnt) print *,' xt2=',xt2,' xz2=',xz2 - if ( xt2 <= 0.0 .or. xz2 <= 0.0 .or. xz2 > z_w_max ) then + if ( xt2 <= zero .or. xz2 <= zero .or. xz2 > z_w_max ) then call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) return endif @@ -229,7 +237,7 @@ subroutine eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& xzts = 0.5*(xzts1 + xzts2) xtts = 0.5*(xtts1 + xtts2) - if ( xt <= 0.0 .or. xz < 0.0 .or. xz > z_w_max ) then + if ( xt <= zero .or. xz < zero .or. xz > z_w_max ) then call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) endif @@ -249,7 +257,7 @@ subroutine dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt,xs,xu,xv,xz,tr_mda,tr_fca, ! free convection adjustment (fca); ! top layer adjustment (tla); ! maximum warming adjustment (mwa) -! +! integer, intent(in) :: kdt real(kind=kind_phys), intent(in) :: timestep,i0,q,rho,d_conv real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz @@ -260,16 +268,16 @@ subroutine dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt,xs,xu,xv,xz,tr_mda,tr_fca, ! real(kind=kind_phys) xz_mda - tr_mda = 0.0; tr_fca = 0.0; tr_tla = 0.0; tr_mwa = 0.0 + tr_mda = zero; tr_fca = zero; tr_tla = zero; tr_mwa = zero ! apply mda if ( z_w_min > xz ) then xz_mda = z_w_min endif ! apply fca - if ( d_conv > 0.0 ) then + if ( d_conv > zero ) then xz_fca = 2.0*xt/((2.0*xt/xz)*(1.0-d_conv/(2.0*xz))) - tr_fca = 1.0 + tr_fca = 1.0 if ( xz_fca >= z_w_max ) then call dtl_reset_cv(xt,xs,xu,xv,xz) go to 10 @@ -280,13 +288,13 @@ subroutine dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt,xs,xu,xv,xz,tr_mda,tr_fca, call sw_ps_9b(dz,fw) q_warm=fw*i0-q !total heat abs in warm layer - if ( q_warm > 0.0 ) then + if ( q_warm > zero ) then call cal_ttop(kdt,timestep,q_warm,rho,dz,xt,xz,ttop0) ! ttop = (2.0*xt/xz)*(1.0-dz/(2.0*xz)) ttop = ((xt+xt)/xz)*(1.0-dz/(xz+xz)) if ( ttop > ttop0 ) then xz_tla = (xt+sqrt(xt*(xt-delz*ttop0)))/ttop0 - tr_tla = 1.0 + tr_tla = 1.0 if ( xz_tla >= z_w_max ) then call dtl_reset_cv(xt,xs,xu,xv,xz) go to 10 @@ -306,7 +314,7 @@ subroutine dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt,xs,xu,xv,xz,tr_mda,tr_fca, xz = max(xz_mda,xz_fca,xz_tla,xz_mwa) 10 continue - + end subroutine dtm_1p_zwa !>\ingroup gfs_nst_main_mod @@ -314,7 +322,7 @@ end subroutine dtm_1p_zwa subroutine dtm_1p_fca(d_conv,xt,xtts,xz,xzts) ! apply xz adjustment: free convection adjustment (fca); -! +! real(kind=kind_phys), intent(in) :: d_conv,xt,xtts real(kind=kind_phys), intent(inout) :: xz,xzts ! local variables @@ -332,14 +340,14 @@ end subroutine dtm_1p_fca subroutine dtm_1p_tla(dz,te,xt,xtts,xz,xzts) ! apply xz adjustment: top layer adjustment (tla); -! +! real(kind=kind_phys), intent(in) :: dz,te,xt,xtts real(kind=kind_phys), intent(inout) :: xz,xzts ! local variables real(kind=kind_phys) tem ! tem = xt*(xt-dz*te) - if (tem > 0.0) then + if (tem > zero) then xz = (xt+sqrt(xt*(xt-dz*te)))/te else xz = z_w_max @@ -389,8 +397,8 @@ subroutine dtm_1p_mta(dta,xt,xtts,xz,xzts) ! local variables real(kind=kind_phys) :: ta ! - ta = max(0.0,2.0*xt/xz-dta) - if ( ta > 0.0 ) then + ta = max(zero,2.0*xt/xz-dta) + if ( ta > zero ) then xz = 2.0*xt/ta else xz = z_w_max @@ -441,39 +449,39 @@ subroutine convdepth(kdt,timestep,i0,q,sss,sep,rho,alpha,beta,xt,xs,xz,d_conv) s1 = alpha*rho*t-omg_m*beta*rho*s - if ( s1 == 0.0 ) then - d_conv = 0.0 + if ( s1 == zero ) then + d_conv = zero else fac1 = alpha*q/cp_w+omg_m*beta*rho*sep - if ( i0 <= 0.0 ) then + if ( i0 <= zero ) then d_conv2=(2.0*xz*timestep/s1)*fac1 - if ( d_conv2 > 0.0 ) then + if ( d_conv2 > zero ) then d_conv = sqrt(d_conv2) else - d_conv = 0.0 + d_conv = zero endif - elseif ( i0 > 0.0 ) then + elseif ( i0 > zero ) then - d_conv_ini = 0.0 + d_conv_ini = zero iter_conv: do n = 1, niter_conv call sw_ps_9b(d_conv_ini,fxp) call sw_ps_9b_aw(d_conv_ini,aw) s2 = alpha*(q-(fxp-aw*d_conv_ini)*i0)/cp_w+omg_m*beta*rho*sep d_conv2=(2.0*xz*timestep/s1)*s2 - if ( d_conv2 < 0.0 ) then - d_conv = 0.0 + if ( d_conv2 < zero ) then + d_conv = zero exit iter_conv endif d_conv = sqrt(d_conv2) if ( abs(d_conv-d_conv_ini) < eps_conv .and. n <= niter_conv ) exit iter_conv d_conv_ini = d_conv enddo iter_conv - d_conv = max(0.0,min(d_conv,z_w_max)) - endif ! if ( i0 <= 0.0 ) then + d_conv = max(zero,min(d_conv,z_w_max)) + endif ! if ( i0 <= zero ) then - endif ! if ( s1 == 0.0 ) then + endif ! if ( s1 == zero ) then ! if ( d_conv > 0.01 ) then ! write(*,'(a,i4,i3,10f9.3,3f10.6,f10.1,f6.2)') ' d_conv : ',kdt,n,d_conv,d_conv_ini,q,i0,rho,cp_w,timestep,xt,xs,xz,sep, & @@ -488,7 +496,7 @@ subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & ! ! determine xz iteratively (starting wit fw = 0.5) and then update the other 6 variables ! - + integer,intent(in) :: kdt real(kind=kind_phys), intent(in) :: timestep,rich,tox,toy,i0,q,sss,sep,q_ts,& hl_ts,rho,alpha,beta,alon,sinlat,soltim,grav,le @@ -519,9 +527,9 @@ subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & ! output variables ! ! xt : onset t content in dtl -! xs : onset s content in dtl -! xu : onset u content in dtl -! xv : onset v content in dtl +! xs : onset s content in dtl +! xu : onset u content in dtl +! xv : onset v content in dtl ! xz : onset dtl thickness (m) ! xzts : onset d(xz)/d(ts) (m/k ) ! xtts : onset d(xt)/d(ts) (m) @@ -531,15 +539,15 @@ subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & ! ! initializing dtl (just before the onset) ! - xt0 = 0.0 - xs0 = 0.0 - xu0 = 0.0 - xv0 = 0.0 + xt0 = zero + xs0 = zero + xu0 = zero + xv0 = zero z_w_tmp=z_w_ini call sw_ps_9b(z_w_tmp,fw) -! fw=0.5 ! +! fw=0.5 ! q_warm=fw*i0-q !total heat abs in warm layer if ( abs(alat) > 1.0 ) then @@ -552,9 +560,9 @@ subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & coeff2=omg_m*beta*grav*rho warml = coeff1*q_warm-coeff2*sep - if ( warml > 0.0 .and. q_warm > 0.0) then + if ( warml > zero .and. q_warm > zero) then iters_z_w: do n = 1,niter_z_w - if ( warml > 0.0 .and. q_warm > 0.0 ) then + if ( warml > zero .and. q_warm > zero ) then z_w=sqrt(2.0*rich*ftime/rho)*sqrt(tox**2+toy**2)/sqrt(warml) else z_w = z_w_max @@ -578,7 +586,7 @@ subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & ! ! update xt, xs, xu, xv ! - if ( z_w < z_w_max .and. q_warm > 0.0) then + if ( z_w < z_w_max .and. q_warm > zero) then call sw_ps_9b(z_w,fw) q_warm=fw*i0-q !total heat abs in warm layer @@ -599,7 +607,7 @@ subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & xz1 = max(xz1,z_w_min) - if ( xt1 < 0.0 .or. xz1 > z_w_max ) then + if ( xt1 < zero .or. xz1 > z_w_max ) then call dtl_reset(xt,xs,xu,xv,xz,xtts,xzts) return endif @@ -630,16 +638,16 @@ subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & xtts = timestep*(i0*aw*xzts-q_ts)/(rho*cp_w) endif - if ( xt < 0.0 .or. xz > z_w_max ) then + if ( xt < zero .or. xz > z_w_max ) then call dtl_reset(xt,xs,xu,xv,xz,xtts,xzts) endif - + return end subroutine dtm_onset !>\ingroup gfs_nst_main_mod -!! This subroutine computes coefficients (\a w_0 and \a w_d) to +!! This subroutine computes coefficients (\a w_0 and \a w_d) to !! calculate d(tw)/d(ts). subroutine cal_w(kdt,xz,xt,xzts,xtts,w_0,w_d) ! @@ -648,15 +656,15 @@ subroutine cal_w(kdt,xz,xt,xzts,xtts,w_0,w_d) ! input variables ! ! kdt : the number of time step -! xt : dtl heat content -! xz : dtl depth +! xt : dtl heat content +! xz : dtl depth ! xzts : d(zw)/d(ts) ! xtts : d(xt)/d(ts) ! ! output variables ! -! w_0 : coefficint 1 to calculate d(tw)/d(ts) -! w_d : coefficint 2 to calculate d(tw)/d(ts) +! w_0 : coefficint 1 to calculate d(tw)/d(ts) +! w_d : coefficint 2 to calculate d(tw)/d(ts) integer, intent(in) :: kdt real(kind=kind_phys), intent(in) :: xz,xt,xzts,xtts @@ -719,11 +727,11 @@ subroutine app_sfs(kdt,xt,xs,xu,xv,alpha,beta,grav,d_1p,xz) ! alpha ! beta ! grav -! d_1p : dtl depth before sfs applied +! d_1p : dtl depth before sfs applied ! ! output variables ! -! xz : dtl depth +! xz : dtl depth integer, intent(in) :: kdt real(kind=kind_phys), intent(in) :: xt,xs,xu,xv,alpha,beta,grav,d_1p @@ -736,10 +744,10 @@ subroutine app_sfs(kdt,xt,xs,xu,xv,alpha,beta,grav,d_1p,xz) cc = ri_g/(grav*c2) tem = alpha*xt - beta*xs - if (tem > 0.0) then + if (tem > zero) then d_sfs = sqrt(2.0*cc*(xu*xu+xv*xv)/tem) else - d_sfs = 0.0 + d_sfs = zero endif ! xz0 = d_1p @@ -750,10 +758,10 @@ subroutine app_sfs(kdt,xt,xs,xu,xv,alpha,beta,grav,d_1p,xz) ! if ( abs(d_sfs-xz0) < eps_sfs .and. n <= niter_sfs ) exit iter_sfs ! xz0 = d_sfs ! enddo iter_sfs - + ! ze = a2*d_sfs ! not used! - l = int_epn(0.0,d_sfs,0.0,d_sfs,2) + l = int_epn(zero,d_sfs,zero,d_sfs,2) ! t_sfs = xt/l ! xz = (xt+xt) / t_sfs @@ -774,20 +782,20 @@ subroutine cal_tztr(kdt,xt,c_0,c_d,w_0,w_d,zc,zw,z,tztr) ! kdt : the number of record ! xt : heat content in dtl ! xz : dtl depth (m) -! c_0 : coefficint 1 to calculate d(tc)/d(ts) -! c_d : coefficint 2 to calculate d(tc)/d(ts) -! w_0 : coefficint 1 to calculate d(tw)/d(ts) -! w_d : coefficint 2 to calculate d(tw)/d(ts) +! c_0 : coefficint 1 to calculate d(tc)/d(ts) +! c_d : coefficint 2 to calculate d(tc)/d(ts) +! w_0 : coefficint 1 to calculate d(tw)/d(ts) +! w_d : coefficint 2 to calculate d(tw)/d(ts) ! ! output variables ! -! tztr : d(tz)/d(tr) +! tztr : d(tz)/d(tr) integer, intent(in) :: kdt real(kind=kind_phys), intent(in) :: xt,c_0,c_d,w_0,w_d,zc,zw,z real(kind=kind_phys), intent(out) :: tztr - if ( xt > 0.0 ) then + if ( xt > zero ) then if ( z <= zc ) then ! tztr = 1.0/(1.0-w_0+c_0)+z*(w_d-c_d)/(1.0-w_0+c_0) tztr = (1.0+z*(w_d-c_d))/(1.0-w_0+c_0) @@ -797,7 +805,7 @@ subroutine cal_tztr(kdt,xt,c_0,c_d,w_0,w_d,zc,zw,z,tztr) elseif ( z >= zw ) then tztr = 1.0 endif - elseif ( xt == 0.0 ) then + elseif ( xt == zero ) then if ( z <= zc ) then ! tztr = 1.0/(1.0+c_0)-z*c_d/(1.0+c_0) tztr = (1.0-z*c_d)/(1.0+c_0) @@ -812,7 +820,7 @@ subroutine cal_tztr(kdt,xt,c_0,c_d,w_0,w_d,zc,zw,z,tztr) end subroutine cal_tztr !>\ingroup gfs_nst_main_mod -!> This subroutine contains the upper ocean cool-skin parameterization +!> This subroutine contains the upper ocean cool-skin parameterization !! (Fairall et al, 1996 \cite fairall_et_al_1996). subroutine cool_skin(ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q_ts,hl_ts,grav,le,deltat_c,z_c,c_0,c_d) ! @@ -831,8 +839,8 @@ subroutine cool_skin(ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q ! ts : oceanic surface temperature ! q_ts : d(q)/d(ts) : q = the sum of non-solar heat fluxes ! hl_ts : d(hl)/d(ts) -! grav : gravity -! le : +! grav : gravity +! le : ! ! output: ! deltat_c: cool-skin temperature correction (degrees k) @@ -876,33 +884,33 @@ subroutine cool_skin(ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q if ( deltaf > 0 ) then deltat_c = deltaf * z_c / kw else - deltat_c = 0. - z_c = 0. + deltat_c = zero + z_c = zero endif ! ! calculate c_0 & c_d ! - if ( z_c > 0.0 ) then + if ( z_c > zero ) then cc1 = 6.0*visw / (tcw*ustar1_a*sqrt(rho_a/rho_w)) cc2 = bigc*alpha / max(ustar_a,ustar_a_min)**4 cc3 = beta*sss*cp_w/(alpha*le) zcsq = z_c * z_c a_c = a2 + a3/zcsq - (a3/(a4*z_c)+a3/zcsq) * exp(-z_c/a4) - if ( hb > 0.0 .and. zcsq > 0.0 .and. alpha > 0.0) then + if ( hb > zero .and. zcsq > zero .and. alpha > zero) then bc1 = zcsq * (q_ts+cc3*hl_ts) bc2 = zcsq * f_sol_0*a_c - 4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*zcsq) zc_ts = bc1/bc2 ! b_c = z_c**2*(q_ts+cc3*hl_ts)/(z_c**2*f_sol_0*a_c-4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*z_c**2)) ! d(z_c)/d(ts) b_c = (q_ts+cc3*hl_ts)/(f_sol_0*a_c & - 4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*zcsq*zcsq)) ! d(z_c)/d(ts) - c_0 = (z_c*q_ts+(f_nsol-deltaf-f_sol_0*a_c*z_c)*b_c)*tcwi - c_d = (f_sol_0*a_c*z_c*b_c-q_ts)*tcwi + c_0 = (z_c*q_ts+(f_nsol-deltaf-f_sol_0*a_c*z_c)*b_c)*tcwi + c_d = (f_sol_0*a_c*z_c*b_c-q_ts)*tcwi else - b_c = 0.0 - zc_ts = 0.0 - c_0 = z_c*q_ts*tcwi + b_c = zero + zc_ts = zero + c_0 = z_c*q_ts*tcwi c_d = -q_ts*tcwi endif @@ -910,12 +918,12 @@ subroutine cool_skin(ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q ! write(*,'(a,2f12.6,10f10.6)') ' c_0, c_d = ',c_0,c_d,b_c,zc_ts,hb,bc1,bc2,z_c,cc1,cc2,cc3,z_c**2 ! endif -! c_0 = z_c*q_ts/tcw -! c_d = -q_ts/tcw +! c_0 = z_c*q_ts/tcw +! c_d = -q_ts/tcw else - c_0 = 0.0 - c_d = 0.0 + c_0 = zero + c_d = zero endif ! if ( z_c > 0.0 ) then end subroutine cool_skin @@ -935,7 +943,7 @@ real function int_epn(z1,z2,zmx,ztr,n) m = nint((z2-z1)/delz) fa = exp(-exp_const*((z1-zmx)/(ztr-zmx))**n) fb = exp(-exp_const*((z2-zmx)/(ztr-zmx))**n) - int = 0.0 + int = zero do i = 1, m-1 zi = z1 + delz*float(i) fi = exp(-exp_const*((zi-zmx)/(ztr-zmx))**n) @@ -948,10 +956,10 @@ end function int_epn !! This subroutine resets the value of xt,xs,xu,xv,xz. subroutine dtl_reset_cv(xt,xs,xu,xv,xz) real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz - xt = 0.0 - xs = 0.0 - xu = 0.0 - xv = 0.0 + xt = zero + xs = zero + xu = zero + xv = zero xz = z_w_max end subroutine dtl_reset_cv @@ -959,13 +967,13 @@ end subroutine dtl_reset_cv !! This subroutine resets the value of xt,xs,xu,xv,xz,xtts,xzts. subroutine dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz,xzts,xtts - xt = 0.0 - xs = 0.0 - xu = 0.0 - xv = 0.0 + xt = zero + xs = zero + xu = zero + xv = zero xz = z_w_max - xtts = 0.0 - xzts = 0.0 + xtts = zero + xzts = zero end subroutine dtl_reset end module nst_module diff --git a/physics/module_nst_parameters.f90 b/physics/module_nst_parameters.f90 index ee0a34914..1e1a39ca1 100644 --- a/physics/module_nst_parameters.f90 +++ b/physics/module_nst_parameters.f90 @@ -12,34 +12,34 @@ module module_nst_parameters use machine, only : kind_phys ! ! air constants and coefficients from the atmospehric model - use physcons, only: & - eps => con_eps & - ,cp_a => con_cp & !< spec heat air @p (j/kg/k) - , epsm1 => con_epsm1 & - , hvap => con_hvap & !< lat heat h2o cond (j/kg) - ,sigma_r => con_sbc & !< stefan-boltzmann (w/m2/k4) - ,grav => con_g & !< acceleration due to gravity (kg/m/s^2) - ,omega => con_omega & !< ang vel of earth (1/s) - ,rvrdm1 => con_fvirt & - ,rd => con_rd & - ,rocp => con_rocp & !< r/cp + use physcons, only: & + eps => con_eps & !< con_rd/con_rv (nd) + ,cp_a => con_cp & !< spec heat air @p (j/kg/k) + ,epsm1 => con_epsm1 & !< eps - 1 (nd) + ,hvap => con_hvap & !< lat heat h2o cond (j/kg) + ,sigma_r => con_sbc & !< stefan-boltzmann (w/m2/k4) + ,grav => con_g & !< acceleration due to gravity (kg/m/s^2) + ,omega => con_omega & !< ang vel of earth (1/s) + ,rvrdm1 => con_fvirt & !< con_rv/con_rd-1. (nd) + ,rd => con_rd & !< gas constant air (j/kg/k) + ,rocp => con_rocp & !< r/cp ,pi => con_pi ! ! note: take timestep from here later - public + public integer :: & niter_conv = 5, & niter_z_w = 5, & niter_sfs = 5 - real (kind=kind_phys), parameter :: & + real (kind=kind_phys), parameter :: & ! ! general constants sec_in_day=86400. & ,sec_in_hour=3600. & ,solar_time_6am=21600.0 & ,const_rot=0.000073 & !< constant to calculate corioli force - ,ri_c=0.65 & - ,ri_g=0.25 & + ,ri_c=0.65 & + ,ri_g=0.25 & ,eps_z_w=0.01 & !< criteria to finish iterations for z_w ,eps_conv=0.01 & !< criteria to finish iterations for d_conv ,eps_sfs=0.01 & !< criteria to finish iterations for d_sfs @@ -52,7 +52,7 @@ module module_nst_parameters ,tau_min=0.005 & !< minimum of wind stress for dtm ,exp_const=9.5 & !< coefficient in exponet profile ,delz=0.1 & !< vertical increment for integral calculation (m) - ,von=0.4 & !< von karman's "constant" + ,von=0.4 & !< von karman's "constant" ,t0k=273.16 & !< celsius to kelvin ,gray=0.97 & ,sst_max=308.16 & @@ -63,20 +63,20 @@ module module_nst_parameters ,omg_sh = 1.0 & !< trace factor to apply sensible heat due to rainfall effect ,visw=1.e-6 & !< m2/s kinematic viscosity water ,novalue=0 & - ,smallnumber=1.e-6 & + ,smallnumber=1.e-6 & ,timestep_oc=sec_in_day/8. & !< time step in the ocean model (3 hours) - ,radian=2.*pi/180. & - ,rad2deg=180./pi & + ,radian=2.*pi/180. & + ,rad2deg=180./pi & ,cp_w=4000. & !< specific heat water (j/kg/k ) ,rho0_w=1022.0 & !< density water (kg/m3 ) (or 1024.438) ,vis_w=1.e-6 & !< kinematic viscosity water (m2/s ) ,tc_w=0.6 & !< thermal conductivity water (w/m/k ) ,capa_w =3950.0 & !< heat capacity of sea water ! - ,thref =1.0e-3 !< reference value of specific volume (m**3/kg) + ,thref =1.0e-3 !< reference value of specific volume (m**3/kg) !!$!============================================ !!$ -!!$ ,lvapor=2.453e6 & ! latent heat of vaporization note: make it function of t ????? note the same as hvap +!!$ ,lvapor=2.453e6 & ! latent heat of vaporization note: make it function of t ????? note the same as hvap !!$ ,alpha=1 ! thermal expansion coefficient !!$ ,beta ! saline contraction coefficient !!$ ,cp=1 !=1 specific heat of sea water @@ -95,7 +95,7 @@ module module_nst_parameters !!$ fdg=1.00 !based on results from flux workshop august 1995 !!$ tok=273.16 ! celsius to kelvin !!$ twopi=3.14159*2. -!!$ +!!$ !!$c air constants and coefficients !!$ rgas=287.1 !j/kg/k gas const. dry air !!$ xlv=(2.501-0.00237*ts)*1e+6 !j/kg latent heat of vaporization at ts @@ -104,7 +104,7 @@ module module_nst_parameters !!$ rhoa=p*100./(rgas*(t+tok)*(1.+.61*q)) !kg/m3 moist air density ( " ) !!$ visa=1.326e-5*(1+6.542e-3*t+8.301e-6*t*t-4.84e-9*t*t*t) !m2/s !!$ !kinematic viscosity of dry air - andreas (1989) crrel rep. 89-11 -!!$c +!!$c !!$c cool skin constants !!$ al=2.1e-5*(ts+3.2)**0.79 !water thermal expansion coefft. !!$ be=0.026 !salinity expansion coefft. @@ -126,11 +126,11 @@ module module_nst_parameters !!$ real, parameter :: rhoref = 1024.438 !sea water reference density, kg/m^3 !!$ real , parameter :: hslab=50.0 !slab ocean depth !!$ real , parameter :: bad=-1.0e+10 -!!$ real , parameter :: tmin=2.68e+02 +!!$ real , parameter :: tmin=2.68e+02 !!$ real , parameter :: tmax=3.11e+02 !!$ !!$ real, parameter :: grav =9.81 !gravity, kg/m/s^2 -!!$ real, parameter :: capa =3950.0 !heat capacity of sea water +!!$ real, parameter :: capa =3950.0 !heat capacity of sea water !!$ real, parameter :: rhoref = 1024.438 !sea water reference density, kg/m^3 !!$ real, parameter :: tmin=2.68e+02 !normal minimal temp !!$ real, parameter :: tmax=3.11e+02 !normal max temp diff --git a/physics/physcons.F90 b/physics/physcons.F90 index 19a03ef20..4d86301e2 100644 --- a/physics/physcons.F90 +++ b/physics/physcons.F90 @@ -33,7 +33,7 @@ !> This module contains some of the most frequently used math and physics !! constants for GCM models. - module physcons + module physcons ! use machine, only: kind_phys, kind_dyn ! @@ -44,7 +44,7 @@ module physcons !> \name Math constants ! real(kind=kind_phys),parameter:: con_pi =3.1415926535897931 !< pi real(kind=kind_phys),parameter:: con_pi =4.0d0*atan(1.0d0) !< pi - real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0_kind_phys !< square root of 2 + real(kind=kind_phys),parameter:: con_sqrt2 =1.414214e+0_kind_phys !< square root of 2 real(kind=kind_phys),parameter:: con_sqrt3 =1.732051e+0_kind_phys !< quare root of 3 !> \name Geophysics/Astronomy constants From 86eb1bdc2ccd250575066a5a736201fd8e17e65b Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Tue, 14 Nov 2023 14:10:02 +0000 Subject: [PATCH 089/249] Bug fix for conv refl,remove conv refl computation from the cu_gf driver --- physics/GFS_MP_generic_post.F90 | 11 ++++----- physics/cu_gf_driver_post.F90 | 24 +------------------- physics/cu_gf_driver_post.meta | 40 --------------------------------- 3 files changed, 5 insertions(+), 70 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index 682263fc4..f1b15e01d 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -142,9 +142,10 @@ subroutine GFS_MP_generic_post_run( if ( (imp_physics==imp_physics_thompson .or. imp_physics==imp_physics_nssl) .and. & (imfdeepcnv==imfdeepcnv_samf .or. imfdeepcnv==imfdeepcnv_gf .or. imfshalcnv==imfshalcnv_gf) ) then do i=1,im + factor(i) = 0.0 lfrz = .true. zfrz(i) = phil(i,1) / con_g - do k = levs, 2, -1 + do k = levs, 1, -1 zo(i,k) = phil(i,k) / con_g if (gt0(i,k) >= 273.16 .and. lfrz) then zfrz(i) = zo(i,k) @@ -152,13 +153,9 @@ subroutine GFS_MP_generic_post_run( endif enddo enddo - - do i=1,im - factor(i) = 0.0 - enddo - +! do i=1,im - if(rainc (i) > 0.0 .or. htop(i) > 0) then + if(rainc (i) > 0.0 .and. htop(i) > 0) then factor(i) = -2./max(1000., zo(i,htop(i)) - zfrz(i)) endif enddo diff --git a/physics/cu_gf_driver_post.F90 b/physics/cu_gf_driver_post.F90 index 5adf3ac42..111bf0863 100644 --- a/physics/cu_gf_driver_post.F90 +++ b/physics/cu_gf_driver_post.F90 @@ -15,7 +15,7 @@ module cu_gf_driver_post !> \section arg_table_cu_gf_driver_post_run Argument Table !! \htmlinclude cu_gf_driver_post_run.html !! - subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m, conv_act, conv_act_m,dt, garea, raincv, maxupmf, refl_10cm, errmsg, errflg) + subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m, conv_act, conv_act_m, errmsg, errflg) use machine, only: kind_phys @@ -25,25 +25,17 @@ 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), 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(:) - ! for Radar reflectivity - real(kind_phys), intent(in) :: dt - real(kind_phys), intent(in) :: raincv(:), 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) integer, intent(out) :: errflg ! Local variables - real(kind_phys), parameter :: dbzmin=-10.0 - real(kind_phys) :: cuprate - real(kind_phys) :: ze, ze_conv, dbz_sum integer :: i, k ! Initialize CCPP error handling variables @@ -65,20 +57,6 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m else conv_act_m(i)=0.0 endif - ! reflectivity parameterization for parameterized convection (reference:Unipost MDLFLD.f) - ze = 0.0 - ze_conv = 0.0 - dbz_sum = 0.0 - cuprate = 1.e3*raincv(i) * 3600.0 / dt ! cu precip rate (mm/h) - if(cuprate .lt. 0.05) cuprate=0. - ze_conv = 300.0 * cuprate**1.5 - if (maxupmf(i).gt.0.1 .and. cuprate.gt.0.) then - do k = 1, km - ze = 10._kind_phys ** (0.1 * refl_10cm(i,k)) - dbz_sum = max(dbzmin, 10.0 * log10(ze + ze_conv)) - refl_10cm(i,k) = dbz_sum - enddo - endif enddo !$acc end kernels diff --git a/physics/cu_gf_driver_post.meta b/physics/cu_gf_driver_post.meta index 48e762cb4..6c6ceeb66 100644 --- a/physics/cu_gf_driver_post.meta +++ b/physics/cu_gf_driver_post.meta @@ -83,46 +83,6 @@ type = real kind = kind_phys intent = out -[dt] - standard_name = timestep_for_physics - long_name = physics time step - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[garea] - standard_name = cell_area - long_name = grid cell area - units = m2 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[raincv] - standard_name = lwe_thickness_of_deep_convective_precipitation_amount - long_name = deep convective rainfall amount on physics timestep - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[maxupmf] - standard_name = maximum_convective_updraft_mass_flux - long_name = maximum convective updraft mass flux within a column - units = m s-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[refl_10cm] - standard_name = radar_reflectivity_10cm - long_name = instantaneous refl_10cm - units = dBZ - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 8759f1c3897f49aaa05c04e0ffd5029683884761 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Wed, 15 Nov 2023 07:34:27 -0500 Subject: [PATCH 090/249] fix grv function for argument value --- physics/module_nst_water_prop.f90 | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/physics/module_nst_water_prop.f90 b/physics/module_nst_water_prop.f90 index 6a183da52..57f27f329 100644 --- a/physics/module_nst_water_prop.f90 +++ b/physics/module_nst_water_prop.f90 @@ -42,7 +42,7 @@ module module_nst_water_prop ! ------------------------------------------------------ !>\ingroup gfs_nst_main_mod !! This subroutine computes thermal expansion coefficient (alpha) -!! and saline contraction coefficient (beta). +!! and saline contraction coefficient (beta). subroutine rhocoef(t, s, rhoref, alpha, beta) ! ------------------------------------------------------ @@ -124,7 +124,7 @@ end subroutine density !====================== ! !>\ingroup gfs_nst_main_mod -!! This subroutine computes the fraction of the solar radiation absorbed +!! This subroutine computes the fraction of the solar radiation absorbed !! by the depth z following Paulson and Simpson (1981) \cite paulson_and_simpson_1981 . elemental subroutine sw_ps_9b(z,fxp) ! @@ -159,7 +159,7 @@ end subroutine sw_ps_9b !====================== ! !>\ingroup gfs_nst_main_mod -!! This subroutine +!! This subroutine elemental subroutine sw_ps_9b_aw(z,aw) ! ! d(fw)/d(z) for 9-band @@ -483,20 +483,16 @@ end subroutine sw_ohlmann_v1 ! !>\ingroup gfs_nst_main_mod -function grv(lat) - real(kind=kind_phys) :: lat - real(kind=kind_phys) :: gamma,c1,c2,c3,c4,pi,phi,x +function grv(x) + real(kind=kind_phys) :: x !< sin(lat) + real(kind=kind_phys) :: gamma,c1,c2,c3,c4 gamma=9.7803267715 c1=0.0052790414 c2=0.0000232718 c3=0.0000001262 c4=0.0000000007 - pi=3.141593 - phi=lat*pi/180 - x=sin(phi) - grv=gamma*(1+(c1*x**2)+(c2*x**4)+(c3*x**6)+(c4*x**8)) - !print *,'grav=',grv,lat + grv=gamma*(1.0+(c1*x**2)+(c2*x**4)+(c3*x**6)+(c4*x**8)) end function grv !>\ingroup gfs_nst_main_mod From 967740ffd92709ebb162921d5cad3c8428ba740e Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 15 Nov 2023 12:15:55 -0500 Subject: [PATCH 091/249] fix intent in mp_thompson.meta --- physics/mp_thompson.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/mp_thompson.meta b/physics/mp_thompson.meta index 293dd7625..ae1072d39 100644 --- a/physics/mp_thompson.meta +++ b/physics/mp_thompson.meta @@ -617,7 +617,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [fullradar_diag] standard_name = do_full_radar_reflectivity long_name = flag for computing full radar reflectivity From a85b2c8d817d23c6dc7f196f9b07afd661d10532 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Thu, 16 Nov 2023 13:46:41 +0000 Subject: [PATCH 092/249] clean up a bit, remove comments and temporary parameters --- physics/GFS_MP_generic_post.F90 | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index f1b15e01d..803f0334a 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -21,7 +21,7 @@ module GFS_MP_generic_post subroutine GFS_MP_generic_post_run( & im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, & imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rhowater, rainmin, dtf, & - frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice,phil,htop,refl_10cm, & + frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, phil, htop, refl_10cm, & imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf,snow, graupel, save_t, save_q, & rain0, ice0, snow0, graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp,& totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, & @@ -41,7 +41,6 @@ subroutine GFS_MP_generic_post_run( integer, intent(in) :: imp_physics_nssl, iopt_lake_clm, iopt_lake, lkm logical, intent(in) :: cal_pre, lssav, ldiag3d, qdiag3d, cplflx, cplchm, cpllnd, progsigma, exticeden integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:) -!aligo integer, intent(in) :: imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf integer, dimension (:), intent(in) :: htop integer :: dfi_radar_max_intervals @@ -115,7 +114,6 @@ subroutine GFS_MP_generic_post_run( real :: snowrat,grauprat,icerat,curat,prcpncfr,prcpcufr real :: rhonewsnow,rhoprcpice,rhonewgr,rhonewice -!aligo real(kind_phys), parameter :: dbzmin=-20.0 real(kind_phys) :: cuprate real(kind_phys) :: ze, ze_conv, dbz_sum @@ -123,7 +121,7 @@ subroutine GFS_MP_generic_post_run( real(kind_phys), dimension(1:im,1:levs) :: zo real(kind_phys), dimension(1:im) :: zfrz real(kind_phys), dimension(1:im) :: factor - real(kind_phys) ze_mp, fctz, delz, xlatd,xlond + real(kind_phys) ze_mp, fctz, delz logical :: lfrz From 152132604f4fc80ce7508a9b39ca5684a8ec18f5 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Thu, 16 Nov 2023 16:51:51 +0000 Subject: [PATCH 093/249] Take advantage of onebg to avoid division --- physics/GFS_MP_generic_post.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index 803f0334a..3527c0613 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -142,9 +142,9 @@ subroutine GFS_MP_generic_post_run( do i=1,im factor(i) = 0.0 lfrz = .true. - zfrz(i) = phil(i,1) / con_g + zfrz(i) = phil(i,1)*onebg do k = levs, 1, -1 - zo(i,k) = phil(i,k) / con_g + zo(i,k) = phil(i,k)*onebg if (gt0(i,k) >= 273.16 .and. lfrz) then zfrz(i) = zo(i,k) lfrz = .false. From 78cab8732919882fe5b7d3bded1fe176d300ea88 Mon Sep 17 00:00:00 2001 From: Eric Aligo Date: Fri, 17 Nov 2023 16:49:51 +0000 Subject: [PATCH 094/249] Replace constant 273.16 with con_t0c, a physical constant already defined. --- physics/GFS_MP_generic_post.F90 | 6 +++--- physics/GFS_MP_generic_post.meta | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/physics/GFS_MP_generic_post.F90 b/physics/GFS_MP_generic_post.F90 index 3527c0613..d9d30fb90 100644 --- a/physics/GFS_MP_generic_post.F90 +++ b/physics/GFS_MP_generic_post.F90 @@ -22,7 +22,7 @@ subroutine GFS_MP_generic_post_run( im, levs, kdt, nrcm, nncl, ntcw, ntrac, imp_physics, imp_physics_gfdl, imp_physics_thompson, imp_physics_nssl, & imp_physics_mg, imp_physics_fer_hires, cal_pre, cplflx, cplchm, cpllnd, progsigma, con_g, rhowater, rainmin, dtf, & frain, rainc, rain1, rann, xlat, xlon, gt0, gq0, prsl, prsi, phii, tsfc, ice, phil, htop, refl_10cm, & - imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf,snow, graupel, save_t, save_q, & + imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf, con_t0c, snow, graupel, save_t, save_q, & rain0, ice0, snow0, graupel0, del, rain, domr_diag, domzr_diag, domip_diag, doms_diag, tprcp, srflag, sr, cnvprcp,& totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, & pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, exticeden, & @@ -44,7 +44,7 @@ subroutine GFS_MP_generic_post_run( integer, intent(in) :: imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf integer, dimension (:), intent(in) :: htop integer :: dfi_radar_max_intervals - real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour + real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour, con_t0c real(kind=kind_phys), intent(in) :: radar_tten_limits(:) integer :: ix_dfi_radar(:) real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0,refl_10cm @@ -145,7 +145,7 @@ subroutine GFS_MP_generic_post_run( zfrz(i) = phil(i,1)*onebg do k = levs, 1, -1 zo(i,k) = phil(i,k)*onebg - if (gt0(i,k) >= 273.16 .and. lfrz) then + if (gt0(i,k) >= con_t0c .and. lfrz) then zfrz(i) = zo(i,k) lfrz = .false. endif diff --git a/physics/GFS_MP_generic_post.meta b/physics/GFS_MP_generic_post.meta index 0660a533a..a6137643d 100644 --- a/physics/GFS_MP_generic_post.meta +++ b/physics/GFS_MP_generic_post.meta @@ -312,6 +312,14 @@ dimensions = () type = integer intent = in +[con_t0c] + standard_name = temperature_at_zero_celsius + long_name = temperature at 0 degree Celsius + units = K + dimensions = () + type = real + kind = kind_phys + intent = in [tsfc] standard_name = surface_skin_temperature long_name = surface skin temperature From 9dc3d4063619b999316e2e269a3eb37d3c169173 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Mon, 20 Nov 2023 15:57:15 +0000 Subject: [PATCH 095/249] Inlcude surface ocean currents for the calculation of the air-sea fluxes. --- physics/satmedmfvdifq.F | 9 ++++++--- physics/satmedmfvdifq.meta | 16 ++++++++++++++++ physics/sfc_diff.f | 10 ++++++++-- physics/sfc_diff.meta | 23 +++++++++++++++++++++++ physics/sfc_nst.f | 13 ++++++++----- physics/sfc_nst.meta | 16 ++++++++++++++++ physics/sfc_ocean.F | 21 +++++++++++++-------- physics/sfc_ocean.meta | 16 ++++++++++++++++ z | 16 ++++++++++++++++ 9 files changed, 122 insertions(+), 18 deletions(-) create mode 100644 z diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 73fc4aff8..4ccf47060 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -75,7 +75,7 @@ end subroutine satmedmfvdifq_init !! \section detail_satmedmfvidfq GFS satmedmfvdifq Detailed Algorithm subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & & ntiw,ntke,grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, & - & dv,du,tdt,rtg,u1,v1,t1,q1,swh,hlw,xmu, & + & dv,du,tdt,rtg,u1,v1,t1,q1,ssu,ssv,swh,hlw,xmu, & & garea,zvfun,sigmaf, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,heat,evap,stress,spd1,kpbl, & @@ -110,6 +110,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & & tdt(:,:), rtg(:,:,:) real(kind=kind_phys), intent(in) :: & & u1(:,:), v1(:,:), & + & ssu(:), ssv(:), & & t1(:,:), q1(:,:,:), & & swh(:,:), hlw(:,:), & & xmu(:), garea(:), & @@ -2376,8 +2377,10 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & enddo enddo do i = 1,im - dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i) - dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i) +! dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i) +! dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i) + dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1(i) + dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1(i) enddo ! if(ldiag3d .and. .not. gen_tend) then diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index b6680dccb..b21e5d4f2 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -217,6 +217,22 @@ type = real kind = kind_phys intent = in +[ssu] + standard_name = ocn_current_zonal + long_name = ocn_current_zonal + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ssv] + standard_name = ocn_current_merid + long_name = ocn_current_merid + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [t1] standard_name = air_temperature long_name = layer mean air temperature diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 6e834537a..e4abf42d9 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -61,6 +61,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) + & u1,v1,ssu,ssv & !intent(in) & wet,dry,icy, & !intent(in) & thsfc_loc, & !intent(in) & tskin_wat, tskin_lnd, tskin_ice, & !intent(in) @@ -95,6 +96,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) logical, intent(in) :: thsfc_loc ! Flag for reference pressure in theta calculation real(kind=kind_phys), dimension(:), intent(in) :: u10m,v10m + real(kind=kind_phys), dimension(:), intent(in) :: u1,v1,ssu,ssv real(kind=kind_phys), intent(in) :: rvrdm1, eps, epsm1, grav real(kind=kind_phys), dimension(:), intent(in) :: & & ps,t1,q1,z1,garea,prsl1,prslki,prsik1,prslk1, & @@ -128,6 +130,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! real(kind=kind_phys) :: rat, tv1, thv1, restar, wind10m, & czilc, tem1, tem2, virtfac + real(kind=kind_phys), dimension(im) :: windrel ! real(kind=kind_phys) :: tvs, z0, z0max, ztmax, gdx @@ -167,6 +170,9 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type + do i=1,im + windrel(i) = sqrt((u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2) + enddo do i=1,im if(flag_iter(i)) then @@ -274,7 +280,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, ! --- outputs: & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), @@ -328,7 +334,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, ! --- outputs: & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index eb30b8c50..95e2bce81 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -102,6 +102,13 @@ type = real kind = kind_phys intent = in +[windrel] + standard_name = relative_wind_speed_at_lowest_model_layer + long_name = relative wind speed at lowest model level + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys [prsl1] standard_name = air_pressure_at_surface_adjacent_layer long_name = Model layer 1 mean pressure @@ -210,6 +217,22 @@ type = real kind = kind_phys intent = in +[ssu] + standard_name = ocn_current_zonal + long_name = ocn_current_zonal + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ssv] + standard_name = ocn_current_merid + long_name = ocn_current_merid + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [sfc_z0_type] standard_name = flag_for_surface_roughness_option_over_water long_name = surface roughness options over water diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 2ca70666d..4855d7224 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -16,7 +16,7 @@ module sfc_nst !> \section NSST_general_algorithm GFS Near-Surface Sea Temperature Scheme General Algorithm subroutine sfc_nst_run & & ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs: - & pi, tgice, sbc, ps, u1, v1, t1, q1, tref, cm, ch, & + & pi, tgice, sbc, ps, u1, v1, ssu, ssv, t1, q1, tref, cm, ch,& & lseaspray, fm, fm10, & & prsl1, prslki, prsik1, prslk1, wet, use_lake_model, xlon, & & sinlat, stress, & @@ -36,7 +36,7 @@ subroutine sfc_nst_run & ! ! ! call sfc_nst ! ! inputs: ! -! ( im, ps, u1, v1, t1, q1, tref, cm, ch, ! +! ( im, ps, u1, v1, ssu, ssv,t1, q1, tref, cm, ch, ! ! lseaspray, fm, fm10, ! ! prsl1, prslki, wet, use_lake_model, xlon, sinlat, stress, ! ! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, ! @@ -222,6 +222,7 @@ subroutine sfc_nst_run & & rho_a, theta1, tv1, wndmag real(kind=kind_phys) elocp,tem,cpinv,hvapi + real(kind=kind_phys) windref ! ! nstm related prognostic fields ! @@ -309,7 +310,9 @@ subroutine sfc_nst_run & ! qss is saturation specific humidity at the water surface !! do i = 1, im +! windref = wind(i) if ( flag(i) ) then + windref = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) nswsfc(i) = sfcnsw(i) ! net solar radiation at the air-sea surface (positive downward) wndmag(i) = sqrt(u1(i)*u1(i) + v1(i)*v1(i)) @@ -334,9 +337,9 @@ subroutine sfc_nst_run & ! --- ... rcp = rho cp ch v - rch(i) = rho_a(i) * cp * ch(i) * wind(i) - cmm(i) = cm (i) * wind(i) - chh(i) = rho_a(i) * ch(i) * wind(i) + rch(i) = rho_a(i) * cp * ch(i) * windref + cmm(i) = cm (i) * windref + chh(i) = rho_a(i) * ch(i) * windref !> - Calculate latent and sensible heat flux over open water with tskin. ! at previous time step diff --git a/physics/sfc_nst.meta b/physics/sfc_nst.meta index dc35ec959..10330fbb3 100644 --- a/physics/sfc_nst.meta +++ b/physics/sfc_nst.meta @@ -134,6 +134,22 @@ type = real kind = kind_phys intent = in +[ssu] + standard_name = ocn_current_zonal + long_name = ocn_current_zonal + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ssv] + standard_name = ocn_current_merid + long_name = ocn_current_merid + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [t1] standard_name = air_temperature_at_surface_adjacent_layer long_name = surface layer mean temperature diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index 78d58d8f0..2423bd8d9 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -24,7 +24,7 @@ subroutine sfc_ocean_run & !................................... ! --- inputs: & ( im, hvap, cp, rd, eps, epsm1, rvrdm1, ps, u1, v1, t1, q1, & - & tskin, cm, ch, lseaspray, fm, fm10, & + & tskin, cm, ch, lseaspray, fm, fm10, ssu, ssv, & & prsl1, prslki, wet, use_lake_model, wind, &, ! --- inputs & flag_iter, use_med_flux, dqsfc_med, dtsfc_med, & & qsurf, cmm, chh, gflux, evap, hflx, ep, & ! --- outputs @@ -66,6 +66,7 @@ subroutine sfc_ocean_run & ! im - integer, horizontal dimension 1 ! ! ps - real, surface pressure im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! +! ssu,ssv - real, u/v component of surface ocean current (m/s) im ! ! t1 - real, surface layer mean temperature ( k ) im ! ! q1 - real, surface layer mean specific humidity im ! ! tskin - real, ground surface skin temperature ( k ) im ! @@ -109,7 +110,8 @@ subroutine sfc_ocean_run & & eps, epsm1, rvrdm1 real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & - & t1, q1, tskin, cm, ch, fm, fm10, prsl1, prslki, wind + & t1, q1, tskin, cm, ch, fm, fm10, prsl1, prslki, wind, ssu, & + & ssv ! For sea spray effect logical, intent(in) :: lseaspray @@ -133,7 +135,7 @@ subroutine sfc_ocean_run & ! --- locals: real (kind=kind_phys) :: qss, rch, tem, - & elocp, cpinv, hvapi + & elocp, cpinv, hvapi, windref real (kind=kind_phys), dimension(im) :: rho, q0 integer :: i @@ -157,6 +159,7 @@ subroutine sfc_ocean_run & ! -- ... initialize CCPP error handling variables errmsg = '' errflg = 0 + print *, 'ssu ssv',ssu(1),ssv(1) cpinv = one/cp hvapi = one/hvap @@ -169,13 +172,15 @@ subroutine sfc_ocean_run & ! ps is in pascals, wind is wind speed, ! rho is density, qss is sat. hum. at surface +! windref = wind(i) if ( flag(i) ) then + windref = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) if (use_med_flux) then q0(i) = max( q1(i), qmin ) rho(i) = prsl1(i) / (rd*t1(i)*(one + rvrdm1*q0(i))) - tem = ch(i) * wind(i) - cmm(i) = cm(i) * wind(i) + tem = ch(i) * windref + cmm(i) = cm(i) * windref chh(i) = rho(i) * tem hflx(i) = dtsfc_med(i) @@ -192,9 +197,9 @@ subroutine sfc_ocean_run & ! --- ... rcp = rho cp ch v - rch = rho(i) * cp * ch(i) * wind(i) - tem = ch(i) * wind(i) - cmm(i) = cm(i) * wind(i) + rch = rho(i) * cp * ch(i) * windref + tem = ch(i) * windref + cmm(i) = cm(i) * windref chh(i) = rho(i) * tem !> - Calcualte sensible and latent heat flux over open water diff --git a/physics/sfc_ocean.meta b/physics/sfc_ocean.meta index 15812e723..7d2e55e27 100644 --- a/physics/sfc_ocean.meta +++ b/physics/sfc_ocean.meta @@ -86,6 +86,22 @@ type = real kind = kind_phys intent = in +[ssu] + standard_name = ocn_current_zonal + long_name = ocn_current_zonal + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ssv] + standard_name = ocn_current_merid + long_name = ocn_current_merid + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [t1] standard_name = air_temperature_at_surface_adjacent_layer long_name = surface layer mean temperature diff --git a/z b/z new file mode 100644 index 000000000..c1bc228c7 --- /dev/null +++ b/z @@ -0,0 +1,16 @@ +[ssu] + standard_name = ocn_current_zonal + long_name = ocn_current_zonal + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ssv] + standard_name = ocn_current_merid + long_name = ocn_current_merid + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in From 32584c2807800047cbc34d8db423569292eca492 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Sat, 25 Nov 2023 15:29:18 +0000 Subject: [PATCH 096/249] Use the ocean current field for the air-sea flux calculation. --- physics/satmedmfvdif.F | 19 ++++++++++++++++++- physics/satmedmfvdif.meta | 16 ++++++++++++++++ physics/satmedmfvdifq.F | 19 +++++++++++++++++++ physics/sfc_diag.f | 21 +++++++++++++++++++-- physics/sfc_diag.meta | 16 ++++++++++++++++ physics/sfc_diff.f | 26 ++++++++++++++++++++++---- physics/sfc_nst.f | 32 ++++++++++++++++++++++++-------- physics/sfc_ocean.F | 31 ++++++++++++++++++++++--------- z | 16 ---------------- 9 files changed, 156 insertions(+), 40 deletions(-) delete mode 100644 z diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index 79f7bbea1..a0441e8f4 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -63,7 +63,7 @@ end subroutine satmedmfvdif_init !> @{ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & & grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, & - & dv,du,tdt,rtg,u1,v1,t1,q1,swh,hlw,xmu,garea, & + & dv,du,tdt,rtg,u1,v1,ssu,ssv,t1,q1,swh,hlw,xmu,garea, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,heat,evap,stress,spd1,kpbl, & & prsi,del,prsl,prslk,phii,phil,delt, & @@ -95,6 +95,7 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & & tdt(:,:), rtg(:,:,:) real(kind=kind_phys), intent(in) :: & & u1(:,:), v1(:,:), & + & ssu(:), ssv(:), & & t1(:,:), q1(:,:,:), & & swh(:,:), hlw(:,:), & & xmu(:), garea(:), & @@ -217,6 +218,9 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & ! real(kind=kind_phys) h1 integer :: idtend + integer ii + real(kind=kind_phys) :: ssumax, ssvmax + logical :: check_ssu_ssv !! parameter(wfac=7.0,cfac=4.5) parameter(gamcrt=3.,gamcrq=0.,sfcfrac=0.1) @@ -250,6 +254,19 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 +! + check_ssu_ssv=.true. + if(check_ssu_ssv) then + ssumax=0.0 + ssvmax=0.0 + do ii=1,im + if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) + if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + !windrel(ii) = sqrt((u1(ii)-ssu(ii))**2+(v1(ii)-ssv(ii))**2) + enddo + print*, 'in satmedmfvdif.F ssumax,ssvmax =',ssumax,ssvmax + endif + !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. !> -# Compute preliminary variables from input arguments dt2 = delt diff --git a/physics/satmedmfvdif.meta b/physics/satmedmfvdif.meta index 3609ed50f..522ce543b 100644 --- a/physics/satmedmfvdif.meta +++ b/physics/satmedmfvdif.meta @@ -211,6 +211,22 @@ type = real kind = kind_phys intent = in +[ssu] + standard_name = ocn_current_zonal + long_name = ocn_current_zonal + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ssv] + standard_name = ocn_current_merid + long_name = ocn_current_merid + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [t1] standard_name = air_temperature long_name = layer mean air temperature diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 4ccf47060..62bf6473f 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -280,6 +280,25 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(cs0=0.4,csmf=0.5) parameter(rchck=1.5,ndt=20) +!BL + integer ii + real(kind=kind_phys) :: ssumax, ssvmax + logical :: check_ssu_ssv + + write(*,*)'in_satmedmfvdifq,u1 v1',u1(1,1),v1(1,1) + check_ssu_ssv=.true. + if(check_ssu_ssv) then + ssumax=0.0 + ssvmax=0.0 + do ii=1,im + if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) + if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + enddo + print*, 'in satmedmfvdifq.F ssumax,ssvmax =',ssumax,ssvmax + endif + !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. +!BL + if (tc_pbl == 0) then ck0 = 0.4 ch0 = 0.4 diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 768814e8c..b9006d6a9 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -17,6 +17,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & & lsm,lsm_ruc,grav,cp,eps,epsm1,con_rocp, & & con_karman, & & shflx,cdq,wind, & + & ssu,ssv, & & zf,ps,u1,v1,t1,q1,prslki,evap,fm,fh,fm10,fh2, & & ust,tskin,qsurf,thsfc_loc,diag_flux,diag_log, & & use_lake_model,iopt_lake,iopt_lake_clm, & @@ -38,6 +39,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & real(kind=kind_phys), intent(in) :: con_karman real(kind=kind_phys), dimension(:), intent( in) :: & & zf, ps, u1, v1, t1, q1, ust, tskin, & + & ssu, ssv, & & qsurf, prslki, evap, fm, fh, fm10, fh2, & & shflx, cdq, wind, xlat_d, xlon_d real(kind=kind_phys), dimension(:), intent(out) :: & @@ -67,10 +69,25 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & ! real(kind=kind_phys) sig2k, fhi, qss ! ! real, parameter :: g=grav + integer ii + real(kind=kind_phys) :: ssumax, ssvmax + logical :: check_ssu_ssv ! ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + + check_ssu_ssv=.true. + if(check_ssu_ssv) then + ssumax=0.0 + ssvmax=0.0 + do ii=1,im + if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) + if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + enddo + print*, 'in sfc_diag ssumax,ssvmax =',ssumax,ssvmax + endif + !if(abs(ssumax-0.02).lt.0.01) check_ssu_ssv=.false. !-- testptlat = 35.3_kind_phys @@ -89,8 +106,8 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & do i = 1, im f10m(i) = fm10(i) / fm(i) - u10m(i) = f10m(i) * u1(i) - v10m(i) = f10m(i) * v1(i) + u10m(i) = ssu(i) + f10m(i) * (u1(i)-ssu(i)) + v10m(i) = ssv(i) + f10m(i) * (v1(i)-ssv(i)) have_2m = use_lake_model(i)>0 .and. use_lake2m .and. & & iopt_lake==iopt_lake_clm if(have_2m) then diff --git a/physics/sfc_diag.meta b/physics/sfc_diag.meta index a16290b58..9a8a5517e 100644 --- a/physics/sfc_diag.meta +++ b/physics/sfc_diag.meta @@ -123,6 +123,22 @@ type = real kind = kind_phys intent = in +[ssu] + standard_name = ocn_current_zonal + long_name = ocn_current_zonal + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[ssv] + standard_name = ocn_current_merid + long_name = ocn_current_merid + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [t1] standard_name = air_temperature_at_surface_adjacent_layer long_name = 1st model layer air temperature diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index e4abf42d9..0ac51fda0 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -61,7 +61,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) - & u1,v1,ssu,ssv & !intent(in) + & u1,v1,ssu,ssv, & & wet,dry,icy, & !intent(in) & thsfc_loc, & !intent(in) & tskin_wat, tskin_lnd, tskin_ice, & !intent(in) @@ -127,10 +127,13 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! locals ! integer i + integer ii + real(kind=kind_phys) :: ssumax, ssvmax + real(kind=kind_phys), dimension(im) :: windrel + logical :: check_ssu_ssv ! real(kind=kind_phys) :: rat, tv1, thv1, restar, wind10m, & czilc, tem1, tem2, virtfac - real(kind=kind_phys), dimension(im) :: windrel ! real(kind=kind_phys) :: tvs, z0, z0max, ztmax, gdx @@ -168,11 +171,26 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ps is in pascals, wind is wind speed, ! surface roughness length is converted to m from cm ! + ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type + + check_ssu_ssv=.true. + if(check_ssu_ssv) then + ssumax=0.0 + ssvmax=0.0 + do ii=1,im + if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) + if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + enddo + print*, 'in sfc_diff ssumax,ssvmax =',ssumax,ssvmax + print*, 'in sfc_diff wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) + endif + !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. do i=1,im - windrel(i) = sqrt((u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2) + windrel(i)=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) enddo + do i=1,im if(flag_iter(i)) then @@ -389,7 +407,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), & z0max, ztmax_wat(i), tvs, grav, thsfc_loc, ! --- outputs: & rb_wat(i), fm_wat(i), fh_wat(i), fm10_wat(i), fh2_wat(i), diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 4855d7224..8aad8fc8f 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -36,7 +36,7 @@ subroutine sfc_nst_run & ! ! ! call sfc_nst ! ! inputs: ! -! ( im, ps, u1, v1, ssu, ssv,t1, q1, tref, cm, ch, ! +! ( im, ps, u1, v1, ssu,ssv, t1, q1, tref, cm, ch, ! ! lseaspray, fm, fm10, ! ! prsl1, prslki, wet, use_lake_model, xlon, sinlat, stress, ! ! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, ! @@ -75,6 +75,7 @@ subroutine sfc_nst_run & ! im - integer, horiz dimension 1 ! ! ps - real, surface pressure (pa) im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! +! ssu, ssv - real, u/v component of surface current (m/s) im ! ! t1 - real, surface layer mean temperature ( k ) im ! ! q1 - real, surface layer mean specific humidity im ! ! tref - real, reference/foundation temperature ( k ) im ! @@ -185,7 +186,7 @@ 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, & - & t1, q1, tref, cm, ch, fm, fm10, & + & ssu, ssv, t1, q1, tref, cm, ch, fm, fm10, & & prsl1, prslki, prsik1, prslk1, xlon, xcosz, & & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind real (kind=kind_phys), intent(in) :: timestep @@ -222,7 +223,6 @@ subroutine sfc_nst_run & & rho_a, theta1, tv1, wndmag real(kind=kind_phys) elocp,tem,cpinv,hvapi - real(kind=kind_phys) windref ! ! nstm related prognostic fields ! @@ -259,11 +259,28 @@ subroutine sfc_nst_run & real (kind=kind_phys), parameter :: alps=0.75,bets=0.75,gams=0.15, & ws10cr=30., conlf=7.2e-9, consf=6.4e-8 ! + + integer ii + real(kind=kind_phys) :: ssumax, ssvmax + real(kind=kind_phys) :: windrel + logical :: check_ssu_ssv !====================================================================================================== cc ! Initialize CCPP error handling variables errmsg = '' errflg = 0 + check_ssu_ssv=.true. + if(check_ssu_ssv) then + ssumax=0.0 + ssvmax=0.0 + do ii=1,im + if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) + if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + enddo + print*, 'in sfc_nst ssumax,ssvmax =',ssumax,ssvmax + print*, 'in sfc_nst wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) + endif + !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. if (nstf_name1 == 0) return ! No NSST model used @@ -310,9 +327,7 @@ subroutine sfc_nst_run & ! qss is saturation specific humidity at the water surface !! do i = 1, im -! windref = wind(i) if ( flag(i) ) then - windref = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) nswsfc(i) = sfcnsw(i) ! net solar radiation at the air-sea surface (positive downward) wndmag(i) = sqrt(u1(i)*u1(i) + v1(i)*v1(i)) @@ -337,9 +352,10 @@ subroutine sfc_nst_run & ! --- ... rcp = rho cp ch v - rch(i) = rho_a(i) * cp * ch(i) * windref - cmm(i) = cm (i) * windref - chh(i) = rho_a(i) * ch(i) * windref + windrel = sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + rch(i) = rho_a(i) * cp * ch(i) * windrel + cmm(i) = cm (i) * windrel + chh(i) = rho_a(i) * ch(i) * windrel !> - Calculate latent and sensible heat flux over open water with tskin. ! at previous time step diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index 2423bd8d9..7e3c7c46a 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -135,10 +135,14 @@ subroutine sfc_ocean_run & ! --- locals: real (kind=kind_phys) :: qss, rch, tem, - & elocp, cpinv, hvapi, windref + & elocp, cpinv, hvapi, windrel real (kind=kind_phys), dimension(im) :: rho, q0 integer :: i + integer :: ii + real (kind=kind_phys) :: ssumax,ssvmax + !logical,save :: check_ssu_ssv=.true. + logical :: check_ssu_ssv logical :: flag(im) ! @@ -159,7 +163,16 @@ subroutine sfc_ocean_run & ! -- ... initialize CCPP error handling variables errmsg = '' errflg = 0 - print *, 'ssu ssv',ssu(1),ssv(1) + check_ssu_ssv=.false. + if(check_ssu_ssv) then + ssumax=0.0 + ssvmax=0.0 + do ii=1,im + if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) + if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + enddo + print *, 'in sfc_ocean ssumax ssvmax',ssumax, ssvmax + endif cpinv = one/cp hvapi = one/hvap @@ -172,15 +185,14 @@ subroutine sfc_ocean_run & ! ps is in pascals, wind is wind speed, ! rho is density, qss is sat. hum. at surface -! windref = wind(i) if ( flag(i) ) then - windref = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) if (use_med_flux) then + windrel = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) q0(i) = max( q1(i), qmin ) rho(i) = prsl1(i) / (rd*t1(i)*(one + rvrdm1*q0(i))) - tem = ch(i) * windref - cmm(i) = cm(i) * windref + tem = ch(i) * windrel + cmm(i) = cm(i) * windrel chh(i) = rho(i) * tem hflx(i) = dtsfc_med(i) @@ -197,9 +209,10 @@ subroutine sfc_ocean_run & ! --- ... rcp = rho cp ch v - rch = rho(i) * cp * ch(i) * windref - tem = ch(i) * windref - cmm(i) = cm(i) * windref + windrel = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) + rch = rho(i) * cp * ch(i) * windrel + tem = ch(i) * windrel + cmm(i) = cm(i) * windrel chh(i) = rho(i) * tem !> - Calcualte sensible and latent heat flux over open water diff --git a/z b/z deleted file mode 100644 index c1bc228c7..000000000 --- a/z +++ /dev/null @@ -1,16 +0,0 @@ -[ssu] - standard_name = ocn_current_zonal - long_name = ocn_current_zonal - units = m s-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[ssv] - standard_name = ocn_current_merid - long_name = ocn_current_merid - units = m s-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in From f8e160157ff4466e606ba1b1b55156ed0c7af546 Mon Sep 17 00:00:00 2001 From: "denise.worthen" Date: Sun, 26 Nov 2023 13:09:56 -0500 Subject: [PATCH 097/249] rename and update files * remove continuation lines in column 6 and rename files as f90 * remove unused variables and make only needed variables, routines or procedures public * move use statements to module level, remove implicit none and use statements in SRs --- physics/module_nst_model.f90 | 1803 ++++++++++++++--------------- physics/module_nst_parameters.f90 | 123 +- physics/module_nst_water_prop.f90 | 753 ++++++------ physics/sfc_nst.f | 696 ----------- physics/sfc_nst.f90 | 664 +++++++++++ physics/sfc_nst_post.f | 93 -- physics/sfc_nst_post.f90 | 87 ++ physics/sfc_nst_pre.f | 96 -- physics/sfc_nst_pre.f90 | 89 ++ 9 files changed, 2171 insertions(+), 2233 deletions(-) delete mode 100644 physics/sfc_nst.f create mode 100644 physics/sfc_nst.f90 delete mode 100644 physics/sfc_nst_post.f create mode 100644 physics/sfc_nst_post.f90 delete mode 100644 physics/sfc_nst_pre.f create mode 100644 physics/sfc_nst_pre.f90 diff --git a/physics/module_nst_model.f90 b/physics/module_nst_model.f90 index d47ab838b..74c75924b 100644 --- a/physics/module_nst_model.f90 +++ b/physics/module_nst_model.f90 @@ -10,963 +10,960 @@ !> This module contains the diurnal thermocline layer model (DTM) of !! the GFS NSST scheme. module nst_module + ! + ! the module of diurnal thermocline layer model + ! + use machine , only : kind_phys + use module_nst_parameters , only : z_w_max, z_w_min, z_w_ini, eps_z_w, eps_conv + use module_nst_parameters , only : eps_sfs, niter_z_w, niter_conv, niter_sfs, ri_c + use module_nst_parameters , only : ri_g, omg_m, omg_sh, kw => tc_w, visw, t0k, cp_w + use module_nst_parameters , only : z_c_max, z_c_ini, ustar_a_min, delz, exp_const + use module_nst_parameters , only : rad2deg, const_rot, tw_max, sst_max + use module_nst_parameters , only : zero, one + use module_nst_water_prop , only : sw_rad_skin, sw_ps_9b, sw_ps_9b_aw + + implicit none + + private + + public :: dtm_1p, dtm_1p_fca, dtm_1p_tla, dtm_1p_mwa, dtm_1p_mda, dtm_1p_mta, convdepth + public :: cal_w, cal_ttop, cool_skin, dtl_reset + +contains + + !>\ingroup gfs_nst_main_mod + !! This subroutine contains the module of diurnal thermocline layer model. + subroutine dtm_1p(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & + alpha,beta,alon,sinlat,soltim,grav,le,d_conv, & + xt,xs,xu,xv,xz,xzts,xtts) + + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: timestep,rich,tox,toy,i0,q,sss,sep,q_ts,& + hl_ts,rho,alpha,beta,alon,sinlat,soltim,& + grav,le,d_conv + real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz,xzts,xtts + ! local variables + + ! + ! input variables + ! + ! timestep: integration time step in seconds + ! rich : critical ri (flow dependent) + ! tox : x wind stress (n*m^-2 or kg/m/s^2) + ! toy : y wind stress (n*m^-2 or kg/m/s^2) + ! i0 : solar radiation flux at the surface (wm^-2) + ! q : non-solar heat flux at the surface (wm^-2) + ! sss : salinity (ppt) + ! sep : sr(e-p) (ppt*m/s) + ! q_ts : d(q)/d(ts) : q = the sum of non-solar heat fluxes + ! hl_ts : d(hl)/d(ts) + ! rho : sea water density (kg*m^-3) + ! alpha : thermal expansion coefficient (1/k) + ! beta : saline contraction coefficient (1/ppt) + ! sinlat : sine (lat) + ! grav : gravity accelleration + ! le : le=(2.501-.00237*tsea)*1e6 + ! d-conv : fcl thickness + ! + ! inout variables + ! + ! xt : dtl heat content (m*k) + ! xs : dtl salinity content (m*ppt) + ! xu : dtl x current content (m*m/s) + ! xv : dtl y current content (m*m/s) + ! xz : dtl thickness (m) + ! xzts : d(xz)/d(ts) (m/k ) + ! xtts : d(xt)/d(ts) (m) + ! + ! logical lprnt + + ! if (lprnt) print *,' first xt=',xt + if ( xt <= zero ) then ! dtl doesn't exist yet + call dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha, & + beta,alon,sinlat,soltim,grav,le,xt,xs,xu,xv,xz,xzts,xtts) + elseif ( xt > zero ) then ! dtl already exists + ! + ! forward the system one time step + ! + call eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha, & + beta,alon,sinlat,soltim,grav,le,d_conv, & + xt,xs,xu,xv,xz,xzts,xtts) + endif ! if ( xt == 0 ) then + + end subroutine dtm_1p + + !>\ingroup gfs_nst_main_mod + !! This subroutine integrates one time step with modified Euler method. + subroutine eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha, & + beta,alon,sinlat,soltim,grav,le,d_conv, & + xt,xs,xu,xv,xz,xzts,xtts) + + ! + ! subroutine eulerm: integrate one time step with modified euler method + ! + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: timestep,rich,tox,toy,i0,q,sss,sep,q_ts, & + hl_ts,rho,alpha,beta,alon,sinlat,soltim, & + grav,le,d_conv + real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz,xzts,xtts + ! local variables + real(kind=kind_phys) :: xt0,xs0,xu0,xv0,xz0,xzts0,xtts0 + real(kind=kind_phys) :: fw,aw,q_warm + real(kind=kind_phys) :: xt1,xs1,xu1,xv1,xz1,xzts1,xtts1 + real(kind=kind_phys) :: xt2,xs2,xu2,xv2,xz2,xzts2,xtts2 + real(kind=kind_phys) :: dzw,drho,fc + real(kind=kind_phys) :: alat,speed + ! logical lprnt + + ! + ! input variables + ! + ! timestep: integration time step in seconds + ! rich : critial ri (flow/mass dependent) + ! tox : x wind stress (n*m^-2 or kg/m/s^2) + ! toy : y wind stress (n*m^-2 or kg/m/s^2) + ! i0 : solar radiation flux at the surface (wm^-2) + ! q : non-solar heat flux at the surface (wm^-2) + ! sss : salinity (ppt) + ! sep : sr(e-p) (ppt*m/s) + ! q_ts : d(q)/d(ts) : q = the sum of non-solar heat fluxes + ! hl_ts : d(hl)/d(ts) + ! rho : sea water density (kg*m^-3) + ! alpha : thermal expansion coefficient (1/k) + ! beta : saline contraction coefficient (1/ppt) + ! alon : longitude (deg) + ! sinlat : sine (lat) + ! soltim : solar time + ! grav : gravity accelleration + ! le : le=(2.501-.00237*tsea)*1e6 + ! d_conv : fcl thickness (m) + ! + ! inout variables + ! + ! xt : dtl heat content (m*k) + ! xs : dtl salinity content (m*ppt) + ! xu : dtl x current content (m*m/s) + ! xv : dtl y current content (m*m/s) + ! xz : dtl thickness (m) + ! xzts : d(xz)/d(ts) (m/k ) + ! xtts : d(xt)/d(ts) (m) + + xt0 = xt + xs0 = xs + xu0 = xu + xv0 = xv + xz0 = xz + xtts0 = xtts + xzts0 = xzts + speed = max(1.0e-8, xu0*xu0+xv0*xv0) + + alat = asin(sinlat)*rad2deg + + fc = const_rot*sinlat + + call sw_ps_9b(xz0,fw) + + q_warm = fw*i0-q !total heat abs in warm layer + + call sw_ps_9b_aw(xz0,aw) + + drho = -alpha*q_warm/(rho*cp_w) + omg_m*beta*sep + + ! dzw = xz0*(tox*xu0+toy*xv0) / (rho*(xu0*xu0+xv0*xv0)) & + ! + xz0*xz0*xz0*drho*grav / (4.0*rich*(xu0*xu0+xv0*xv0)) + dzw = xz0 * ((tox*xu0+toy*xv0) / (rho*speed) & + + xz0*xz0*drho*grav / (4.0*rich*speed)) + + xt1 = xt0 + timestep*q_warm/(rho*cp_w) + xs1 = xs0 + timestep*sep + xu1 = xu0 + timestep*(fc*xv0+tox/rho) + xv1 = xv0 + timestep*(-fc*xu0+toy/rho) + xz1 = xz0 + timestep*dzw + + ! if (lprnt) print *,' xt1=',xt1,' xz1=',xz1,' xz0=',xz0,' dzw=',dzw, & + ! 'timestep=',timestep,tox,toy,xu0,xv0,rho,drho,grav,rich + + if ( xt1 <= zero .or. xz1 <= zero .or. xz1 > z_w_max ) then + call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) + return + endif -! -! the module of diurnal thermocline layer model -! - use machine , only : kind_phys - use module_nst_parameters, only: z_w_max,z_w_min,z_w_ini,eps_z_w,eps_conv, & - eps_sfs,niter_z_w,niter_conv,niter_sfs,ri_c, & - ri_g,omg_m,omg_sh, kw => tc_w,visw,t0k,cp_w, & - z_c_max,z_c_ini,ustar_a_min,delz,exp_const, & - rad2deg,const_rot,tw_max,sst_max - use module_nst_water_prop, only: sw_rad_skin,sw_ps_9b,sw_ps_9b_aw - implicit none - - private - - integer, parameter :: kp = kind_phys - real (kind=kind_phys), parameter :: zero = 0.0_kp, one = 1.0_kp - - public :: dtm_1p, dtm_1p_fca, dtm_1p_tla, dtm_1p_mwa, dtm_1p_mda, dtm_1p_mta, convdepth - public :: cal_w, cal_ttop, cool_skin, dtl_reset + ! call dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt1,xs1,xu1,xv1,xz1,tr_mda,tr_fca,tr_tla,tr_mwa) - contains + xzts1 = xzts0 + timestep*((1.0/(xu0*xu0+xv0*xv0)) * & + ( (alpha*q_ts/cp_w+omg_m*beta*sss*hl_ts/le)*grav*xz0**3/(4.0*rich*rho) & + +( (tox*xu0+toy*xv0)/rho+(3.0*drho-alpha*i0*aw*xz0/(rho*cp_w)) & + *grav*xz0*xz0/(4.0*rich) )*xzts0 )) + xtts1 = xtts0 + timestep*(i0*aw*xzts0-q_ts)/(rho*cp_w) -!>\ingroup gfs_nst_main_mod -!! This subroutine contains the module of diurnal thermocline layer model. - subroutine dtm_1p(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & - alpha,beta,alon,sinlat,soltim,grav,le,d_conv, & - xt,xs,xu,xv,xz,xzts,xtts) + ! if ( 2.0*xt1/xz1 > 0.001 ) then + ! write(*,'(a,i5,2f8.3,4f8.2,f10.6,10f8.4)') 'eulerm_01 : ',kdt,alat,alon,soltim/3600.,i0,q,q_warm,sep,& + ! 2.0*xt1/xz1,2.0*xs1/xz1,2.0*xu1/xz1,2.0*xv1/xz1,xz1,xtts1,xzts1,d_conv,t_fcl,te + ! endif - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: timestep,rich,tox,toy,i0,q,sss,sep,q_ts,& - hl_ts,rho,alpha,beta,alon,sinlat,soltim,& - grav,le,d_conv - real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz,xzts,xtts -! local variables - -! -! input variables -! -! timestep: integration time step in seconds -! rich : critical ri (flow dependent) -! tox : x wind stress (n*m^-2 or kg/m/s^2) -! toy : y wind stress (n*m^-2 or kg/m/s^2) -! i0 : solar radiation flux at the surface (wm^-2) -! q : non-solar heat flux at the surface (wm^-2) -! sss : salinity (ppt) -! sep : sr(e-p) (ppt*m/s) -! q_ts : d(q)/d(ts) : q = the sum of non-solar heat fluxes -! hl_ts : d(hl)/d(ts) -! rho : sea water density (kg*m^-3) -! alpha : thermal expansion coefficient (1/k) -! beta : saline contraction coefficient (1/ppt) -! sinlat : sine (lat) -! grav : gravity accelleration -! le : le=(2.501-.00237*tsea)*1e6 -! d-conv : fcl thickness -! -! inout variables -! -! xt : dtl heat content (m*k) -! xs : dtl salinity content (m*ppt) -! xu : dtl x current content (m*m/s) -! xv : dtl y current content (m*m/s) -! xz : dtl thickness (m) -! xzts : d(xz)/d(ts) (m/k ) -! xtts : d(xt)/d(ts) (m) -! -! logical lprnt - -! if (lprnt) print *,' first xt=',xt - if ( xt <= zero ) then ! dtl doesn't exist yet - call dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& - beta,alon,sinlat,soltim,grav,le,xt,xs,xu,xv,xz,xzts,xtts) - elseif ( xt > zero ) then ! dtl already exists -! -! forward the system one time step -! - call eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha, & - beta,alon,sinlat,soltim,grav,le,d_conv, & - xt,xs,xu,xv,xz,xzts,xtts) - endif ! if ( xt == 0 ) then - - end subroutine dtm_1p + call sw_ps_9b(xz1,fw) + q_warm = fw*i0-q !total heat abs in warm layer + call sw_ps_9b_aw(xz1,aw) + drho = -alpha*q_warm/(rho*cp_w) + omg_m*beta*sep + dzw = xz1*(tox*xu1+toy*xv1) / (rho*(xu1*xu1+xv1*xv1)) & + + xz1*xz1*xz1*drho*grav / (4.0*rich*(xu1*xu1+xv1*xv1)) + + xt2 = xt0 + timestep*q_warm/(rho*cp_w) + xs2 = xs0 + timestep*sep + xu2 = xu0 + timestep*(fc*xv1+tox/rho) + xv2 = xv0 + timestep*(-fc*xu1+toy/rho) + xz2 = xz0 + timestep*dzw + + ! if (lprnt) print *,' xt2=',xt2,' xz2=',xz2 + + if ( xt2 <= zero .or. xz2 <= zero .or. xz2 > z_w_max ) then + call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) + return + endif -!>\ingroup gfs_nst_main_mod -!! This subroutine integrates one time step with modified Euler method. - subroutine eulerm(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho,alpha,& - beta,alon,sinlat,soltim,grav,le,d_conv, & - xt,xs,xu,xv,xz,xzts,xtts) + xzts2 = xzts0 + timestep*((1.0/(xu1*xu1+xv1*xv1)) * & + ( (alpha*q_ts/cp_w+omg_m*beta*sss*hl_ts/le)*grav*xz1**3/(4.0*rich*rho) & + +( (tox*xu1+toy*xv1)/rho+(3.0*drho-alpha*i0*aw*xz1/(rho*cp_w))* & + grav*xz1*xz1/(4.0*rich) )*xzts1 )) + xtts2 = xtts0 + timestep*(i0*aw*xzts1-q_ts)/(rho*cp_w) + + xt = 0.5*(xt1 + xt2) + xs = 0.5*(xs1 + xs2) + xu = 0.5*(xu1 + xu2) + xv = 0.5*(xv1 + xv2) + xz = 0.5*(xz1 + xz2) + xzts = 0.5*(xzts1 + xzts2) + xtts = 0.5*(xtts1 + xtts2) + + if ( xt <= zero .or. xz < zero .or. xz > z_w_max ) then + call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) + endif -! -! subroutine eulerm: integrate one time step with modified euler method -! - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: timestep,rich,tox,toy,i0,q,sss,sep,q_ts,& - hl_ts,rho,alpha,beta,alon,sinlat,soltim,& - grav,le,d_conv - real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz,xzts,xtts -! local variables - real(kind=kind_phys) :: xt0,xs0,xu0,xv0,xz0,xzts0,xtts0 - real(kind=kind_phys) :: fw,aw,q_warm - real(kind=kind_phys) :: xt1,xs1,xu1,xv1,xz1,xzts1,xtts1 - real(kind=kind_phys) :: xt2,xs2,xu2,xv2,xz2,xzts2,xtts2 - real(kind=kind_phys) :: dzw,drho,fc - real(kind=kind_phys) :: alat,speed -! logical lprnt - -! -! input variables -! -! timestep: integration time step in seconds -! rich : critial ri (flow/mass dependent) -! tox : x wind stress (n*m^-2 or kg/m/s^2) -! toy : y wind stress (n*m^-2 or kg/m/s^2) -! i0 : solar radiation flux at the surface (wm^-2) -! q : non-solar heat flux at the surface (wm^-2) -! sss : salinity (ppt) -! sep : sr(e-p) (ppt*m/s) -! q_ts : d(q)/d(ts) : q = the sum of non-solar heat fluxes -! hl_ts : d(hl)/d(ts) -! rho : sea water density (kg*m^-3) -! alpha : thermal expansion coefficient (1/k) -! beta : saline contraction coefficient (1/ppt) -! alon : longitude (deg) -! sinlat : sine (lat) -! soltim : solar time -! grav : gravity accelleration -! le : le=(2.501-.00237*tsea)*1e6 -! d_conv : fcl thickness (m) -! -! inout variables -! -! xt : dtl heat content (m*k) -! xs : dtl salinity content (m*ppt) -! xu : dtl x current content (m*m/s) -! xv : dtl y current content (m*m/s) -! xz : dtl thickness (m) -! xzts : d(xz)/d(ts) (m/k ) -! xtts : d(xt)/d(ts) (m) - - xt0 = xt - xs0 = xs - xu0 = xu - xv0 = xv - xz0 = xz - xtts0 = xtts - xzts0 = xzts - speed = max(1.0e-8, xu0*xu0+xv0*xv0) - - alat = asin(sinlat)*rad2deg - - fc = const_rot*sinlat - - call sw_ps_9b(xz0,fw) - - q_warm = fw*i0-q !total heat abs in warm layer - - call sw_ps_9b_aw(xz0,aw) - - drho = -alpha*q_warm/(rho*cp_w) + omg_m*beta*sep - -! dzw = xz0*(tox*xu0+toy*xv0) / (rho*(xu0*xu0+xv0*xv0)) & -! + xz0*xz0*xz0*drho*grav / (4.0*rich*(xu0*xu0+xv0*xv0)) - dzw = xz0 * ((tox*xu0+toy*xv0) / (rho*speed) & - + xz0*xz0*drho*grav / (4.0*rich*speed)) - - xt1 = xt0 + timestep*q_warm/(rho*cp_w) - xs1 = xs0 + timestep*sep - xu1 = xu0 + timestep*(fc*xv0+tox/rho) - xv1 = xv0 + timestep*(-fc*xu0+toy/rho) - xz1 = xz0 + timestep*dzw - -! if (lprnt) print *,' xt1=',xt1,' xz1=',xz1,' xz0=',xz0,' dzw=',dzw, & -! 'timestep=',timestep,tox,toy,xu0,xv0,rho,drho,grav,rich - - if ( xt1 <= zero .or. xz1 <= zero .or. xz1 > z_w_max ) then - call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) - return - endif - -! call dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt1,xs1,xu1,xv1,xz1,tr_mda,tr_fca,tr_tla,tr_mwa) - - xzts1 = xzts0 + timestep*((1.0/(xu0*xu0+xv0*xv0)) * & - ( (alpha*q_ts/cp_w+omg_m*beta*sss*hl_ts/le)*grav*xz0**3/(4.0*rich*rho)& - +( (tox*xu0+toy*xv0)/rho+(3.0*drho-alpha*i0*aw*xz0/(rho*cp_w)) & - *grav*xz0*xz0/(4.0*rich) )*xzts0 )) - xtts1 = xtts0 + timestep*(i0*aw*xzts0-q_ts)/(rho*cp_w) - -! if ( 2.0*xt1/xz1 > 0.001 ) then -! write(*,'(a,i5,2f8.3,4f8.2,f10.6,10f8.4)') 'eulerm_01 : ',kdt,alat,alon,soltim/3600.,i0,q,q_warm,sep,& -! 2.0*xt1/xz1,2.0*xs1/xz1,2.0*xu1/xz1,2.0*xv1/xz1,xz1,xtts1,xzts1,d_conv,t_fcl,te -! endif - - call sw_ps_9b(xz1,fw) - q_warm = fw*i0-q !total heat abs in warm layer - call sw_ps_9b_aw(xz1,aw) - drho = -alpha*q_warm/(rho*cp_w) + omg_m*beta*sep - dzw = xz1*(tox*xu1+toy*xv1) / (rho*(xu1*xu1+xv1*xv1)) & - + xz1*xz1*xz1*drho*grav / (4.0*rich*(xu1*xu1+xv1*xv1)) - - xt2 = xt0 + timestep*q_warm/(rho*cp_w) - xs2 = xs0 + timestep*sep - xu2 = xu0 + timestep*(fc*xv1+tox/rho) - xv2 = xv0 + timestep*(-fc*xu1+toy/rho) - xz2 = xz0 + timestep*dzw - -! if (lprnt) print *,' xt2=',xt2,' xz2=',xz2 - - if ( xt2 <= zero .or. xz2 <= zero .or. xz2 > z_w_max ) then - call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) + ! if (lprnt) print *,' xt=',xt,' xz=',xz + ! if ( 2.0*xt/xz > 0.001 ) then + ! write(*,'(a,i5,2f8.3,4f8.2,f10.6,10f8.4)') 'eulerm_02 : ',kdt,alat,alon,soltim/3600.,i0,q,q_warm,sep,& + ! 2.0*xt/xz,2.0*xs/xz,2.0*xu/xz,2.0*xv/xz,xz,xtts,xzts,d_conv,t_fcl,te + ! endif return - endif - - xzts2 = xzts0 + timestep*((1.0/(xu1*xu1+xv1*xv1)) * & - ( (alpha*q_ts/cp_w+omg_m*beta*sss*hl_ts/le)*grav*xz1**3/(4.0*rich*rho)& - +( (tox*xu1+toy*xv1)/rho+(3.0*drho-alpha*i0*aw*xz1/(rho*cp_w))* & - grav*xz1*xz1/(4.0*rich) )*xzts1 )) - xtts2 = xtts0 + timestep*(i0*aw*xzts1-q_ts)/(rho*cp_w) - - xt = 0.5*(xt1 + xt2) - xs = 0.5*(xs1 + xs2) - xu = 0.5*(xu1 + xu2) - xv = 0.5*(xv1 + xv2) - xz = 0.5*(xz1 + xz2) - xzts = 0.5*(xzts1 + xzts2) - xtts = 0.5*(xtts1 + xtts2) - - if ( xt <= zero .or. xz < zero .or. xz > z_w_max ) then - call dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) - endif - -! if (lprnt) print *,' xt=',xt,' xz=',xz -! if ( 2.0*xt/xz > 0.001 ) then -! write(*,'(a,i5,2f8.3,4f8.2,f10.6,10f8.4)') 'eulerm_02 : ',kdt,alat,alon,soltim/3600.,i0,q,q_warm,sep,& -! 2.0*xt/xz,2.0*xs/xz,2.0*xu/xz,2.0*xv/xz,xz,xtts,xzts,d_conv,t_fcl,te -! endif - return - - end subroutine eulerm -!>\ingroup gfs_nst_main_mod -!! This subroutine applies xz adjustment. - subroutine dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt,xs,xu,xv,xz,tr_mda,tr_fca,tr_tla,tr_mwa) -! apply xz adjustment: minimum depth adjustment (mda) -! free convection adjustment (fca); -! top layer adjustment (tla); -! maximum warming adjustment (mwa) -! - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: timestep,i0,q,rho,d_conv - real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz - real(kind=kind_phys), intent(out) :: tr_mda,tr_fca,tr_tla,tr_mwa -! local variables - real(kind=kind_phys) :: dz,t0,ttop0,ttop,fw,q_warm - real(kind=kind_phys) :: xz_fca,xz_tla,xz_mwa -! - real(kind=kind_phys) xz_mda - - tr_mda = zero; tr_fca = zero; tr_tla = zero; tr_mwa = zero - -! apply mda - if ( z_w_min > xz ) then - xz_mda = z_w_min - endif -! apply fca - if ( d_conv > zero ) then - xz_fca = 2.0*xt/((2.0*xt/xz)*(1.0-d_conv/(2.0*xz))) - tr_fca = 1.0 - if ( xz_fca >= z_w_max ) then - call dtl_reset_cv(xt,xs,xu,xv,xz) - go to 10 - endif - endif -! apply tla - dz = min(xz,max(d_conv,delz)) - call sw_ps_9b(dz,fw) - q_warm=fw*i0-q !total heat abs in warm layer - - if ( q_warm > zero ) then - call cal_ttop(kdt,timestep,q_warm,rho,dz,xt,xz,ttop0) -! ttop = (2.0*xt/xz)*(1.0-dz/(2.0*xz)) - ttop = ((xt+xt)/xz)*(1.0-dz/(xz+xz)) - if ( ttop > ttop0 ) then - xz_tla = (xt+sqrt(xt*(xt-delz*ttop0)))/ttop0 - tr_tla = 1.0 - if ( xz_tla >= z_w_max ) then - call dtl_reset_cv(xt,xs,xu,xv,xz) - go to 10 + end subroutine eulerm + + !>\ingroup gfs_nst_main_mod + !! This subroutine applies xz adjustment. + subroutine dtm_1p_zwa(kdt,timestep,i0,q,rho,d_conv,xt,xs,xu,xv,xz,tr_mda,tr_fca,tr_tla,tr_mwa) + ! apply xz adjustment: minimum depth adjustment (mda) + ! free convection adjustment (fca); + ! top layer adjustment (tla); + ! maximum warming adjustment (mwa) + ! + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: timestep,i0,q,rho,d_conv + real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz + real(kind=kind_phys), intent(out) :: tr_mda,tr_fca,tr_tla,tr_mwa + ! local variables + real(kind=kind_phys) :: dz,t0,ttop0,ttop,fw,q_warm + ! TODO: xz_mwa is unset but used below in max function + real(kind=kind_phys) :: xz_fca,xz_tla,xz_mwa + ! + real(kind=kind_phys) :: xz_mda + + tr_mda = zero; tr_fca = zero; tr_tla = zero; tr_mwa = zero + + ! apply mda + if ( z_w_min > xz ) then + xz_mda = z_w_min + endif + ! apply fca + if ( d_conv > zero ) then + xz_fca = 2.0*xt/((2.0*xt/xz)*(1.0-d_conv/(2.0*xz))) + tr_fca = 1.0 + if ( xz_fca >= z_w_max ) then + call dtl_reset_cv(xt,xs,xu,xv,xz) + go to 10 endif - endif - endif - -! apply mwa - t0 = 2.0*xt/xz - if ( t0 > tw_max ) then - if ( xz >= z_w_max ) then - call dtl_reset_cv(xt,xs,xu,xv,xz) - go to 10 - endif - endif - - xz = max(xz_mda,xz_fca,xz_tla,xz_mwa) - - 10 continue - - end subroutine dtm_1p_zwa + endif + ! apply tla + dz = min(xz,max(d_conv,delz)) + call sw_ps_9b(dz,fw) + q_warm=fw*i0-q !total heat abs in warm layer -!>\ingroup gfs_nst_main_mod -!! This subroutine applies free convection adjustment(fca). - subroutine dtm_1p_fca(d_conv,xt,xtts,xz,xzts) - -! apply xz adjustment: free convection adjustment (fca); -! - real(kind=kind_phys), intent(in) :: d_conv,xt,xtts - real(kind=kind_phys), intent(inout) :: xz,xzts -! local variables - real(kind=kind_phys) :: t_fcl,t0 -! - t0 = 2.0*xt/xz - t_fcl = t0*(1.0-d_conv/(2.0*xz)) - xz = 2.0*xt/t_fcl -! xzts = 2.0*xtts/t_fcl - - end subroutine dtm_1p_fca + if ( q_warm > zero ) then + call cal_ttop(kdt,timestep,q_warm,rho,dz,xt,xz,ttop0) + ! ttop = (2.0*xt/xz)*(1.0-dz/(2.0*xz)) + ttop = ((xt+xt)/xz)*(1.0-dz/(xz+xz)) + if ( ttop > ttop0 ) then + xz_tla = (xt+sqrt(xt*(xt-delz*ttop0)))/ttop0 + tr_tla = 1.0 + if ( xz_tla >= z_w_max ) then + call dtl_reset_cv(xt,xs,xu,xv,xz) + go to 10 + endif + endif + endif -!>\ingroup gfs_nst_main_mod -!! This subroutine applies top layer adjustment (tla). - subroutine dtm_1p_tla(dz,te,xt,xtts,xz,xzts) - -! apply xz adjustment: top layer adjustment (tla); -! - real(kind=kind_phys), intent(in) :: dz,te,xt,xtts - real(kind=kind_phys), intent(inout) :: xz,xzts -! local variables - real(kind=kind_phys) tem -! - tem = xt*(xt-dz*te) - if (tem > zero) then - xz = (xt+sqrt(xt*(xt-dz*te)))/te - else - xz = z_w_max - endif -! xzts = xtts*(1.0+0.5*(2.0*xt-dz*te)/sqrt(xt*(xt-dz*te)))/te - end subroutine dtm_1p_tla + ! apply mwa + t0 = 2.0*xt/xz + if ( t0 > tw_max ) then + if ( xz >= z_w_max ) then + call dtl_reset_cv(xt,xs,xu,xv,xz) + go to 10 + endif + endif -!>\ingroup gfs_nst_main_mod -!! This subroutine applies maximum warming adjustment (mwa). - subroutine dtm_1p_mwa(xt,xtts,xz,xzts) - -! apply xz adjustment: maximum warming adjustment (mwa) -! - real(kind=kind_phys), intent(in) :: xt,xtts - real(kind=kind_phys), intent(inout) :: xz,xzts -! local variables -! - xz = 2.0*xt/tw_max -! xzts = 2.0*xtts/tw_max - end subroutine dtm_1p_mwa + xz = max(xz_mda,xz_fca,xz_tla,xz_mwa) + +10 continue + + end subroutine dtm_1p_zwa + + !>\ingroup gfs_nst_main_mod + !! This subroutine applies free convection adjustment(fca). + subroutine dtm_1p_fca(d_conv,xt,xtts,xz,xzts) + + ! apply xz adjustment: free convection adjustment (fca); + ! + real(kind=kind_phys), intent(in) :: d_conv,xt,xtts + real(kind=kind_phys), intent(inout) :: xz,xzts + ! local variables + real(kind=kind_phys) :: t_fcl,t0 + ! + t0 = 2.0*xt/xz + t_fcl = t0*(1.0-d_conv/(2.0*xz)) + xz = 2.0*xt/t_fcl + ! xzts = 2.0*xtts/t_fcl + + end subroutine dtm_1p_fca + + !>\ingroup gfs_nst_main_mod + !! This subroutine applies top layer adjustment (tla). + subroutine dtm_1p_tla(dz,te,xt,xtts,xz,xzts) + + ! apply xz adjustment: top layer adjustment (tla); + ! + real(kind=kind_phys), intent(in) :: dz,te,xt,xtts + real(kind=kind_phys), intent(inout) :: xz,xzts + ! local variables + real(kind=kind_phys) :: tem + ! + tem = xt*(xt-dz*te) + if (tem > zero) then + xz = (xt+sqrt(xt*(xt-dz*te)))/te + else + xz = z_w_max + endif + ! xzts = xtts*(1.0+0.5*(2.0*xt-dz*te)/sqrt(xt*(xt-dz*te)))/te + end subroutine dtm_1p_tla + + !>\ingroup gfs_nst_main_mod + !! This subroutine applies maximum warming adjustment (mwa). + subroutine dtm_1p_mwa(xt,xtts,xz,xzts) + + ! apply xz adjustment: maximum warming adjustment (mwa) + ! + real(kind=kind_phys), intent(in) :: xt,xtts + real(kind=kind_phys), intent(inout) :: xz,xzts + ! local variables + ! + xz = 2.0*xt/tw_max + ! xzts = 2.0*xtts/tw_max + end subroutine dtm_1p_mwa + + !>\ingroup gfs_nst_main_mod + !! This subroutine applies minimum depth adjustment (xz adjustment). + subroutine dtm_1p_mda(xt,xtts,xz,xzts) + + ! apply xz adjustment: minimum depth adjustment (mda) + ! + real(kind=kind_phys), intent(in) :: xt,xtts + real(kind=kind_phys), intent(inout) :: xz,xzts + ! local variables + real(kind=kind_phys) :: ta + ! + xz = max(z_w_min,xz) + ta = 2.0*xt/xz + ! xzts = 2.0*xtts/ta + + end subroutine dtm_1p_mda + + !>\ingroup gfs_nst_main_mod + !! This subroutine applies maximum temperature adjustment (mta). + subroutine dtm_1p_mta(dta,xt,xtts,xz,xzts) + + ! apply xz adjustment: maximum temperature adjustment (mta) + ! + real(kind=kind_phys), intent(in) :: dta,xt,xtts + real(kind=kind_phys), intent(inout) :: xz,xzts + ! local variables + real(kind=kind_phys) :: ta + ! + ta = max(zero,2.0*xt/xz-dta) + if ( ta > zero ) then + xz = 2.0*xt/ta + else + xz = z_w_max + endif + ! xzts = 2.0*xtts/ta + + end subroutine dtm_1p_mta + + !>\ingroup gfs_nst_main_mod + !! This subroutine calculates depth for convective adjustment. + subroutine convdepth(kdt,timestep,i0,q,sss,sep,rho,alpha,beta,xt,xs,xz,d_conv) + + ! + ! calculate depth for convective adjustment + ! + + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: timestep,i0,q,sss,sep,rho,alpha,beta + real(kind=kind_phys), intent(in) :: xt,xs,xz + real(kind=kind_phys), intent(out) :: d_conv + real(kind=kind_phys) :: t,s,d_conv_ini,d_conv2,fxp,aw,s1,s2,fac1 + integer :: n + ! + ! input variables + ! + ! timestep: time step in seconds + ! i0 : solar radiation flux at the surface (wm^-2) + ! q : non-solar heat flux at the surface (wm^-2) + ! sss : salinity (ppt) + ! sep : sr(e-p) (ppt*m/s) + ! rho : sea water density (kg*m^-3) + ! alpha : thermal expansion coefficient (1/k) + ! beta : saline contraction coefficient (1/ppt) + ! xt : initial heat content (k*m) + ! xs : initial salinity content (ppt*m) + ! xz : initial dtl thickness (m) + ! + ! output variables + ! + ! d_conv : free convection depth (m) + + ! t : initial diurnal warming t (k) + ! s : initial diurnal warming s (ppt) + + n = 0 + t = 2.0*xt/xz + s = 2.0*xs/xz + + s1 = alpha*rho*t-omg_m*beta*rho*s + + if ( s1 == zero ) then + d_conv = zero + else -!>\ingroup gfs_nst_main_mod -!! This subroutine applies minimum depth adjustment (xz adjustment). - subroutine dtm_1p_mda(xt,xtts,xz,xzts) - -! apply xz adjustment: minimum depth adjustment (mda) -! - real(kind=kind_phys), intent(in) :: xt,xtts - real(kind=kind_phys), intent(inout) :: xz,xzts -! local variables - real(kind=kind_phys) :: ta -! - xz = max(z_w_min,xz) - ta = 2.0*xt/xz -! xzts = 2.0*xtts/ta - - end subroutine dtm_1p_mda + fac1 = alpha*q/cp_w+omg_m*beta*rho*sep + if ( i0 <= zero ) then + d_conv2=(2.0*xz*timestep/s1)*fac1 + if ( d_conv2 > zero ) then + d_conv = sqrt(d_conv2) + else + d_conv = zero + endif + elseif ( i0 > zero ) then + + d_conv_ini = zero + + iter_conv: do n = 1, niter_conv + call sw_ps_9b(d_conv_ini,fxp) + call sw_ps_9b_aw(d_conv_ini,aw) + s2 = alpha*(q-(fxp-aw*d_conv_ini)*i0)/cp_w+omg_m*beta*rho*sep + d_conv2=(2.0*xz*timestep/s1)*s2 + if ( d_conv2 < zero ) then + d_conv = zero + exit iter_conv + endif + d_conv = sqrt(d_conv2) + if ( abs(d_conv-d_conv_ini) < eps_conv .and. n <= niter_conv ) exit iter_conv + d_conv_ini = d_conv + enddo iter_conv + d_conv = max(zero,min(d_conv,z_w_max)) + endif ! if ( i0 <= zero ) then + + endif ! if ( s1 == zero ) then + + ! if ( d_conv > 0.01 ) then + ! write(*,'(a,i4,i3,10f9.3,3f10.6,f10.1,f6.2)') ' d_conv : ',kdt,n,d_conv,d_conv_ini,q,i0,rho,cp_w,timestep,xt,xs,xz,sep, & + ! s1,s2,d_conv2,aw + ! endif + + end subroutine convdepth + + !>\ingroup gfs_nst_main_mod + subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & + alpha,beta,alon,sinlat,soltim,grav,le,xt,xs,xu,xv,xz,xzts,xtts) + ! + ! determine xz iteratively (starting wit fw = 0.5) and then update the other 6 variables + ! + + integer,intent(in) :: kdt + real(kind=kind_phys), intent(in) :: timestep,rich,tox,toy,i0,q,sss,sep,q_ts, & + hl_ts,rho,alpha,beta,alon,sinlat,soltim,grav,le + real(kind=kind_phys), intent(out) :: xt,xs,xu,xv,xz,xzts,xtts + real(kind=kind_phys) :: xt0,xs0,xu0,xv0,xz0 + real(kind=kind_phys) :: xt1,xs1,xu1,xv1,xz1 + real(kind=kind_phys) :: fw,aw,q_warm,ft0,fs0,fu0,fv0,fz0,ft1,fs1,fu1,fv1,fz1 + real(kind=kind_phys) :: coeff1,coeff2,ftime,z_w,z_w_tmp,fc,warml,alat + integer :: n + ! + ! input variables + ! + ! timestep: time step in seconds + ! tox : x wind stress (n*m^-2 or kg/m/s^2) + ! toy : y wind stress (n*m^-2 or kg/m/s^2) + ! i0 : solar radiation flux at the surface (wm^-2) + ! q : non-solar heat flux at the surface (wm^-2) + ! sss : salinity (ppt) + ! sep : sr(e-p) (ppt*m/s) + ! rho : sea water density (kg*m^-3) + ! alpha : thermal expansion coefficient (1/k) + ! beta : saline contraction coefficient (1/ppt) + ! alon : longitude + ! sinlat : sine(latitude) + ! grav : gravity accelleration + ! le : le=(2.501-.00237*tsea)*1e6 + ! + ! output variables + ! + ! xt : onset t content in dtl + ! xs : onset s content in dtl + ! xu : onset u content in dtl + ! xv : onset v content in dtl + ! xz : onset dtl thickness (m) + ! xzts : onset d(xz)/d(ts) (m/k ) + ! xtts : onset d(xt)/d(ts) (m) + + fc=1.46/10000.0/2.0*sinlat + alat = asin(sinlat) + ! + ! initializing dtl (just before the onset) + ! + xt0 = zero + xs0 = zero + xu0 = zero + xv0 = zero + + z_w_tmp=z_w_ini + + call sw_ps_9b(z_w_tmp,fw) + ! fw=0.5 ! + q_warm=fw*i0-q !total heat abs in warm layer -!>\ingroup gfs_nst_main_mod -!! This subroutine applies maximum temperature adjustment (mta). - subroutine dtm_1p_mta(dta,xt,xtts,xz,xzts) - -! apply xz adjustment: maximum temperature adjustment (mta) -! - real(kind=kind_phys), intent(in) :: dta,xt,xtts - real(kind=kind_phys), intent(inout) :: xz,xzts -! local variables - real(kind=kind_phys) :: ta -! - ta = max(zero,2.0*xt/xz-dta) - if ( ta > zero ) then - xz = 2.0*xt/ta - else - xz = z_w_max - endif -! xzts = 2.0*xtts/ta - - end subroutine dtm_1p_mta + if ( abs(alat) > 1.0 ) then + ftime=sqrt((2.0-2.0*cos(fc*timestep))/(fc*fc*timestep)) + else + ftime=timestep + endif -!>\ingroup gfs_nst_main_mod -!! This subroutine calculates depth for convective adjustment. -subroutine convdepth(kdt,timestep,i0,q,sss,sep,rho,alpha,beta,xt,xs,xz,d_conv) - -! -! calculate depth for convective adjustment -! - - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: timestep,i0,q,sss,sep,rho,alpha,beta - real(kind=kind_phys), intent(in) :: xt,xs,xz - real(kind=kind_phys), intent(out) :: d_conv - real(kind=kind_phys) :: t,s,d_conv_ini,d_conv2,fxp,aw,s1,s2,fac1 - integer :: n -! -! input variables -! -! timestep: time step in seconds -! i0 : solar radiation flux at the surface (wm^-2) -! q : non-solar heat flux at the surface (wm^-2) -! sss : salinity (ppt) -! sep : sr(e-p) (ppt*m/s) -! rho : sea water density (kg*m^-3) -! alpha : thermal expansion coefficient (1/k) -! beta : saline contraction coefficient (1/ppt) -! xt : initial heat content (k*m) -! xs : initial salinity content (ppt*m) -! xz : initial dtl thickness (m) -! -! output variables -! -! d_conv : free convection depth (m) - -! t : initial diurnal warming t (k) -! s : initial diurnal warming s (ppt) - - n = 0 - t = 2.0*xt/xz - s = 2.0*xs/xz - - s1 = alpha*rho*t-omg_m*beta*rho*s - - if ( s1 == zero ) then - d_conv = zero - else - - fac1 = alpha*q/cp_w+omg_m*beta*rho*sep - if ( i0 <= zero ) then - d_conv2=(2.0*xz*timestep/s1)*fac1 - if ( d_conv2 > zero ) then - d_conv = sqrt(d_conv2) - else - d_conv = zero - endif - elseif ( i0 > zero ) then - - d_conv_ini = zero - - iter_conv: do n = 1, niter_conv - call sw_ps_9b(d_conv_ini,fxp) - call sw_ps_9b_aw(d_conv_ini,aw) - s2 = alpha*(q-(fxp-aw*d_conv_ini)*i0)/cp_w+omg_m*beta*rho*sep - d_conv2=(2.0*xz*timestep/s1)*s2 - if ( d_conv2 < zero ) then - d_conv = zero - exit iter_conv - endif - d_conv = sqrt(d_conv2) - if ( abs(d_conv-d_conv_ini) < eps_conv .and. n <= niter_conv ) exit iter_conv - d_conv_ini = d_conv - enddo iter_conv - d_conv = max(zero,min(d_conv,z_w_max)) - endif ! if ( i0 <= zero ) then + coeff1=alpha*grav/cp_w + coeff2=omg_m*beta*grav*rho + warml = coeff1*q_warm-coeff2*sep + + if ( warml > zero .and. q_warm > zero) then + iters_z_w: do n = 1,niter_z_w + if ( warml > zero .and. q_warm > zero ) then + z_w=sqrt(2.0*rich*ftime/rho)*sqrt(tox**2+toy**2)/sqrt(warml) + else + z_w = z_w_max + exit iters_z_w + endif + + ! write(*,'(a,i4,i4,10f9.3,f9.6,f3.0)') ' z_w = ',kdt,n,z_w,z_w_tmp,timestep,q_warm,q,i0,fw,tox,toy,sep,warml,omg_m + + if (abs(z_w - z_w_tmp) < eps_z_w .and. z_w/=z_w_max .and. n < niter_z_w) exit iters_z_w + z_w_tmp=z_w + call sw_ps_9b(z_w_tmp,fw) + q_warm = fw*i0-q + warml = coeff1*q_warm-coeff2*sep + end do iters_z_w + else + z_w=z_w_max + endif - endif ! if ( s1 == zero ) then + xz0 = max(z_w,z_w_min) -! if ( d_conv > 0.01 ) then -! write(*,'(a,i4,i3,10f9.3,3f10.6,f10.1,f6.2)') ' d_conv : ',kdt,n,d_conv,d_conv_ini,q,i0,rho,cp_w,timestep,xt,xs,xz,sep, & -! s1,s2,d_conv2,aw -! endif + ! + ! update xt, xs, xu, xv + ! + if ( z_w < z_w_max .and. q_warm > zero) then - end subroutine convdepth + call sw_ps_9b(z_w,fw) + q_warm=fw*i0-q !total heat abs in warm layer -!>\ingroup gfs_nst_main_mod - subroutine dtm_onset(kdt,timestep,rich,tox,toy,i0,q,sss,sep,q_ts,hl_ts,rho, & - alpha,beta,alon,sinlat,soltim,grav,le,xt,xs,xu,xv,xz,xzts,xtts) -! -! determine xz iteratively (starting wit fw = 0.5) and then update the other 6 variables -! - - integer,intent(in) :: kdt - real(kind=kind_phys), intent(in) :: timestep,rich,tox,toy,i0,q,sss,sep,q_ts,& - hl_ts,rho,alpha,beta,alon,sinlat,soltim,grav,le - real(kind=kind_phys), intent(out) :: xt,xs,xu,xv,xz,xzts,xtts - real(kind=kind_phys) :: xt0,xs0,xu0,xv0,xz0 - real(kind=kind_phys) :: xt1,xs1,xu1,xv1,xz1 - real(kind=kind_phys) :: fw,aw,q_warm,ft0,fs0,fu0,fv0,fz0,ft1,fs1,fu1,fv1,fz1 - real(kind=kind_phys) :: coeff1,coeff2,ftime,z_w,z_w_tmp,fc,warml,alat - integer :: n -! -! input variables -! -! timestep: time step in seconds -! tox : x wind stress (n*m^-2 or kg/m/s^2) -! toy : y wind stress (n*m^-2 or kg/m/s^2) -! i0 : solar radiation flux at the surface (wm^-2) -! q : non-solar heat flux at the surface (wm^-2) -! sss : salinity (ppt) -! sep : sr(e-p) (ppt*m/s) -! rho : sea water density (kg*m^-3) -! alpha : thermal expansion coefficient (1/k) -! beta : saline contraction coefficient (1/ppt) -! alon : longitude -! sinlat : sine(latitude) -! grav : gravity accelleration -! le : le=(2.501-.00237*tsea)*1e6 -! -! output variables -! -! xt : onset t content in dtl -! xs : onset s content in dtl -! xu : onset u content in dtl -! xv : onset v content in dtl -! xz : onset dtl thickness (m) -! xzts : onset d(xz)/d(ts) (m/k ) -! xtts : onset d(xt)/d(ts) (m) - - fc=1.46/10000.0/2.0*sinlat - alat = asin(sinlat) -! -! initializing dtl (just before the onset) -! - xt0 = zero - xs0 = zero - xu0 = zero - xv0 = zero - - z_w_tmp=z_w_ini - - call sw_ps_9b(z_w_tmp,fw) -! fw=0.5 ! - q_warm=fw*i0-q !total heat abs in warm layer - - if ( abs(alat) > 1.0 ) then - ftime=sqrt((2.0-2.0*cos(fc*timestep))/(fc*fc*timestep)) - else - ftime=timestep - endif - - coeff1=alpha*grav/cp_w - coeff2=omg_m*beta*grav*rho - warml = coeff1*q_warm-coeff2*sep - - if ( warml > zero .and. q_warm > zero) then - iters_z_w: do n = 1,niter_z_w - if ( warml > zero .and. q_warm > zero ) then - z_w=sqrt(2.0*rich*ftime/rho)*sqrt(tox**2+toy**2)/sqrt(warml) - else - z_w = z_w_max - exit iters_z_w - endif - -! write(*,'(a,i4,i4,10f9.3,f9.6,f3.0)') ' z_w = ',kdt,n,z_w,z_w_tmp,timestep,q_warm,q,i0,fw,tox,toy,sep,warml,omg_m - - if (abs(z_w - z_w_tmp) < eps_z_w .and. z_w/=z_w_max .and. n < niter_z_w) exit iters_z_w - z_w_tmp=z_w - call sw_ps_9b(z_w_tmp,fw) - q_warm = fw*i0-q - warml = coeff1*q_warm-coeff2*sep - end do iters_z_w - else - z_w=z_w_max - endif - - xz0 = max(z_w,z_w_min) - -! -! update xt, xs, xu, xv -! - if ( z_w < z_w_max .and. q_warm > zero) then - - call sw_ps_9b(z_w,fw) - q_warm=fw*i0-q !total heat abs in warm layer + ft0 = q_warm/(rho*cp_w) + fs0 = sep + fu0 = fc*xv0+tox/rho + fv0 = -fc*xu0+toy/rho - ft0 = q_warm/(rho*cp_w) - fs0 = sep - fu0 = fc*xv0+tox/rho - fv0 = -fc*xu0+toy/rho + xt1 = xt0 + timestep*ft0 + xs1 = xs0 + timestep*fs0 + xu1 = xu0 + timestep*fu0 + xv1 = xv0 + timestep*fv0 - xt1 = xt0 + timestep*ft0 - xs1 = xs0 + timestep*fs0 - xu1 = xu0 + timestep*fu0 - xv1 = xv0 + timestep*fv0 + fz0 = xz0*((tox*xu1+toy*xv1)/rho+omg_m*beta*grav*sep*xz0*xz0/(4.0*rich) & + -alpha*grav*q_warm*xz0*xz0/(4.0*rich*cp_w*rho))/(xu1*xu1+xv1*xv1) + xz1 = xz0 + timestep*fz0 - fz0 = xz0*((tox*xu1+toy*xv1)/rho+omg_m*beta*grav*sep*xz0*xz0/(4.0*rich) & - -alpha*grav*q_warm*xz0*xz0/(4.0*rich*cp_w*rho))/(xu1*xu1+xv1*xv1) - xz1 = xz0 + timestep*fz0 + xz1 = max(xz1,z_w_min) - xz1 = max(xz1,z_w_min) + if ( xt1 < zero .or. xz1 > z_w_max ) then + call dtl_reset(xt,xs,xu,xv,xz,xtts,xzts) + return + endif - if ( xt1 < zero .or. xz1 > z_w_max ) then - call dtl_reset(xt,xs,xu,xv,xz,xtts,xzts) - return - endif + call sw_ps_9b(xz1,fw) + q_warm=fw*i0-q !total heat abs in warm layer - call sw_ps_9b(xz1,fw) - q_warm=fw*i0-q !total heat abs in warm layer + ft1 = q_warm/(rho*cp_w) + fs1 = sep + fu1 = fc*xv1+tox/rho + fv1 = -fc*xu1+toy/rho - ft1 = q_warm/(rho*cp_w) - fs1 = sep - fu1 = fc*xv1+tox/rho - fv1 = -fc*xu1+toy/rho + fz1 = xz1*((tox*xu1+toy*xv1)/rho+omg_m*beta*grav*sep*xz1*xz1/(4.0*rich) & + -alpha*grav*q_warm*xz1*xz1/(4.0*rich*cp_w*rho))/(xu1*xu1+xv1*xv1) - fz1 = xz1*((tox*xu1+toy*xv1)/rho+omg_m*beta*grav*sep*xz1*xz1/(4.0*rich) & - -alpha*grav*q_warm*xz1*xz1/(4.0*rich*cp_w*rho))/(xu1*xu1+xv1*xv1) + xt = xt0 + 0.5*timestep*(ft0+ft1) + xs = xs0 + 0.5*timestep*(fs0+fs1) + xu = xu0 + 0.5*timestep*(fu0+fu1) + xv = xv0 + 0.5*timestep*(fv0+fv1) + xz = xz0 + 0.5*timestep*(fz0+fz1) - xt = xt0 + 0.5*timestep*(ft0+ft1) - xs = xs0 + 0.5*timestep*(fs0+fs1) - xu = xu0 + 0.5*timestep*(fu0+fu1) - xv = xv0 + 0.5*timestep*(fv0+fv1) - xz = xz0 + 0.5*timestep*(fz0+fz1) + xz = max(xz,z_w_min) - xz = max(xz,z_w_min) + call sw_ps_9b_aw(xz,aw) - call sw_ps_9b_aw(xz,aw) + ! xzts = (q_ts+(cp_w*omg_m*beta*sss/(le*alpha))*hl_ts)*xz/(i0*xz*aw+2.0*q_warm-2.0*(rho*cp_w*omg_m*beta*sss/alpha)*(sep/sss)) + xzts = (q_ts+omg_m*rho*cp_w*beta*sss*hl_ts*xz/(le*alpha))/(i0*xz*aw+2.0*q_warm-2.0*omg_m*rho*cp_w*beta*sss*sep/(le*alpha)) + xtts = timestep*(i0*aw*xzts-q_ts)/(rho*cp_w) + endif -! xzts = (q_ts+(cp_w*omg_m*beta*sss/(le*alpha))*hl_ts)*xz/(i0*xz*aw+2.0*q_warm-2.0*(rho*cp_w*omg_m*beta*sss/alpha)*(sep/sss)) - xzts = (q_ts+omg_m*rho*cp_w*beta*sss*hl_ts*xz/(le*alpha))/(i0*xz*aw+2.0*q_warm-2.0*omg_m*rho*cp_w*beta*sss*sep/(le*alpha)) - xtts = timestep*(i0*aw*xzts-q_ts)/(rho*cp_w) - endif + if ( xt < zero .or. xz > z_w_max ) then + call dtl_reset(xt,xs,xu,xv,xz,xtts,xzts) + endif - if ( xt < zero .or. xz > z_w_max ) then - call dtl_reset(xt,xs,xu,xv,xz,xtts,xzts) - endif + return - return + end subroutine dtm_onset + + !>\ingroup gfs_nst_main_mod + !! This subroutine computes coefficients (\a w_0 and \a w_d) to + !! calculate d(tw)/d(ts). + subroutine cal_w(kdt,xz,xt,xzts,xtts,w_0,w_d) + ! + ! abstract: calculate w_0,w_d + ! + ! input variables + ! + ! kdt : the number of time step + ! xt : dtl heat content + ! xz : dtl depth + ! xzts : d(zw)/d(ts) + ! xtts : d(xt)/d(ts) + ! + ! output variables + ! + ! w_0 : coefficint 1 to calculate d(tw)/d(ts) + ! w_d : coefficint 2 to calculate d(tw)/d(ts) + + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: xz,xt,xzts,xtts + real(kind=kind_phys), intent(out) :: w_0,w_d + + w_0 = 2.0*(xtts-xt*xzts/xz)/xz + w_d = (2.0*xt*xzts/xz**2-w_0)/xz + + ! if ( 2.0*xt/xz > 1.0 ) then + ! write(*,'(a,i4,2f9.3,4f10.4))') ' cal_w : ',kdt,xz,xt,w_0,w_d,xzts,xtts + ! endif + end subroutine cal_w + + !>\ingroup gfs_nst_main_mod + !! This subroutine calculates the diurnal warming amount at the top layer + !! with thickness of \a delz. + subroutine cal_ttop(kdt,timestep,q_warm,rho,dz,xt,xz,ttop) + ! + ! abstract: calculate + ! + ! input variables + ! + ! kdt : the number of record + ! timestep : the number of record + ! q_warm : total heat abs in layer dz + ! rho : sea water density + ! dz : dz = max(delz,d_conv) top layer thickness defined to adjust xz + ! xt : heat content in dtl at previous time + ! xz : dtl thickness at previous time + ! + ! output variables + ! + ! ttop : the diurnal warming amount at the top layer with thickness of delz + + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: timestep,q_warm,rho,dz,xt,xz + real(kind=kind_phys), intent(out) :: ttop + real(kind=kind_phys) :: dt_warm,t0 + + dt_warm = (xt+xt)/xz + t0 = dt_warm*(1.0-dz/(xz+xz)) + ttop = t0 + q_warm*timestep/(rho*cp_w*dz) + + end subroutine cal_ttop + + !>\ingroup gfs_nst_main_mod + !! This subroutine adjust dtm-1p dtl thickness by applying shear flow stability + !! with assumed exponential profile. + subroutine app_sfs(kdt,xt,xs,xu,xv,alpha,beta,grav,d_1p,xz) + ! + ! abstract: adjust dtm-1p dtl thickness by applying shear flow stability with assumed exponetial profile + ! + ! input variables + ! + ! kdt : the number of record + ! xt : heat content in dtl + ! xs : salinity content in dtl + ! xu : u-current content in dtl + ! xv : v-current content in dtl + ! alpha + ! beta + ! grav + ! d_1p : dtl depth before sfs applied + ! + ! output variables + ! + ! xz : dtl depth + + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: xt,xs,xu,xv,alpha,beta,grav,d_1p + real(kind=kind_phys), intent(out) :: xz + ! real(kind=kind_phys) :: ze,cc,xz0,l,d_sfs, t_sfs, tem + real(kind=kind_phys) :: cc,l,d_sfs,tem + real(kind=kind_phys), parameter :: c2 = 0.3782 + + cc = ri_g/(grav*c2) + + tem = alpha*xt - beta*xs + if (tem > zero) then + d_sfs = sqrt(2.0*cc*(xu*xu+xv*xv)/tem) + else + d_sfs = zero + endif - end subroutine dtm_onset + ! xz0 = d_1p + ! iter_sfs: do n = 1, niter_sfs + ! l = int_epn(0.0,xz0,0.0,xz0,2) + ! d_sfs = cc*(xu*xu+xv*xv)/((alpha*xt-beta*xs)*l) + ! write(*,'(a,i6,i3,4f9.4))') ' app_sfs_iter : ',kdt,n,cc,l,xz0,d_sfs + ! if ( abs(d_sfs-xz0) < eps_sfs .and. n <= niter_sfs ) exit iter_sfs + ! xz0 = d_sfs + ! enddo iter_sfs -!>\ingroup gfs_nst_main_mod -!! This subroutine computes coefficients (\a w_0 and \a w_d) to -!! calculate d(tw)/d(ts). - subroutine cal_w(kdt,xz,xt,xzts,xtts,w_0,w_d) -! -! abstract: calculate w_0,w_d -! -! input variables -! -! kdt : the number of time step -! xt : dtl heat content -! xz : dtl depth -! xzts : d(zw)/d(ts) -! xtts : d(xt)/d(ts) -! -! output variables -! -! w_0 : coefficint 1 to calculate d(tw)/d(ts) -! w_d : coefficint 2 to calculate d(tw)/d(ts) - - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: xz,xt,xzts,xtts - real(kind=kind_phys), intent(out) :: w_0,w_d - - w_0 = 2.0*(xtts-xt*xzts/xz)/xz - w_d = (2.0*xt*xzts/xz**2-w_0)/xz - -! if ( 2.0*xt/xz > 1.0 ) then -! write(*,'(a,i4,2f9.3,4f10.4))') ' cal_w : ',kdt,xz,xt,w_0,w_d,xzts,xtts -! endif - end subroutine cal_w + ! ze = a2*d_sfs ! not used! -!>\ingroup gfs_nst_main_mod -!! This subroutine calculates the diurnal warming amount at the top layer -!! with thickness of \a delz. - subroutine cal_ttop(kdt,timestep,q_warm,rho,dz,xt,xz,ttop) -! -! abstract: calculate -! -! input variables -! -! kdt : the number of record -! timestep : the number of record -! q_warm : total heat abs in layer dz -! rho : sea water density -! dz : dz = max(delz,d_conv) top layer thickness defined to adjust xz -! xt : heat content in dtl at previous time -! xz : dtl thickness at previous time -! -! output variables -! -! ttop : the diurnal warming amount at the top layer with thickness of delz - - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: timestep,q_warm,rho,dz,xt,xz - real(kind=kind_phys), intent(out) :: ttop - real(kind=kind_phys) :: dt_warm,t0 - - dt_warm = (xt+xt)/xz - t0 = dt_warm*(1.0-dz/(xz+xz)) - ttop = t0 + q_warm*timestep/(rho*cp_w*dz) - - end subroutine cal_ttop + l = int_epn(zero,d_sfs,zero,d_sfs,2) -!>\ingroup gfs_nst_main_mod -!! This subroutine adjust dtm-1p dtl thickness by applying shear flow stability -!! with assumed exponential profile. - subroutine app_sfs(kdt,xt,xs,xu,xv,alpha,beta,grav,d_1p,xz) -! -! abstract: adjust dtm-1p dtl thickness by applying shear flow stability with assumed exponetial profile -! -! input variables -! -! kdt : the number of record -! xt : heat content in dtl -! xs : salinity content in dtl -! xu : u-current content in dtl -! xv : v-current content in dtl -! alpha -! beta -! grav -! d_1p : dtl depth before sfs applied -! -! output variables -! -! xz : dtl depth - - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: xt,xs,xu,xv,alpha,beta,grav,d_1p - real(kind=kind_phys), intent(out) :: xz -! real(kind=kind_phys) :: ze,cc,xz0,l,d_sfs, t_sfs, tem - real(kind=kind_phys) :: cc,l,d_sfs,tem - real(kind=kind_phys), parameter :: c2 = 0.3782 - integer :: n - - cc = ri_g/(grav*c2) - - tem = alpha*xt - beta*xs - if (tem > zero) then - d_sfs = sqrt(2.0*cc*(xu*xu+xv*xv)/tem) - else - d_sfs = zero - endif - -! xz0 = d_1p -! iter_sfs: do n = 1, niter_sfs -! l = int_epn(0.0,xz0,0.0,xz0,2) -! d_sfs = cc*(xu*xu+xv*xv)/((alpha*xt-beta*xs)*l) -! write(*,'(a,i6,i3,4f9.4))') ' app_sfs_iter : ',kdt,n,cc,l,xz0,d_sfs -! if ( abs(d_sfs-xz0) < eps_sfs .and. n <= niter_sfs ) exit iter_sfs -! xz0 = d_sfs -! enddo iter_sfs - -! ze = a2*d_sfs ! not used! - - l = int_epn(zero,d_sfs,zero,d_sfs,2) - -! t_sfs = xt/l -! xz = (xt+xt) / t_sfs + ! t_sfs = xt/l + ! xz = (xt+xt) / t_sfs xz = l + l -! write(*,'(a,i6,6f9.4))') ' app_sfs : ',kdt,xz0,d_sfs,d_1p,xz,2.0*xt/d_1p,t_sfs - end subroutine app_sfs - -!>\ingroup gfs_nst_main_mod -!! This subroutine calculates d(tz)/d(ts). - subroutine cal_tztr(kdt,xt,c_0,c_d,w_0,w_d,zc,zw,z,tztr) -! -! abstract: calculate d(tz)/d(ts) -! -! input variables -! -! kdt : the number of record -! xt : heat content in dtl -! xz : dtl depth (m) -! c_0 : coefficint 1 to calculate d(tc)/d(ts) -! c_d : coefficint 2 to calculate d(tc)/d(ts) -! w_0 : coefficint 1 to calculate d(tw)/d(ts) -! w_d : coefficint 2 to calculate d(tw)/d(ts) -! -! output variables -! -! tztr : d(tz)/d(tr) - - integer, intent(in) :: kdt - real(kind=kind_phys), intent(in) :: xt,c_0,c_d,w_0,w_d,zc,zw,z - real(kind=kind_phys), intent(out) :: tztr - - if ( xt > zero ) then - if ( z <= zc ) then -! tztr = 1.0/(1.0-w_0+c_0)+z*(w_d-c_d)/(1.0-w_0+c_0) - tztr = (1.0+z*(w_d-c_d))/(1.0-w_0+c_0) - elseif ( z > zc .and. z < zw ) then -! tztr = (1.0+c_0)/(1.0-w_0+c_0)+z*w_d/(1.0-w_0+c_0) - tztr = (1.0+c_0+z*w_d)/(1.0-w_0+c_0) - elseif ( z >= zw ) then - tztr = 1.0 - endif - elseif ( xt == zero ) then - if ( z <= zc ) then -! tztr = 1.0/(1.0+c_0)-z*c_d/(1.0+c_0) - tztr = (1.0-z*c_d)/(1.0+c_0) - else + ! write(*,'(a,i6,6f9.4))') ' app_sfs : ',kdt,xz0,d_sfs,d_1p,xz,2.0*xt/d_1p,t_sfs + end subroutine app_sfs + + !>\ingroup gfs_nst_main_mod + !! This subroutine calculates d(tz)/d(ts). + subroutine cal_tztr(kdt,xt,c_0,c_d,w_0,w_d,zc,zw,z,tztr) + ! + ! abstract: calculate d(tz)/d(ts) + ! + ! input variables + ! + ! kdt : the number of record + ! xt : heat content in dtl + ! xz : dtl depth (m) + ! c_0 : coefficint 1 to calculate d(tc)/d(ts) + ! c_d : coefficint 2 to calculate d(tc)/d(ts) + ! w_0 : coefficint 1 to calculate d(tw)/d(ts) + ! w_d : coefficint 2 to calculate d(tw)/d(ts) + ! + ! output variables + ! + ! tztr : d(tz)/d(tr) + + integer, intent(in) :: kdt + real(kind=kind_phys), intent(in) :: xt,c_0,c_d,w_0,w_d,zc,zw,z + real(kind=kind_phys), intent(out) :: tztr + + if ( xt > zero ) then + if ( z <= zc ) then + ! tztr = 1.0/(1.0-w_0+c_0)+z*(w_d-c_d)/(1.0-w_0+c_0) + tztr = (1.0+z*(w_d-c_d))/(1.0-w_0+c_0) + elseif ( z > zc .and. z < zw ) then + ! tztr = (1.0+c_0)/(1.0-w_0+c_0)+z*w_d/(1.0-w_0+c_0) + tztr = (1.0+c_0+z*w_d)/(1.0-w_0+c_0) + elseif ( z >= zw ) then + tztr = 1.0 + endif + elseif ( xt == zero ) then + if ( z <= zc ) then + ! tztr = 1.0/(1.0+c_0)-z*c_d/(1.0+c_0) + tztr = (1.0-z*c_d)/(1.0+c_0) + else + tztr = 1.0 + endif + else tztr = 1.0 - endif - else - tztr = 1.0 - endif - -! write(*,'(a,i4,9f9.4))') ' cal_tztr : ',kdt,xt,c_0,c_d,w_0,w_d,zc,zw,z,tztr - end subroutine cal_tztr - -!>\ingroup gfs_nst_main_mod -!> This subroutine contains the upper ocean cool-skin parameterization -!! (Fairall et al, 1996 \cite fairall_et_al_1996). -subroutine cool_skin(ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q_ts,hl_ts,grav,le,deltat_c,z_c,c_0,c_d) -! -! upper ocean cool-skin parameterizaion, fairall et al, 1996. -! -! input: -! ustar_a : atmosphreic friction velocity at the air-sea interface (m/s) -! f_nsol : the "nonsolar" part of the surface heat flux (w/m^s) -! f_sol_0 : solar radiation at the ocean surface (w/m^2) -! evap : latent heat flux (w/m^2) -! sss : ocean upper mixed layer salinity (ppu) -! alpha : thermal expansion coefficient -! beta : saline contraction coefficient -! rho_w : oceanic density -! rho_a : atmospheric density -! ts : oceanic surface temperature -! q_ts : d(q)/d(ts) : q = the sum of non-solar heat fluxes -! hl_ts : d(hl)/d(ts) -! grav : gravity -! le : -! -! output: -! deltat_c: cool-skin temperature correction (degrees k) -! z_c : molecular sublayer (cool-skin) thickness (m) -! c_0 : coefficient1 to calculate d(tz)/d(ts) -! c_d : coefficient2 to calculate d(tz)/d(ts) - -! - real(kind=kind_phys), intent(in) :: ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q_ts,hl_ts,grav,le - real(kind=kind_phys), intent(out):: deltat_c,z_c,c_0,c_d -! declare local variables - real(kind=kind_phys), parameter :: a1=0.065, a2=11.0, a3=6.6e-5, a4=8.0e-4, tcw=0.6 & - , tcwi=1.0/tcw - real(kind=kind_phys) :: a_c,b_c,zc_ts,bc1,bc2 - real(kind=kind_phys) :: xi,hb,ustar1_a,bigc,deltaf,fxp - real(kind=kind_phys) :: zcsq - real(kind=kind_phys) :: cc1,cc2,cc3 - - - z_c = z_c_ini ! initial guess - - ustar1_a = max(ustar_a,ustar_a_min) - - call sw_rad_skin(z_c,fxp) - deltaf = f_sol_0*fxp - - hb = alpha*(f_nsol-deltaf)+beta*sss*cp_w*evap/le - bigc = 16*grav*cp_w*(rho_w*visw)**3/(rho_a*rho_a*kw*kw) - - if ( hb > 0 ) then - xi = 6./(1+(bigc*hb/ustar1_a**4)**0.75)**0.3333333 - else - xi = 6.0 - endif - z_c = min(z_c_max,xi*visw/(sqrt(rho_a/rho_w)*ustar1_a )) - - call sw_rad_skin(z_c,fxp) - - deltaf = f_sol_0*fxp - deltaf = f_nsol - deltaf - if ( deltaf > 0 ) then - deltat_c = deltaf * z_c / kw - else - deltat_c = zero - z_c = zero - endif -! -! calculate c_0 & c_d -! - if ( z_c > zero ) then - cc1 = 6.0*visw / (tcw*ustar1_a*sqrt(rho_a/rho_w)) - cc2 = bigc*alpha / max(ustar_a,ustar_a_min)**4 - cc3 = beta*sss*cp_w/(alpha*le) - zcsq = z_c * z_c - a_c = a2 + a3/zcsq - (a3/(a4*z_c)+a3/zcsq) * exp(-z_c/a4) - - if ( hb > zero .and. zcsq > zero .and. alpha > zero) then - bc1 = zcsq * (q_ts+cc3*hl_ts) - bc2 = zcsq * f_sol_0*a_c - 4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*zcsq) - zc_ts = bc1/bc2 -! b_c = z_c**2*(q_ts+cc3*hl_ts)/(z_c**2*f_sol_0*a_c-4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*z_c**2)) ! d(z_c)/d(ts) - b_c = (q_ts+cc3*hl_ts)/(f_sol_0*a_c & - - 4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*zcsq*zcsq)) ! d(z_c)/d(ts) - c_0 = (z_c*q_ts+(f_nsol-deltaf-f_sol_0*a_c*z_c)*b_c)*tcwi - c_d = (f_sol_0*a_c*z_c*b_c-q_ts)*tcwi + endif + ! write(*,'(a,i4,9f9.4))') ' cal_tztr : ',kdt,xt,c_0,c_d,w_0,w_d,zc,zw,z,tztr + end subroutine cal_tztr + + !>\ingroup gfs_nst_main_mod + !> This subroutine contains the upper ocean cool-skin parameterization + !! (Fairall et al, 1996 \cite fairall_et_al_1996). + subroutine cool_skin(ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q_ts,hl_ts,grav,le,deltat_c,z_c,c_0,c_d) + ! + ! upper ocean cool-skin parameterizaion, fairall et al, 1996. + ! + ! input: + ! ustar_a : atmosphreic friction velocity at the air-sea interface (m/s) + ! f_nsol : the "nonsolar" part of the surface heat flux (w/m^s) + ! f_sol_0 : solar radiation at the ocean surface (w/m^2) + ! evap : latent heat flux (w/m^2) + ! sss : ocean upper mixed layer salinity (ppu) + ! alpha : thermal expansion coefficient + ! beta : saline contraction coefficient + ! rho_w : oceanic density + ! rho_a : atmospheric density + ! ts : oceanic surface temperature + ! q_ts : d(q)/d(ts) : q = the sum of non-solar heat fluxes + ! hl_ts : d(hl)/d(ts) + ! grav : gravity + ! le : + ! + ! output: + ! deltat_c: cool-skin temperature correction (degrees k) + ! z_c : molecular sublayer (cool-skin) thickness (m) + ! c_0 : coefficient1 to calculate d(tz)/d(ts) + ! c_d : coefficient2 to calculate d(tz)/d(ts) + + ! + real(kind=kind_phys), intent(in) :: ustar_a,f_nsol,f_sol_0,evap,sss,alpha,beta,rho_w,rho_a,ts,q_ts,hl_ts,grav,le + real(kind=kind_phys), intent(out) :: deltat_c,z_c,c_0,c_d + ! declare local variables + real(kind=kind_phys), parameter :: a1=0.065, a2=11.0, a3=6.6e-5, a4=8.0e-4, tcw=0.6, tcwi=1.0/tcw + real(kind=kind_phys) :: a_c,b_c,zc_ts,bc1,bc2 + real(kind=kind_phys) :: xi,hb,ustar1_a,bigc,deltaf,fxp + real(kind=kind_phys) :: zcsq + real(kind=kind_phys) :: cc1,cc2,cc3 + + + z_c = z_c_ini ! initial guess + + ustar1_a = max(ustar_a,ustar_a_min) + + call sw_rad_skin(z_c,fxp) + deltaf = f_sol_0*fxp + + hb = alpha*(f_nsol-deltaf)+beta*sss*cp_w*evap/le + bigc = 16*grav*cp_w*(rho_w*visw)**3/(rho_a*rho_a*kw*kw) + + if ( hb > 0 ) then + xi = 6./(1+(bigc*hb/ustar1_a**4)**0.75)**0.3333333 else - b_c = zero - zc_ts = zero - c_0 = z_c*q_ts*tcwi - c_d = -q_ts*tcwi + xi = 6.0 endif + z_c = min(z_c_max,xi*visw/(sqrt(rho_a/rho_w)*ustar1_a )) -! if ( c_0 < 0.0 ) then -! write(*,'(a,2f12.6,10f10.6)') ' c_0, c_d = ',c_0,c_d,b_c,zc_ts,hb,bc1,bc2,z_c,cc1,cc2,cc3,z_c**2 -! endif + call sw_rad_skin(z_c,fxp) -! c_0 = z_c*q_ts/tcw -! c_d = -q_ts/tcw + deltaf = f_sol_0*fxp + deltaf = f_nsol - deltaf + if ( deltaf > 0 ) then + deltat_c = deltaf * z_c / kw + else + deltat_c = zero + z_c = zero + endif + ! + ! calculate c_0 & c_d + ! + if ( z_c > zero ) then + cc1 = 6.0*visw / (tcw*ustar1_a*sqrt(rho_a/rho_w)) + cc2 = bigc*alpha / max(ustar_a,ustar_a_min)**4 + cc3 = beta*sss*cp_w/(alpha*le) + zcsq = z_c * z_c + a_c = a2 + a3/zcsq - (a3/(a4*z_c)+a3/zcsq) * exp(-z_c/a4) + + if ( hb > zero .and. zcsq > zero .and. alpha > zero) then + bc1 = zcsq * (q_ts+cc3*hl_ts) + bc2 = zcsq * f_sol_0*a_c - 4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*zcsq) + zc_ts = bc1/bc2 + ! b_c = z_c**2*(q_ts+cc3*hl_ts)/(z_c**2*f_sol_0*a_c-4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*z_c**2)) ! d(z_c)/d(ts) + b_c = (q_ts+cc3*hl_ts)/(f_sol_0*a_c & + - 4.0*(cc1*tcw)**3*(hb/alpha)**0.25/(cc2**0.75*zcsq*zcsq)) ! d(z_c)/d(ts) + c_0 = (z_c*q_ts+(f_nsol-deltaf-f_sol_0*a_c*z_c)*b_c)*tcwi + c_d = (f_sol_0*a_c*z_c*b_c-q_ts)*tcwi + + else + b_c = zero + zc_ts = zero + c_0 = z_c*q_ts*tcwi + c_d = -q_ts*tcwi + endif - else - c_0 = zero - c_d = zero - endif ! if ( z_c > 0.0 ) then + ! if ( c_0 < 0.0 ) then + ! write(*,'(a,2f12.6,10f10.6)') ' c_0, c_d = ',c_0,c_d,b_c,zc_ts,hb,bc1,bc2,z_c,cc1,cc2,cc3,z_c**2 + ! endif - end subroutine cool_skin -! -!====================== -! -!>\ingroup gfs_nst_main_mod -!! This function calculates a definitive integral of an exponential curve (power of 2). - real function int_epn(z1,z2,zmx,ztr,n) -! -! abstract: calculate a definitive integral of an exponetial curve (power of 2) -! - real(kind_phys) :: z1,z2,zmx,ztr,zi - real(kind_phys) :: fa,fb,fi,int - integer :: m,i,n - - m = nint((z2-z1)/delz) - fa = exp(-exp_const*((z1-zmx)/(ztr-zmx))**n) - fb = exp(-exp_const*((z2-zmx)/(ztr-zmx))**n) - int = zero - do i = 1, m-1 - zi = z1 + delz*float(i) - fi = exp(-exp_const*((zi-zmx)/(ztr-zmx))**n) - int = int + fi - enddo - int_epn = delz*((fa+fb)/2.0 + int) - end function int_epn + ! c_0 = z_c*q_ts/tcw + ! c_d = -q_ts/tcw -!>\ingroup gfs_nst_main_mod -!! This subroutine resets the value of xt,xs,xu,xv,xz. - subroutine dtl_reset_cv(xt,xs,xu,xv,xz) - real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz + else + c_0 = zero + c_d = zero + endif ! if ( z_c > 0.0 ) then + + end subroutine cool_skin + ! + !====================== + ! + !>\ingroup gfs_nst_main_mod + !! This function calculates a definitive integral of an exponential curve (power of 2). + real function int_epn(z1,z2,zmx,ztr,n) + ! + ! abstract: calculate a definitive integral of an exponetial curve (power of 2) + ! + real(kind_phys) :: z1,z2,zmx,ztr,zi + real(kind_phys) :: fa,fb,fi,int + integer :: m,i,n + + m = nint((z2-z1)/delz) + fa = exp(-exp_const*((z1-zmx)/(ztr-zmx))**n) + fb = exp(-exp_const*((z2-zmx)/(ztr-zmx))**n) + int = zero + do i = 1, m-1 + zi = z1 + delz*float(i) + fi = exp(-exp_const*((zi-zmx)/(ztr-zmx))**n) + int = int + fi + enddo + int_epn = delz*((fa+fb)/2.0 + int) + end function int_epn + + !>\ingroup gfs_nst_main_mod + !! This subroutine resets the value of xt,xs,xu,xv,xz. + subroutine dtl_reset_cv(xt,xs,xu,xv,xz) + real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz xt = zero xs = zero xu = zero xv = zero xz = z_w_max - end subroutine dtl_reset_cv + end subroutine dtl_reset_cv -!>\ingroup gfs_nst_main_mod -!! This subroutine resets the value of xt,xs,xu,xv,xz,xtts,xzts. - subroutine dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) - real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz,xzts,xtts + !>\ingroup gfs_nst_main_mod + !! This subroutine resets the value of xt,xs,xu,xv,xz,xtts,xzts. + subroutine dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) + real(kind=kind_phys), intent(inout) :: xt,xs,xu,xv,xz,xzts,xtts xt = zero xs = zero xu = zero @@ -974,6 +971,6 @@ subroutine dtl_reset(xt,xs,xu,xv,xz,xzts,xtts) xz = z_w_max xtts = zero xzts = zero - end subroutine dtl_reset + end subroutine dtl_reset end module nst_module diff --git a/physics/module_nst_parameters.f90 b/physics/module_nst_parameters.f90 index 1e1a39ca1..5308345e2 100644 --- a/physics/module_nst_parameters.f90 +++ b/physics/module_nst_parameters.f90 @@ -9,70 +9,83 @@ !! history: !! 20210305: X.Li, reduce z_w_max from 30 m to 20 m module module_nst_parameters + use machine, only : kind_phys ! ! air constants and coefficients from the atmospehric model - use physcons, only: & - eps => con_eps & !< con_rd/con_rv (nd) - ,cp_a => con_cp & !< spec heat air @p (j/kg/k) - ,epsm1 => con_epsm1 & !< eps - 1 (nd) - ,hvap => con_hvap & !< lat heat h2o cond (j/kg) - ,sigma_r => con_sbc & !< stefan-boltzmann (w/m2/k4) - ,grav => con_g & !< acceleration due to gravity (kg/m/s^2) - ,omega => con_omega & !< ang vel of earth (1/s) - ,rvrdm1 => con_fvirt & !< con_rv/con_rd-1. (nd) - ,rd => con_rd & !< gas constant air (j/kg/k) - ,rocp => con_rocp & !< r/cp - ,pi => con_pi + use physcons, only: & + eps => con_eps & !< con_rd/con_rv (nd) + ,cp_a => con_cp & !< spec heat air @p (j/kg/k) + ,epsm1 => con_epsm1 & !< eps - 1 (nd) + ,hvap => con_hvap & !< lat heat h2o cond (j/kg) + ,sigma_r => con_sbc & !< stefan-boltzmann (w/m2/k4) + ,grav => con_g & !< acceleration due to gravity (kg/m/s^2) + ,omega => con_omega & !< ang vel of earth (1/s) + ,rvrdm1 => con_fvirt & !< con_rv/con_rd-1. (nd) + ,rd => con_rd & !< gas constant air (j/kg/k) + ,rocp => con_rocp & !< r/cp + ,pi => con_pi + + implicit none + + private + + public :: sigma_r + public :: zero, one, half + public :: niter_conv, niter_z_w, niter_sfs + public :: z_w_max, z_w_min, z_w_ini, z_c_max, z_c_ini, eps_z_w, eps_conv, eps_sfs + public :: ri_c, ri_g, omg_m, omg_sh, tc_w, visw, cp_w, t0k, ustar_a_min, delz, exp_const + public :: rad2deg, const_rot, tw_max, sst_max, solar_time_6am, tau_min, wd_max + + real(kind_phys), parameter :: zero = 0.0_kind_phys, one = 1.0_kind_phys, half = 0.5_kind_phys ! ! note: take timestep from here later - public integer :: & niter_conv = 5, & niter_z_w = 5, & niter_sfs = 5 - real (kind=kind_phys), parameter :: & - ! - ! general constants - sec_in_day=86400. & - ,sec_in_hour=3600. & - ,solar_time_6am=21600.0 & - ,const_rot=0.000073 & !< constant to calculate corioli force - ,ri_c=0.65 & - ,ri_g=0.25 & - ,eps_z_w=0.01 & !< criteria to finish iterations for z_w - ,eps_conv=0.01 & !< criteria to finish iterations for d_conv - ,eps_sfs=0.01 & !< criteria to finish iterations for d_sfs - ,z_w_max=20.0 & !< max warm layer thickness - ,z_w_min=0.2 & !< min warm layer thickness - ,z_w_ini=0.2 & !< initial warm layer thickness in dtl_onset - ,z_c_max=0.01 & !< maximum of sub-layer thickness (m) - ,z_c_ini=0.001 & !< initial value of z_c - ,ustar_a_min=0.031 & !< minimum of friction wind speed (m/s): 0.031 ~ 1m/s at 10 m hight - ,tau_min=0.005 & !< minimum of wind stress for dtm - ,exp_const=9.5 & !< coefficient in exponet profile - ,delz=0.1 & !< vertical increment for integral calculation (m) - ,von=0.4 & !< von karman's "constant" - ,t0k=273.16 & !< celsius to kelvin - ,gray=0.97 & - ,sst_max=308.16 & - ,tw_max=5.0 & - ,wd_max=2.0 & - ,omg_m =1.0 & !< trace factor to apply salinity effect - ,omg_rot = 1.0 & !< trace factor to apply rotation effect - ,omg_sh = 1.0 & !< trace factor to apply sensible heat due to rainfall effect - ,visw=1.e-6 & !< m2/s kinematic viscosity water - ,novalue=0 & - ,smallnumber=1.e-6 & - ,timestep_oc=sec_in_day/8. & !< time step in the ocean model (3 hours) - ,radian=2.*pi/180. & - ,rad2deg=180./pi & - ,cp_w=4000. & !< specific heat water (j/kg/k ) - ,rho0_w=1022.0 & !< density water (kg/m3 ) (or 1024.438) - ,vis_w=1.e-6 & !< kinematic viscosity water (m2/s ) - ,tc_w=0.6 & !< thermal conductivity water (w/m/k ) - ,capa_w =3950.0 & !< heat capacity of sea water ! - ,thref =1.0e-3 !< reference value of specific volume (m**3/kg) + ! + ! general constants + real (kind=kind_phys), parameter :: & + sec_in_day = 86400. & + ,sec_in_hour = 3600. & + ,solar_time_6am = 21600.0 & + ,const_rot = 0.000073 & !< constant to calculate corioli force + ,ri_c = 0.65 & + ,ri_g = 0.25 & + ,eps_z_w = 0.01 & !< criteria to finish iterations for z_w + ,eps_conv = 0.01 & !< criteria to finish iterations for d_conv + ,eps_sfs = 0.01 & !< criteria to finish iterations for d_sfs + ,z_w_max = 20.0 & !< max warm layer thickness + ,z_w_min = 0.2 & !< min warm layer thickness + ,z_w_ini = 0.2 & !< initial warm layer thickness in dtl_onset + ,z_c_max = 0.01 & !< maximum of sub-layer thickness (m) + ,z_c_ini = 0.001 & !< initial value of z_c + ,ustar_a_min = 0.031 & !< minimum of friction wind speed (m/s): 0.031 ~ 1m/s at 10 m hight + ,tau_min = 0.005 & !< minimum of wind stress for dtm + ,exp_const = 9.5 & !< coefficient in exponet profile + ,delz = 0.1 & !< vertical increment for integral calculation (m) + ,von = 0.4 & !< von karman's "constant" + ,t0k = 273.16 & !< celsius to kelvin + ,gray = 0.97 & + ,sst_max = 308.16 & + ,tw_max = 5.0 & + ,wd_max = 2.0 & + ,omg_m = 1.0 & !< trace factor to apply salinity effect + ,omg_rot = 1.0 & !< trace factor to apply rotation effect + ,omg_sh = 1.0 & !< trace factor to apply sensible heat due to rainfall effect + ,visw = 1.e-6 & !< m2/s kinematic viscosity water + ,novalue = 0 & + ,smallnumber = 1.e-6 & + ,timestep_oc = sec_in_day/8. & !< time step in the ocean model (3 hours) + ,radian = 2.*pi/180. & + ,rad2deg = 180./pi & + ,cp_w = 4000. & !< specific heat water (j/kg/k ) + ,rho0_w = 1022.0 & !< density water (kg/m3 ) (or 1024.438) + ,vis_w = 1.e-6 & !< kinematic viscosity water (m2/s ) + ,tc_w = 0.6 & !< thermal conductivity water (w/m/k ) + ,capa_w = 3950.0 & !< heat capacity of sea water ! + ,thref = 1.0e-3 !< reference value of specific volume (m**3/kg) !!$!============================================ !!$ diff --git a/physics/module_nst_water_prop.f90 b/physics/module_nst_water_prop.f90 index 2b36be5df..858659e90 100644 --- a/physics/module_nst_water_prop.f90 +++ b/physics/module_nst_water_prop.f90 @@ -1,3 +1,4 @@ + !>\file module_nst_water_prop.f90 !! This file contains GFS NSST water property subroutines. @@ -5,46 +6,45 @@ !!This module contains GFS NSST water property subroutines. !!\ingroup gfs_nst_main_mod module module_nst_water_prop - use machine, only : kind_phys - use module_nst_parameters, only : t0k + use machine , only : kind_phys + use module_nst_parameters , only : t0k, zero, one, half + + implicit none ! private - public :: rhocoef,density,sw_rad,sw_rad_aw,sw_rad_sum,sw_rad_upper,sw_rad_upper_aw,sw_rad_skin,grv,solar_time_from_julian,compjd, & - sw_ps_9b,sw_ps_9b_aw,get_dtzm_point,get_dtzm_2d + public :: rhocoef, density, sw_rad_skin, grv, sw_ps_9b, sw_ps_9b_aw, get_dtzm_point, get_dtzm_2d - integer, parameter :: kp = kind_phys - real (kind=kind_phys), parameter :: zero = 0.0_kp, one = 1.0_kp, half=0.5_kp ! interface sw_ps_9b module procedure sw_ps_9b - end interface + end interface sw_ps_9b interface sw_ps_9b_aw module procedure sw_ps_9b_aw - end interface + end interface sw_ps_9b_aw ! interface sw_rad module procedure sw_fairall_6exp_v1 ! sw_wick_v1 - end interface + end interface sw_rad interface sw_rad_aw module procedure sw_fairall_6exp_v1_aw - end interface + end interface sw_rad_aw interface sw_rad_sum module procedure sw_fairall_6exp_v1_sum - end interface + end interface sw_rad_sum interface sw_rad_upper module procedure sw_soloviev_3exp_v2 - end interface + end interface sw_rad_upper interface sw_rad_upper_aw module procedure sw_soloviev_3exp_v2_aw - end interface + end interface sw_rad_upper_aw interface sw_rad_skin module procedure sw_ohlmann_v1 - end interface + end interface sw_rad_skin contains ! ------------------------------------------------------ -!>\ingroup gfs_nst_main_mod -!! This subroutine computes thermal expansion coefficient (alpha) -!! and saline contraction coefficient (beta). + !>\ingroup gfs_nst_main_mod + !! This subroutine computes thermal expansion coefficient (alpha) + !! and saline contraction coefficient (beta). subroutine rhocoef(t, s, rhoref, alpha, beta) ! ------------------------------------------------------ @@ -55,7 +55,6 @@ subroutine rhocoef(t, s, rhoref, alpha, beta) ! dynamical oceanography, pp310. ! note: compression effects are not included - implicit none real(kind=kind_phys), intent(in) :: t, s, rhoref real(kind=kind_phys), intent(out) :: alpha, beta real(kind=kind_phys) :: tc @@ -87,11 +86,10 @@ subroutine rhocoef(t, s, rhoref, alpha, beta) end subroutine rhocoef ! ---------------------------------------- -!>\ingroup gfs_nst_main_mod -!! This subroutine computes sea water density. + !>\ingroup gfs_nst_main_mod + !! This subroutine computes sea water density. subroutine density(t, s, rho) ! ---------------------------------------- - implicit none ! input real(kind=kind_phys), intent(in) :: t !unit, k @@ -125,9 +123,9 @@ end subroutine density ! !====================== ! -!>\ingroup gfs_nst_main_mod -!! This subroutine computes the fraction of the solar radiation absorbed -!! by the depth z following Paulson and Simpson (1981) \cite paulson_and_simpson_1981 . + !>\ingroup gfs_nst_main_mod + !! This subroutine computes the fraction of the solar radiation absorbed + !! by the depth z following Paulson and Simpson (1981) \cite paulson_and_simpson_1981 . elemental subroutine sw_ps_9b(z,fxp) ! ! fraction of the solar radiation absorbed by the ocean at the depth z @@ -139,17 +137,15 @@ elemental subroutine sw_ps_9b(z,fxp) ! output: ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none real(kind=kind_phys), intent(in) :: z real(kind=kind_phys), intent(out) :: fxp - real(kind=kind_phys), dimension(9), parameter :: & - f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & - ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) + real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) + real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) ! if(z>zero) then - fxp=one-(f(1)*exp(-z/gamma(1))+f(2)*exp(-z/gamma(2))+f(3)*exp(-z/gamma(3))+ & - f(4)*exp(-z/gamma(4))+f(5)*exp(-z/gamma(5))+f(6)*exp(-z/gamma(6))+ & - f(7)*exp(-z/gamma(7))+f(8)*exp(-z/gamma(8))+f(9)*exp(-z/gamma(9))) + fxp=one-(f(1)*exp(-z/gamma(1))+f(2)*exp(-z/gamma(2))+f(3)*exp(-z/gamma(3))+ & + f(4)*exp(-z/gamma(4))+f(5)*exp(-z/gamma(5))+f(6)*exp(-z/gamma(6))+ & + f(7)*exp(-z/gamma(7))+f(8)*exp(-z/gamma(8))+f(9)*exp(-z/gamma(9))) else fxp=zero endif @@ -161,8 +157,8 @@ end subroutine sw_ps_9b ! !====================== ! -!>\ingroup gfs_nst_main_mod -!! This subroutine + !>\ingroup gfs_nst_main_mod + !! This subroutine elemental subroutine sw_ps_9b_aw(z,aw) ! ! d(fw)/d(z) for 9-band @@ -173,17 +169,15 @@ elemental subroutine sw_ps_9b_aw(z,aw) ! output: ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none real(kind=kind_phys), intent(in) :: z real(kind=kind_phys), intent(out) :: aw - real(kind=kind_phys), dimension(9), parameter :: & - f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & - ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) + real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) + real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) ! if(z>zero) then - aw=(f(1)/gamma(1))*exp(-z/gamma(1))+(f(2)/gamma(2))*exp(-z/gamma(2))+(f(3)/gamma(3))*exp(-z/gamma(3))+ & - (f(1)/gamma(4))*exp(-z/gamma(4))+(f(2)/gamma(5))*exp(-z/gamma(5))+(f(6)/gamma(6))*exp(-z/gamma(6))+ & - (f(1)/gamma(7))*exp(-z/gamma(7))+(f(2)/gamma(8))*exp(-z/gamma(8))+(f(9)/gamma(9))*exp(-z/gamma(9)) + aw=(f(1)/gamma(1))*exp(-z/gamma(1))+(f(2)/gamma(2))*exp(-z/gamma(2))+(f(3)/gamma(3))*exp(-z/gamma(3))+ & + (f(1)/gamma(4))*exp(-z/gamma(4))+(f(2)/gamma(5))*exp(-z/gamma(5))+(f(6)/gamma(6))*exp(-z/gamma(6))+ & + (f(1)/gamma(7))*exp(-z/gamma(7))+(f(2)/gamma(8))*exp(-z/gamma(8))+(f(9)/gamma(9))*exp(-z/gamma(9)) else aw=zero endif @@ -191,10 +185,10 @@ elemental subroutine sw_ps_9b_aw(z,aw) end subroutine sw_ps_9b_aw ! !====================== -!>\ingroup gfs_nst_main_mod -!! This subroutine computes fraction of the solar radiation absorbed by the ocean at the depth -!! z (Fairall et al. (1996) \cite fairall_et_al_1996, p. 1298) following Paulson and Simpson -!! (1981) \cite paulson_and_simpson_1981 . + !>\ingroup gfs_nst_main_mod + !! This subroutine computes fraction of the solar radiation absorbed by the ocean at the depth + !! z (Fairall et al. (1996) \cite fairall_et_al_1996, p. 1298) following Paulson and Simpson + !! (1981) \cite paulson_and_simpson_1981 . elemental subroutine sw_fairall_6exp_v1(z,fxp) ! ! fraction of the solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298) @@ -206,13 +200,13 @@ elemental subroutine sw_fairall_6exp_v1(z,fxp) ! output: ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none - real(kind=kind_phys),intent(in):: z - real(kind=kind_phys),intent(out):: fxp - real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & - ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) - real(kind=kind_phys),dimension(9) :: zgamma - real(kind=kind_phys),dimension(9) :: f_c + real(kind=kind_phys), intent(in) :: z + real(kind=kind_phys), intent(out) :: fxp + + real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) + real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) + real(kind=kind_phys), dimension(9) :: zgamma + real(kind=kind_phys), dimension(9) :: f_c ! if(z>zero) then zgamma=z/gamma @@ -227,10 +221,10 @@ end subroutine sw_fairall_6exp_v1 !====================== ! ! -!>\ingroup gfs_nst_main_mod -!! This subroutine calculates fraction of the solar radiation absorbed by the -!! ocean at the depth z (fairall et al.(1996) \cite fairall_et_al_1996; p.1298) -!! following Paulson and Simpson (1981) \cite paulson_and_simpson_1981. + !>\ingroup gfs_nst_main_mod + !! This subroutine calculates fraction of the solar radiation absorbed by the + !! ocean at the depth z (fairall et al.(1996) \cite fairall_et_al_1996; p.1298) + !! following Paulson and Simpson (1981) \cite paulson_and_simpson_1981. elemental subroutine sw_fairall_6exp_v1_aw(z,aw) ! ! fraction of the solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298) @@ -244,34 +238,31 @@ elemental subroutine sw_fairall_6exp_v1_aw(z,aw) ! ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none - real(kind=kind_phys),intent(in):: z - real(kind=kind_phys),intent(out):: aw - real(kind=kind_phys) :: fxp - real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) & - ,gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) - real(kind=kind_phys),dimension(9) :: zgamma - real(kind=kind_phys),dimension(9) :: f_aw + real(kind=kind_phys), intent(in) :: z + real(kind=kind_phys), intent(out) :: aw + + real(kind=kind_phys), dimension(9), parameter :: f=(/0.237,0.36,0.179,0.087,0.08,0.0246,0.025,0.007,0.0004/) + real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) + real(kind=kind_phys), dimension(9) :: zgamma + real(kind=kind_phys), dimension(9) :: f_aw ! if(z>zero) then zgamma=z/gamma f_aw=(f/z)*((gamma/z)*(one-exp(-zgamma))-exp(-zgamma)) aw=sum(f_aw) - -! write(*,'(a,f6.2,f12.6,9f10.4)') 'z,aw in sw_rad_aw : ',z,aw,f_aw - + ! write(*,'(a,f6.2,f12.6,9f10.4)') 'z,aw in sw_rad_aw : ',z,aw,f_aw else aw=zero endif ! end subroutine sw_fairall_6exp_v1_aw ! -!>\ingroup gfs_nst_main_mod -!! This subroutine computes fraction of the solar radiation absorbed by the ocean at the -!! depth z (Fairall et al.(1996) \cite fairall_et_al_1996 , p.1298) following Paulson and -!! Simpson (1981) \cite paulson_and_simpson_1981 . -!>\param[in] z depth (m) -!>\param[out] sum for convection depth calculation + !>\ingroup gfs_nst_main_mod + !! This subroutine computes fraction of the solar radiation absorbed by the ocean at the + !! depth z (Fairall et al.(1996) \cite fairall_et_al_1996 , p.1298) following Paulson and + !! Simpson (1981) \cite paulson_and_simpson_1981 . + !>\param[in] z depth (m) + !>\param[out] sum for convection depth calculation elemental subroutine sw_fairall_6exp_v1_sum(z,sum) ! ! fraction of the solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298) @@ -284,30 +275,30 @@ elemental subroutine sw_fairall_6exp_v1_sum(z,sum) ! sum: for convection depth calculation ! ! - implicit none - real(kind=kind_phys),intent(in):: z - real(kind=kind_phys),intent(out):: sum + real(kind=kind_phys), intent(in) :: z + real(kind=kind_phys), intent(out) :: sum + real(kind=kind_phys), dimension(9), parameter :: gamma=(/34.8,2.27,3.15e-2,5.48e-3,8.32e-4,1.26e-4,3.13e-4,7.82e-5,1.44e-5/) - real(kind=kind_phys),dimension(9) :: zgamma - real(kind=kind_phys),dimension(9) :: f_sum + real(kind=kind_phys), dimension(9) :: zgamma + real(kind=kind_phys), dimension(9) :: f_sum ! -! zgamma=z/gamma -! f_sum=(zgamma/z)*exp(-zgamma) -! sum=sum(f_sum) + ! zgamma=z/gamma + ! f_sum=(zgamma/z)*exp(-zgamma) + ! sum=sum(f_sum) - sum=(one/gamma(1))*exp(-z/gamma(1))+(one/gamma(2))*exp(-z/gamma(2))+(one/gamma(3))*exp(-z/gamma(3))+ & - (one/gamma(4))*exp(-z/gamma(4))+(one/gamma(5))*exp(-z/gamma(5))+(one/gamma(6))*exp(-z/gamma(6))+ & - (one/gamma(7))*exp(-z/gamma(7))+(one/gamma(8))*exp(-z/gamma(8))+(one/gamma(9))*exp(-z/gamma(9)) + sum=( one/gamma(1))*exp(-z/gamma(1))+(one/gamma(2))*exp(-z/gamma(2))+(one/gamma(3))*exp(-z/gamma(3))+ & + (one/gamma(4))*exp(-z/gamma(4))+(one/gamma(5))*exp(-z/gamma(5))+(one/gamma(6))*exp(-z/gamma(6))+ & + (one/gamma(7))*exp(-z/gamma(7))+(one/gamma(8))*exp(-z/gamma(8))+(one/gamma(9))*exp(-z/gamma(9)) ! end subroutine sw_fairall_6exp_v1_sum ! !====================== -!>\ingroup gfs_nst_main_mod -!! Solar radiation absorbed by the ocean at the depth z (Fairall et al. (1996) -!! \cite fairall_et_al_1996, p.1298) -!!\param[in] f_sol_0 solar radiation at the ocean surface (\f$W m^{-2}\f$) -!!\param[in] z depth (m) -!!\param[out] df_sol_z solar radiation absorbed by the ocean at depth z (\f$W m^{-2}\f$) + !>\ingroup gfs_nst_main_mod + !! Solar radiation absorbed by the ocean at the depth z (Fairall et al. (1996) + !! \cite fairall_et_al_1996, p.1298) + !!\param[in] f_sol_0 solar radiation at the ocean surface (\f$W m^{-2}\f$) + !!\param[in] z depth (m) + !!\param[out] df_sol_z solar radiation absorbed by the ocean at depth z (\f$W m^{-2}\f$) elemental subroutine sw_fairall_simple_v1(f_sol_0,z,df_sol_z) ! ! solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1298) @@ -319,9 +310,8 @@ elemental subroutine sw_fairall_simple_v1(f_sol_0,z,df_sol_z) ! output: ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none - real(kind=kind_phys),intent(in):: z,f_sol_0 - real(kind=kind_phys),intent(out):: df_sol_z + real(kind=kind_phys), intent(in) :: z,f_sol_0 + real(kind=kind_phys), intent(out) :: df_sol_z ! if(z>zero) then df_sol_z=f_sol_0*(0.137+11.0*z-6.6e-6/z*(one-exp(-z/8.e-4))) @@ -333,12 +323,12 @@ end subroutine sw_fairall_simple_v1 ! !====================== ! -!>\ingroup gfs_nst_main_mod -!! solar radiation absorbed by the ocean at the depth z (Zeng and Beljaars (2005) -!! \cite zeng_and_beljaars_2005 , p.5). -!>\param[in] f_sol_0 solar radiation at the ocean surface (\f$W m^{-2}\f$) -!>\param[in] z depth (m) -!>\param[out] df_sol_z solar radiation absorbed by the ocean at depth z (\f$W m^{-2}\f$) + !>\ingroup gfs_nst_main_mod + !! solar radiation absorbed by the ocean at the depth z (Zeng and Beljaars (2005) + !! \cite zeng_and_beljaars_2005 , p.5). + !>\param[in] f_sol_0 solar radiation at the ocean surface (\f$W m^{-2}\f$) + !>\param[in] z depth (m) + !>\param[out] df_sol_z solar radiation absorbed by the ocean at depth z (\f$W m^{-2}\f$) elemental subroutine sw_wick_v1(f_sol_0,z,df_sol_z) ! ! solar radiation absorbed by the ocean at the depth z (zeng and beljaars, 2005, p.5) @@ -350,9 +340,8 @@ elemental subroutine sw_wick_v1(f_sol_0,z,df_sol_z) ! output: ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none - real(kind=kind_phys),intent(in):: z,f_sol_0 - real(kind=kind_phys),intent(out):: df_sol_z + real(kind=kind_phys), intent(in) :: z,f_sol_0 + real(kind=kind_phys), intent(out) :: df_sol_z ! if(z>zero) then df_sol_z=f_sol_0*(0.065+11.0*z-6.6e-5/z*(one-exp(-z/8.e-4))) @@ -364,13 +353,13 @@ end subroutine sw_wick_v1 ! !====================== ! -!>\ingroup gfs_nst_main_mod -!! This subroutine computes solar radiation absorbed by the ocean at the depth z -!! (Fairall et al.(1996) \cite fairall_et_al_1996 , p.1301) following -!! Soloviev and Vershinsky (1982) \cite soloviev_and_vershinsky_1982. -!>\param[in] f_sol_0 solar radiation at the ocean surface (\f$W m^{-2}\f$) -!>\param[in] z depth (m) -!>\param[out] df_sol_z solar radiation absorbed by the ocean at depth z (\f$W m^{-2}\f$) + !>\ingroup gfs_nst_main_mod + !! This subroutine computes solar radiation absorbed by the ocean at the depth z + !! (Fairall et al.(1996) \cite fairall_et_al_1996 , p.1301) following + !! Soloviev and Vershinsky (1982) \cite soloviev_and_vershinsky_1982. + !>\param[in] f_sol_0 solar radiation at the ocean surface (\f$W m^{-2}\f$) + !>\param[in] z depth (m) + !>\param[out] df_sol_z solar radiation absorbed by the ocean at depth z (\f$W m^{-2}\f$) elemental subroutine sw_soloviev_3exp_v1(f_sol_0,z,df_sol_z) ! ! solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1301) @@ -383,12 +372,11 @@ elemental subroutine sw_soloviev_3exp_v1(f_sol_0,z,df_sol_z) ! output: ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none - real(kind=kind_phys),intent(in):: z,f_sol_0 - real(kind=kind_phys),intent(out):: df_sol_z - real(kind=kind_phys),dimension(3) :: f_c - real(kind=kind_phys), dimension(3), parameter :: f=(/0.45,0.27,0.28/) & - ,gamma=(/12.8,0.357,0.014/) + real(kind=kind_phys), intent(in) :: z,f_sol_0 + real(kind=kind_phys), intent(out) :: df_sol_z + real(kind=kind_phys), dimension(3) :: f_c + real(kind=kind_phys), dimension(3), parameter :: f=(/0.45,0.27,0.28/) + real(kind=kind_phys), dimension(3), parameter :: gamma=(/12.82,0.357,0.014/) ! if(z>zero) then f_c = f*gamma(int(one-exp(-z/gamma))) @@ -401,7 +389,7 @@ end subroutine sw_soloviev_3exp_v1 ! !====================== ! -!>\ingroup gfs_nst_main_mod + !>\ingroup gfs_nst_main_mod elemental subroutine sw_soloviev_3exp_v2(f_sol_0,z,df_sol_z) ! ! solar radiation absorbed by the ocean at the depth z (fairall et all, 1996, p. 1301) @@ -414,9 +402,8 @@ elemental subroutine sw_soloviev_3exp_v2(f_sol_0,z,df_sol_z) ! output: ! df_sol_z: solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none - real(kind=kind_phys),intent(in):: z,f_sol_0 - real(kind=kind_phys),intent(out):: df_sol_z + real(kind=kind_phys), intent(in) :: z,f_sol_0 + real(kind=kind_phys), intent(out) :: df_sol_z ! if(z>zero) then df_sol_z=f_sol_0*(one & @@ -430,7 +417,7 @@ elemental subroutine sw_soloviev_3exp_v2(f_sol_0,z,df_sol_z) ! end subroutine sw_soloviev_3exp_v2 -!>\ingroup gfs_nst_main_mod + !>\ingroup gfs_nst_main_mod elemental subroutine sw_soloviev_3exp_v2_aw(z,aw) ! ! aw = d(fxp)/d(z) @@ -442,10 +429,9 @@ elemental subroutine sw_soloviev_3exp_v2_aw(z,aw) ! output: ! aw: d(fxp)/d(z) ! - implicit none - real(kind=kind_phys),intent(in):: z - real(kind=kind_phys),intent(out):: aw - real(kind=kind_phys):: fxp + real(kind=kind_phys), intent(in) :: z + real(kind=kind_phys), intent(out) :: aw + real(kind=kind_phys) :: fxp ! if(z>zero) then fxp=(one & @@ -462,7 +448,7 @@ end subroutine sw_soloviev_3exp_v2_aw ! !====================== ! -!>\ingroup gfs_nst_main_mod + !>\ingroup gfs_nst_main_mod elemental subroutine sw_ohlmann_v1(z,fxp) ! ! fraction of the solar radiation absorbed by the ocean at the depth z @@ -473,9 +459,8 @@ elemental subroutine sw_ohlmann_v1(z,fxp) ! output: ! fxp: fraction of the solar radiation absorbed by the ocean at depth z (w/m^2) ! - implicit none - real(kind=kind_phys),intent(in):: z - real(kind=kind_phys),intent(out):: fxp + real(kind=kind_phys), intent(in) :: z + real(kind=kind_phys), intent(out) :: fxp ! if(z>zero) then fxp=.065+11.*z-6.6e-5/z*(one-exp(-z/8.0e-4)) @@ -486,276 +471,264 @@ elemental subroutine sw_ohlmann_v1(z,fxp) end subroutine sw_ohlmann_v1 ! -!>\ingroup gfs_nst_main_mod -function grv(x) - real(kind=kind_phys) :: x !< sin(lat) - real(kind=kind_phys) :: gamma,c1,c2,c3,c4 - gamma=9.7803267715 - c1=0.0052790414 - c2=0.0000232718 - c3=0.0000001262 - c4=0.0000000007 - - grv=gamma*(1.0+(c1*x**2)+(c2*x**4)+(c3*x**6)+(c4*x**8)) -end function grv - -!>\ingroup gfs_nst_main_mod -!>This subroutine computes solar time from the julian date. -subroutine solar_time_from_julian(jday,xlon,soltim) - ! - ! calculate solar time from the julian date + !>\ingroup gfs_nst_main_mod + real(kind_phys) function grv(x) + real(kind=kind_phys) :: x !< sin(lat) + real(kind=kind_phys) :: gamma,c1,c2,c3,c4 + gamma=9.7803267715 + c1=0.0052790414 + c2=0.0000232718 + c3=0.0000001262 + c4=0.0000000007 + + grv=gamma*(one+(c1*x**2)+(c2*x**4)+(c3*x**6)+(c4*x**8)) + end function grv + + !>\ingroup gfs_nst_main_mod + !>This subroutine computes solar time from the julian date. + subroutine solar_time_from_julian(jday,xlon,soltim) + ! + ! calculate solar time from the julian date + ! + real(kind=kind_phys), intent(in) :: jday + real(kind=kind_phys), intent(in) :: xlon + real(kind=kind_phys), intent(out) :: soltim + real(kind=kind_phys) :: fjd,xhr,xmin,xsec,intime + ! + fjd=jday-floor(jday) + fjd=jday + xhr=floor(fjd*24.0)-sign(12.0,fjd-half) + xmin=nint(fjd*1440.0)-(xhr+sign(12.0,fjd-half))*60.0 + xsec=zero + intime=xhr+xmin/60.0+xsec/3600.0+24.0 + soltim=mod(xlon/15.0+intime,24.0)*3600.0 + end subroutine solar_time_from_julian + ! - implicit none - real(kind=kind_phys), intent(in) :: jday - real(kind=kind_phys), intent(in) :: xlon - real(kind=kind_phys), intent(out) :: soltim - real(kind=kind_phys) :: fjd,xhr,xmin,xsec,intime - integer :: nn + !*********************************************************************** ! - fjd=jday-floor(jday) - fjd=jday - xhr=floor(fjd*24.0)-sign(12.0,fjd-half) - xmin=nint(fjd*1440.0)-(xhr+sign(12.0,fjd-half))*60.0 - xsec=zero - intime=xhr+xmin/60.0+xsec/3600.0+24.0 - soltim=mod(xlon/15.0+intime,24.0)*3600.0 -end subroutine solar_time_from_julian - -! -!*********************************************************************** -! -!>\ingroup gfs_nst_main_mod -!> This subroutine computes julian day and fraction from year, -!! month, day and time UTC. - subroutine compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd) -!fpp$ noconcur r -!$$$ subprogram documentation block -! . . . . -! subprogram: compjd computes julian day and fraction -! prgmmr: kenneth campana org: w/nmc23 date: 89-07-07 -! -! abstract: computes julian day and fraction -! from year, month, day and time utc. -! -! program history log: -! 77-05-06 ray orzol,gfdl -! 98-05-15 iredell y2k compliance -! -! usage: call compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd) -! input argument list: -! jyr - year (4 digits) -! jmnth - month -! jday - day -! jhr - hour -! jmn - minutes -! output argument list: -! jd - julian day. -! fjd - fraction of the julian day. -! -! subprograms called: -! iw3jdn compute julian day number -! -! attributes: -! language: fortran. -! -!$$$ - use machine , only :kind_phys - implicit none -! - integer jyr,jmnth,jday,jhr,jmn,jd - integer iw3jdn - real (kind=kind_phys) fjd - jd=iw3jdn(jyr,jmnth,jday) - if(jhr.lt.12) then - jd=jd-1 - fjd=half+jhr/24.+jmn/1440. - else - fjd=(jhr-12)/24.+jmn/1440. - endif - end subroutine compjd - -!>\ingroup gfs_nst_main_mod -!>This subroutine computes dtm (the mean of \f$dT(z)\f$). - subroutine get_dtzm_point(xt,xz,dt_cool,zc,z1,z2,dtm) -! ===================================================================== ! -! ! -! description: get dtm = mean of dT(z) (z1 - z2) with NSST dT(z) ! -! dT(z) = (1-z/xz)*dt_warm - (1-z/zc)*dt_cool ! -! ! -! usage: ! -! ! -! call get_dtm12 ! -! ! -! inputs: ! -! (xt,xz,dt_cool,zc,z1,z2, ! -! outputs: ! -! dtm) ! -! ! -! program history log: ! -! ! -! 2015 -- xu li createad original code ! -! inputs: ! -! xt - real, heat content in dtl 1 ! -! xz - real, dtl thickness 1 ! -! dt_cool - real, sub-layer cooling amount 1 ! -! zc - sub-layer cooling thickness 1 ! -! z1 - lower bound of depth of sea temperature 1 ! -! z2 - upper bound of depth of sea temperature 1 ! -! outputs: ! -! dtm - mean of dT(z) (z1 to z2) 1 ! -! - use machine , only : kind_phys - - implicit none - - real (kind=kind_phys), intent(in) :: xt,xz,dt_cool,zc,z1,z2 - real (kind=kind_phys), intent(out) :: dtm -! Local variables - real (kind=kind_phys) :: dt_warm,dtw,dtc - -! -! get the mean warming in the range of z=z1 to z=z2 -! - dtw = zero - if ( xt > zero ) then - dt_warm = (xt+xt)/xz ! Tw(0) - if ( z1 < z2) then - if ( z2 < xz ) then - dtw = dt_warm*(one-(z1+z2)/(xz+xz)) - elseif ( z1 < xz .and. z2 >= xz ) then - dtw = half*(one-z1/xz)*dt_warm*(xz-z1)/(z2-z1) - endif - elseif ( z1 == z2 ) then - if ( z1 < xz ) then - dtw = dt_warm*(one-z1/xz) - endif + !>\ingroup gfs_nst_main_mod + !> This subroutine computes julian day and fraction from year, + !! month, day and time UTC. + subroutine compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd) + !fpp$ noconcur r + !$$$ subprogram documentation block + ! . . . . + ! subprogram: compjd computes julian day and fraction + ! prgmmr: kenneth campana org: w/nmc23 date: 89-07-07 + ! + ! abstract: computes julian day and fraction + ! from year, month, day and time utc. + ! + ! program history log: + ! 77-05-06 ray orzol,gfdl + ! 98-05-15 iredell y2k compliance + ! + ! usage: call compjd(jyr,jmnth,jday,jhr,jmn,jd,fjd) + ! input argument list: + ! jyr - year (4 digits) + ! jmnth - month + ! jday - day + ! jhr - hour + ! jmn - minutes + ! output argument list: + ! jd - julian day. + ! fjd - fraction of the julian day. + ! + ! subprograms called: + ! iw3jdn compute julian day number + ! + ! attributes: + ! language: fortran. + ! + !$$$ + ! + integer :: jyr,jmnth,jday,jhr,jmn,jd + integer :: iw3jdn + real (kind=kind_phys) fjd + jd=iw3jdn(jyr,jmnth,jday) + if(jhr.lt.12) then + jd=jd-1 + fjd=half+jhr/24.+jmn/1440. + else + fjd=(jhr-12)/24.+jmn/1440. endif - endif -! -! get the mean cooling in the range of z=z1 to z=z2 -! - dtc = zero - if ( zc > zero ) then - if ( z1 < z2) then - if ( z2 < zc ) then - dtc = dt_cool*(one-(z1+z2)/(zc+zc)) - elseif ( z1 < zc .and. z2 >= zc ) then - dtc = half*(one-z1/zc)*dt_cool*(zc-z1)/(z2-z1) - endif - elseif ( z1 == z2 ) then - if ( z1 < zc ) then - dtc = dt_cool*(one-z1/zc) - endif + end subroutine compjd + + !>\ingroup gfs_nst_main_mod + !>This subroutine computes dtm (the mean of \f$dT(z)\f$). + subroutine get_dtzm_point(xt,xz,dt_cool,zc,z1,z2,dtm) + ! ===================================================================== ! + ! ! + ! description: get dtm = mean of dT(z) (z1 - z2) with NSST dT(z) ! + ! dT(z) = (1-z/xz)*dt_warm - (1-z/zc)*dt_cool ! + ! ! + ! usage: ! + ! ! + ! call get_dtm12 ! + ! ! + ! inputs: ! + ! (xt,xz,dt_cool,zc,z1,z2, ! + ! outputs: ! + ! dtm) ! + ! ! + ! program history log: ! + ! ! + ! 2015 -- xu li createad original code ! + ! inputs: ! + ! xt - real, heat content in dtl 1 ! + ! xz - real, dtl thickness 1 ! + ! dt_cool - real, sub-layer cooling amount 1 ! + ! zc - sub-layer cooling thickness 1 ! + ! z1 - lower bound of depth of sea temperature 1 ! + ! z2 - upper bound of depth of sea temperature 1 ! + ! outputs: ! + ! dtm - mean of dT(z) (z1 to z2) 1 ! + ! + real (kind=kind_phys), intent(in) :: xt,xz,dt_cool,zc,z1,z2 + real (kind=kind_phys), intent(out) :: dtm + ! Local variables + real (kind=kind_phys) :: dt_warm,dtw,dtc + + ! + ! get the mean warming in the range of z=z1 to z=z2 + ! + dtw = zero + if ( xt > zero ) then + dt_warm = (xt+xt)/xz ! Tw(0) + if ( z1 < z2) then + if ( z2 < xz ) then + dtw = dt_warm*(one-(z1+z2)/(xz+xz)) + elseif ( z1 < xz .and. z2 >= xz ) then + dtw = half*(one-z1/xz)*dt_warm*(xz-z1)/(z2-z1) + endif + elseif ( z1 == z2 ) then + if ( z1 < xz ) then + dtw = dt_warm*(one-z1/xz) + endif + endif endif - endif - -! -! get the mean T departure from Tf in the range of z=z1 to z=z2 -! - dtm = dtw - dtc - - end subroutine get_dtzm_point - -!>\ingroup gfs_nst_main_mod - subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm) -!subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,icy,z1,z2,nx,ny,dtm) -! ===================================================================== ! -! ! -! description: get dtm = mean of dT(z) (z1 - z2) with NSST dT(z) ! -! dT(z) = (1-z/xz)*dt_warm - (1-z/zc)*dt_cool ! -! ! -! usage: ! -! ! -! call get_dtzm_2d ! -! ! -! inputs: ! -! (xt,xz,dt_cool,zc,z1,z2, ! -! outputs: ! -! dtm) ! -! ! -! program history log: ! -! ! -! 2015 -- xu li createad original code ! -! inputs: ! -! xt - real, heat content in dtl 1 ! -! xz - real, dtl thickness 1 ! -! dt_cool - real, sub-layer cooling amount 1 ! -! zc - sub-layer cooling thickness 1 ! -! wet - logical, flag for wet point (ocean or lake) 1 ! -! icy - logical, flag for ice point (ocean or lake) 1 ! -! nx - integer, dimension in x-direction (zonal) 1 ! -! ny - integer, dimension in y-direction (meridional) 1 ! -! z1 - lower bound of depth of sea temperature 1 ! -! z2 - upper bound of depth of sea temperature 1 ! -! nth - integer, num of openmp thread 1 ! -! outputs: ! -! dtm - mean of dT(z) (z1 to z2) 1 ! -! - use machine , only : kind_phys - - implicit none - - integer, intent(in) :: nx,ny, nth - real (kind=kind_phys), dimension(nx,ny), intent(in) :: xt,xz,dt_cool,zc - logical, dimension(nx,ny), intent(in) :: wet -! logical, dimension(nx,ny), intent(in) :: wet,icy - real (kind=kind_phys), intent(in) :: z1,z2 - real (kind=kind_phys), dimension(nx,ny), intent(out) :: dtm -! Local variables - integer :: i,j - real (kind=kind_phys) :: dt_warm, dtw, dtc, xzi - - -!$omp parallel do num_threads (nth) private(j,i,dtw,dtc,xzi) - do j = 1, ny - do i= 1, nx - - dtm(i,j) = zero ! initialize dtm - - if ( wet(i,j) ) then -! -! get the mean warming in the range of z=z1 to z=z2 -! - dtw = zero - if ( xt(i,j) > zero ) then - xzi = one / xz(i,j) - dt_warm = (xt(i,j)+xt(i,j)) * xzi ! Tw(0) - if (z1 < z2) then - if ( z2 < xz(i,j) ) then - dtw = dt_warm * (one-half*(z1+z2)*xzi) - elseif (z1 < xz(i,j) .and. z2 >= xz(i,j) ) then - dtw = half*(one-z1*xzi)*dt_warm*(xz(i,j)-z1)/(z2-z1) - endif - elseif (z1 == z2 ) then - if (z1 < xz(i,j) ) then - dtw = dt_warm * (one-z1*xzi) - endif + ! + ! get the mean cooling in the range of z=z1 to z=z2 + ! + dtc = zero + if ( zc > zero ) then + if ( z1 < z2) then + if ( z2 < zc ) then + dtc = dt_cool*(one-(z1+z2)/(zc+zc)) + elseif ( z1 < zc .and. z2 >= zc ) then + dtc = half*(one-z1/zc)*dt_cool*(zc-z1)/(z2-z1) endif - endif -! -! get the mean cooling in the range of z=0 to z=zsea -! - dtc = zero - if ( zc(i,j) > zero ) then - if ( z1 < z2) then - if ( z2 < zc(i,j) ) then - dtc = dt_cool(i,j) * (one-(z1+z2)/(zc(i,j)+zc(i,j))) - elseif ( z1 < zc(i,j) .and. z2 >= zc(i,j) ) then - dtc = half*(one-z1/zc(i,j))*dt_cool(i,j)*(zc(i,j)-z1)/(z2-z1) - endif - elseif ( z1 == z2 ) then - if ( z1 < zc(i,j) ) then - dtc = dt_cool(i,j) * (one-z1/zc(i,j)) - endif + elseif ( z1 == z2 ) then + if ( z1 < zc ) then + dtc = dt_cool*(one-z1/zc) endif - endif -! get the mean T departure from Tf in the range of z=z1 to z=z2 - dtm(i,j) = dtw - dtc - endif ! if ( wet(i,j)) then + endif + endif + + ! + ! get the mean T departure from Tf in the range of z=z1 to z=z2 + ! + dtm = dtw - dtc + + end subroutine get_dtzm_point + + !>\ingroup gfs_nst_main_mod + subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,z1,z2,nx,ny,nth,dtm) + !subroutine get_dtzm_2d(xt,xz,dt_cool,zc,wet,icy,z1,z2,nx,ny,dtm) + ! ===================================================================== ! + ! ! + ! description: get dtm = mean of dT(z) (z1 - z2) with NSST dT(z) ! + ! dT(z) = (1-z/xz)*dt_warm - (1-z/zc)*dt_cool ! + ! ! + ! usage: ! + ! ! + ! call get_dtzm_2d ! + ! ! + ! inputs: ! + ! (xt,xz,dt_cool,zc,z1,z2, ! + ! outputs: ! + ! dtm) ! + ! ! + ! program history log: ! + ! ! + ! 2015 -- xu li createad original code ! + ! inputs: ! + ! xt - real, heat content in dtl 1 ! + ! xz - real, dtl thickness 1 ! + ! dt_cool - real, sub-layer cooling amount 1 ! + ! zc - sub-layer cooling thickness 1 ! + ! wet - logical, flag for wet point (ocean or lake) 1 ! + ! icy - logical, flag for ice point (ocean or lake) 1 ! + ! nx - integer, dimension in x-direction (zonal) 1 ! + ! ny - integer, dimension in y-direction (meridional) 1 ! + ! z1 - lower bound of depth of sea temperature 1 ! + ! z2 - upper bound of depth of sea temperature 1 ! + ! nth - integer, num of openmp thread 1 ! + ! outputs: ! + ! dtm - mean of dT(z) (z1 to z2) 1 ! + ! + integer, intent(in) :: nx,ny, nth + real (kind=kind_phys), dimension(nx,ny), intent(in) :: xt,xz,dt_cool,zc + logical, dimension(nx,ny), intent(in) :: wet + ! logical, dimension(nx,ny), intent(in) :: wet,icy + real (kind=kind_phys), intent(in) :: z1,z2 + real (kind=kind_phys), dimension(nx,ny), intent(out) :: dtm + ! Local variables + integer :: i,j + real (kind=kind_phys) :: dt_warm, dtw, dtc, xzi + + + !$omp parallel do num_threads (nth) private(j,i,dtw,dtc,xzi) + do j = 1, ny + do i= 1, nx + + dtm(i,j) = zero ! initialize dtm + + if ( wet(i,j) ) then + ! + ! get the mean warming in the range of z=z1 to z=z2 + ! + dtw = zero + if ( xt(i,j) > zero ) then + xzi = one / xz(i,j) + dt_warm = (xt(i,j)+xt(i,j)) * xzi ! Tw(0) + if (z1 < z2) then + if ( z2 < xz(i,j) ) then + dtw = dt_warm * (one-half*(z1+z2)*xzi) + elseif (z1 < xz(i,j) .and. z2 >= xz(i,j) ) then + dtw = half*(one-z1*xzi)*dt_warm*(xz(i,j)-z1)/(z2-z1) + endif + elseif (z1 == z2 ) then + if (z1 < xz(i,j) ) then + dtw = dt_warm * (one-z1*xzi) + endif + endif + endif + ! + ! get the mean cooling in the range of z=0 to z=zsea + ! + dtc = zero + if ( zc(i,j) > zero ) then + if ( z1 < z2) then + if ( z2 < zc(i,j) ) then + dtc = dt_cool(i,j) * (one-(z1+z2)/(zc(i,j)+zc(i,j))) + elseif ( z1 < zc(i,j) .and. z2 >= zc(i,j) ) then + dtc = half*(one-z1/zc(i,j))*dt_cool(i,j)*(zc(i,j)-z1)/(z2-z1) + endif + elseif ( z1 == z2 ) then + if ( z1 < zc(i,j) ) then + dtc = dt_cool(i,j) * (one-z1/zc(i,j)) + endif + endif + endif + ! get the mean T departure from Tf in the range of z=z1 to z=z2 + dtm(i,j) = dtw - dtc + endif ! if ( wet(i,j)) then + enddo enddo - enddo -! + ! - end subroutine get_dtzm_2d + end subroutine get_dtzm_2d end module module_nst_water_prop diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f deleted file mode 100644 index 2ca70666d..000000000 --- a/physics/sfc_nst.f +++ /dev/null @@ -1,696 +0,0 @@ -!>\file sfc_nst.f -!! This file contains the GFS NSST model. - -!> This module contains the CCPP-compliant GFS near-surface sea temperature scheme. - module sfc_nst - - contains - -!>\defgroup gfs_nst_main_mod GFS Near-Surface Sea Temperature Module -!! This module contains the CCPP-compliant GFS near-surface sea temperature scheme. -!> @{ -!! This subroutine calls the Thermal Skin-layer and Diurnal Thermocline models to update the NSST profile. -!! \section arg_table_sfc_nst_run Argument Table -!! \htmlinclude sfc_nst_run.html -!! -!> \section NSST_general_algorithm GFS Near-Surface Sea Temperature Scheme General Algorithm - subroutine sfc_nst_run & - & ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs: - & pi, tgice, sbc, ps, u1, v1, t1, q1, tref, cm, ch, & - & lseaspray, fm, fm10, & - & prsl1, prslki, prsik1, prslk1, wet, use_lake_model, xlon, & - & sinlat, stress, & - & sfcemis, dlwflx, sfcnsw, rain, timestep, kdt, solhr,xcosz, & - & wind, flag_iter, flag_guess, nstf_name1, nstf_name4, & - & nstf_name5, lprnt, ipr, thsfc_loc, & - & tskin, tsurf, xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & ! --- input/output: - & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain, & - & qsurf, gflux, cmm, chh, evap, hflx, ep, errmsg, errflg & ! --- outputs: - & ) -! -! ===================================================================== ! -! description: ! -! ! -! ! -! usage: ! -! ! -! call sfc_nst ! -! inputs: ! -! ( im, ps, u1, v1, t1, q1, tref, cm, ch, ! -! lseaspray, fm, fm10, ! -! prsl1, prslki, wet, use_lake_model, xlon, sinlat, stress, ! -! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, ! -! wind, flag_iter, flag_guess, nstf_name1, nstf_name4, ! -! nstf_name5, lprnt, ipr, thsfc_loc, ! -! input/outputs: ! -! tskin, tsurf, 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: -! qsurf, gflux, cmm, chh, evap, hflx, ep ! -! ) -! ! -! ! -! subprogram/functions called: w3movdat, iw3jdn, fpvs, density, ! -! rhocoef, cool_skin, warm_layer, jacobi_temp. ! -! ! -! program history log: ! -! 2007 -- xu li createad original code ! -! 2008 -- s. moorthi adapted to the parallel version ! -! may 2009 -- y.-t. hou modified to include input lw surface ! -! emissivity from radiation. also replaced the ! -! often comfusing combined sw and lw suface ! -! flux with separate sfc net sw flux (defined ! -! as dn-up) and lw flux. added a program doc block. ! -! sep 2009 -- s. moorthi removed rcl and additional reformatting ! -! and optimization + made pa as input pressure unit.! -! 2009 -- xu li recreatead the code ! -! feb 2010 -- s. moorthi added some changes made to the previous ! -! version ! -! Jul 2016 -- X. Li, modify the diurnal warming event reset ! -! ! -! ! -! ==================== definition of variables ==================== ! -! ! -! inputs: size ! -! im - integer, horiz dimension 1 ! -! ps - real, surface pressure (pa) im ! -! u1, v1 - real, u/v component of surface layer wind (m/s) im ! -! t1 - real, surface layer mean temperature ( k ) im ! -! q1 - real, surface layer mean specific humidity im ! -! tref - real, reference/foundation temperature ( k ) im ! -! cm - real, surface exchange coeff for momentum (m/s) im ! -! ch - real, surface exchange coeff heat & moisture(m/s) im ! -! lseaspray- logical, .t. for parameterization for sea spray 1 ! -! fm - real, a stability profile function for momentum im ! -! fm10 - real, a stability profile function for momentum im ! -! at 10m ! -! prsl1 - real, surface layer mean pressure (pa) im ! -! prslki - real, im ! -! prsik1 - real, im ! -! prslk1 - real, im ! -! wet - logical, =T if any ocn/lake water (F otherwise) im ! -! use_lake_model- logical, =T if flake model is used for lake im ! -! icy - logical, =T if any ice im ! -! xlon - real, longitude (radians) im ! -! sinlat - real, sin of latitude im ! -! stress - real, wind stress (n/m**2) im ! -! sfcemis - real, sfc lw emissivity (fraction) im ! -! dlwflx - real, total sky sfc downward lw flux (w/m**2) im ! -! sfcnsw - real, total sky sfc netsw flx into ocean (w/m**2) im ! -! rain - real, rainfall rate (kg/m**2/s) im ! -! timestep - real, timestep interval (second) 1 ! -! kdt - integer, time step counter 1 ! -! solhr - real, fcst hour at the end of prev time step 1 ! -! xcosz - real, consine of solar zenith angle 1 ! -! wind - real, wind speed (m/s) im ! -! flag_iter- logical, execution or not im ! -! when iter = 1, flag_iter = .true. for all grids im ! -! when iter = 2, flag_iter = .true. when wind < 2 im ! -! for both land and ocean (when nstf_name1 > 0) im ! -! flag_guess-logical, .true.= guess step to get CD et al im ! -! when iter = 1, flag_guess = .true. when wind < 2 im ! -! when iter = 2, flag_guess = .false. for all grids im ! -! nstf_name - integers , NSST related flag parameters 1 ! -! nstf_name1 : 0 = NSSTM off 1 ! -! 1 = NSSTM on but uncoupled 1 ! -! 2 = NSSTM on and coupled 1 ! -! nstf_name4 : zsea1 in mm 1 ! -! nstf_name5 : zsea2 in mm 1 ! -! lprnt - logical, control flag for check print out 1 ! -! ipr - integer, grid index for check print out 1 ! -! thsfc_loc- logical, flag for reference pressure in theta 1 ! -! ! -! input/outputs: -! li added for oceanic components -! tskin - real, ocean surface skin temperature ( k ) im ! -! tsurf - real, the same as tskin ( k ) but for guess run im ! -! xt - real, heat content in dtl im ! -! xs - real, salinity content in dtl im ! -! xu - real, u-current content in dtl im ! -! xv - real, v-current content in dtl im ! -! xz - real, dtl thickness im ! -! zm - real, mxl thickness im ! -! xtts - real, d(xt)/d(ts) im ! -! xzts - real, d(xz)/d(ts) im ! -! dt_cool - real, sub-layer cooling amount im ! -! d_conv - real, thickness of free convection layer (fcl) im ! -! z_c - sub-layer cooling thickness im ! -! c_0 - coefficient1 to calculate d(tz)/d(ts) im ! -! c_d - coefficient2 to calculate d(tz)/d(ts) im ! -! w_0 - coefficient3 to calculate d(tz)/d(ts) im ! -! w_d - coefficient4 to calculate d(tz)/d(ts) im ! -! ifd - real, index to start dtlm run or not im ! -! qrain - real, sensible heat flux due to rainfall (watts) im ! - -! outputs: ! - -! qsurf - real, surface air saturation specific humidity im ! -! gflux - real, soil heat flux (w/m**2) im ! -! cmm - real, im ! -! chh - real, im ! -! evap - real, evaperation from latent heat flux im ! -! hflx - real, sensible heat flux im ! -! ep - real, potential evaporation im ! -! ! -! ===================================================================== ! - use machine , only : kind_phys - use funcphys, only : fpvs - use date_def, only : idate - use module_nst_water_prop, only: get_dtzm_point - use module_nst_parameters, only : t0k,cp_w,omg_m,omg_sh, & - & sigma_r,solar_time_6am,ri_c,z_w_max,delz,wd_max, & - & rad2deg,const_rot,tau_min,tw_max,sst_max - use module_nst_water_prop, only: solar_time_from_julian, & - & density,rhocoef,compjd,grv & - &, sw_ps_9b - use nst_module, only : cool_skin,dtm_1p,cal_w,cal_ttop, & - & convdepth,dtm_1p_fca,dtm_1p_tla, & - & dtm_1p_mwa,dtm_1p_mda,dtm_1p_mta, & - & dtl_reset -! - implicit none - - integer, parameter :: kp = kind_phys -! -! --- constant parameters: - real (kind=kind_phys), parameter :: f24 = 24.0_kp ! hours/day - real (kind=kind_phys), parameter :: f1440 = 1440.0_kp ! minutes/day - real (kind=kind_phys), parameter :: czmin = 0.0001_kp ! cos(89.994) - real (kind=kind_phys), parameter :: zero = 0.0_kp, one = 1.0_kp - - -! --- inputs: - integer, intent(in) :: im, kdt, ipr, nstf_name1, nstf_name4, & - & nstf_name5 - 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, & - & t1, q1, tref, cm, ch, fm, fm10, & - & prsl1, prslki, prsik1, prslk1, xlon, xcosz, & - & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind - real (kind=kind_phys), intent(in) :: timestep - real (kind=kind_phys), intent(in) :: solhr - -! For sea spray effect - logical, intent(in) :: lseaspray -! - logical, dimension(:), intent(in) :: flag_iter, flag_guess, wet - integer, dimension(:), intent(in) :: use_lake_model -! &, icy - logical, intent(in) :: lprnt - logical, intent(in) :: thsfc_loc - -! --- 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, & - & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain - -! --- outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: & - & qsurf, gflux, cmm, chh, evap, hflx, ep - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! -! locals -! - integer :: k,i -! - real (kind=kind_phys), dimension(im) :: q0, qss, rch, - & rho_a, theta1, tv1, wndmag - - real(kind=kind_phys) elocp,tem,cpinv,hvapi -! -! nstm related prognostic fields -! - logical flag(im) - real (kind=kind_phys), dimension(im) :: - & xt_old, xs_old, xu_old, xv_old, xz_old,zm_old,xtts_old, - & xzts_old, ifd_old, tref_old, tskin_old, dt_cool_old,z_c_old - - real(kind=kind_phys) ulwflx(im), nswsfc(im) -! real(kind=kind_phys) rig(im), -! & ulwflx(im),dlwflx(im), -! & slrad(im),nswsfc(im) - real(kind=kind_phys) alpha,beta,rho_w,f_nsol,sss,sep, - & cosa,sina,taux,tauy,grav,dz,t0,ttop0,ttop - - real(kind=kind_phys) le,fc,dwat,dtmp,wetc,alfac,ustar_a,rich - real(kind=kind_phys) rnl_ts,hs_ts,hl_ts,rf_ts,q_ts - real(kind=kind_phys) fw,q_warm - real(kind=kind_phys) t12,alon,tsea,sstc,dta,dtz - real(kind=kind_phys) zsea1,zsea2,soltim - logical do_nst - -! external functions called: iw3jdn - integer :: iw3jdn -! -! parameters for sea spray effect -! - real (kind=kind_phys) :: f10m, u10m, v10m, ws10, ru10, qss1, - & bb1, hflxs, evaps, ptem -! -! real (kind=kind_phys), parameter :: alps=0.5, bets=0.5, gams=0.1, -! real (kind=kind_phys), parameter :: alps=0.5, bets=0.5, gams=0.0, -! real (kind=kind_phys), parameter :: alps=1.0, bets=1.0, gams=0.2, - real (kind=kind_phys), parameter :: alps=0.75,bets=0.75,gams=0.15, - & ws10cr=30., conlf=7.2e-9, consf=6.4e-8 -! -!====================================================================================================== -cc - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (nstf_name1 == 0) return ! No NSST model used - - cpinv = one/cp - hvapi = one/hvap - elocp = hvap/cp - - sss = 34.0_kp ! temporarily, when sea surface salinity data is not ready -! -! flag for open water and where the iteration is on -! - do_nst = .false. - do i = 1, im -! flag(i) = wet(i) .and. .not.icy(i) .and. flag_iter(i) - flag(i) = wet(i) .and. flag_iter(i) .and. use_lake_model(i)/=1 - do_nst = do_nst .or. flag(i) - enddo - if (.not. do_nst) return -! -! save nst-related prognostic fields for guess run -! - do i=1, im -! if(wet(i) .and. .not.icy(i) .and. flag_guess(i)) then - if(wet(i) .and. flag_guess(i) .and. use_lake_model(i)/=1) then - xt_old(i) = xt(i) - xs_old(i) = xs(i) - xu_old(i) = xu(i) - xv_old(i) = xv(i) - xz_old(i) = xz(i) - zm_old(i) = zm(i) - xtts_old(i) = xtts(i) - xzts_old(i) = xzts(i) - ifd_old(i) = ifd(i) - tskin_old(i) = tskin(i) - dt_cool_old(i) = dt_cool(i) - z_c_old(i) = z_c(i) - endif - enddo - - -! --- ... initialize variables. all units are m.k.s. unless specified. -! ps is in pascals, wind is wind speed, theta1 is surface air -! estimated from level 1 temperature, rho_a is air density and -! qss is saturation specific humidity at the water surface -!! - do i = 1, im - if ( flag(i) ) then - - nswsfc(i) = sfcnsw(i) ! net solar radiation at the air-sea surface (positive downward) - wndmag(i) = sqrt(u1(i)*u1(i) + v1(i)*v1(i)) - - q0(i) = max(q1(i), 1.0e-8_kp) - - if(thsfc_loc) then ! Use local potential temperature - theta1(i) = t1(i) * prslki(i) - else ! Use potential temperature referenced to 1000 hPa - theta1(i) = t1(i) / prslk1(i) ! potential temperature at the middle of lowest model layer - endif - - tv1(i) = t1(i) * (one + rvrdm1*q0(i)) - rho_a(i) = prsl1(i) / (rd*tv1(i)) - qss(i) = fpvs(tsurf(i)) ! pa - qss(i) = eps*qss(i) / (ps(i) + epsm1*qss(i)) ! pa -! - evap(i) = zero - hflx(i) = zero - gflux(i) = zero - ep(i) = zero - -! --- ... rcp = rho cp ch v - - rch(i) = rho_a(i) * cp * ch(i) * wind(i) - cmm(i) = cm (i) * wind(i) - chh(i) = rho_a(i) * ch(i) * wind(i) - -!> - Calculate latent and sensible heat flux over open water with tskin. -! at previous time step - evap(i) = elocp * rch(i) * (qss(i) - q0(i)) - qsurf(i) = qss(i) - - if(thsfc_loc) then ! Use local potential temperature - hflx(i) = rch(i) * (tsurf(i) - theta1(i)) - else ! Use potential temperature referenced to 1000 hPa - hflx(i) = rch(i) * (tsurf(i)/prsik1(i) - theta1(i)) - endif - -! if (lprnt .and. i == ipr) print *,' tskin=',tskin(i),' theta1=', -! & theta1(i),' hflx=',hflx(i),' t1=',t1(i),'prslki=',prslki(i) -! &,' tsurf=',tsurf(i) - endif - enddo - -! run nst model: dtm + slm -! - zsea1 = 0.001_kp*real(nstf_name4) - zsea2 = 0.001_kp*real(nstf_name5) - -!> - Call module_nst_water_prop::density() to compute sea water density. -!> - Call module_nst_water_prop::rhocoef() to compute thermal expansion -!! coefficient (\a alpha) and saline contraction coefficient (\a beta). - do i = 1, im - if ( flag(i) ) then - tsea = tsurf(i) - t12 = tsea*tsea - ulwflx(i) = sfcemis(i) * sbc * t12 * t12 - alon = xlon(i)*rad2deg - grav = grv(sinlat(i)) - soltim = mod(alon/15.0_kp + solhr, 24.0_kp)*3600.0_kp - call density(tsea,sss,rho_w) ! sea water density - call rhocoef(tsea,sss,rho_w,alpha,beta) ! alpha & beta -! -!> - Calculate sensible heat flux (\a qrain) due to rainfall. -! - le = (2.501_kp-0.00237_kp*tsea)*1e6_kp - dwat = 2.11e-5_kp*(t1(i)/t0k)**1.94_kp ! water vapor diffusivity - dtmp = (one+3.309e-3_kp*(t1(i)-t0k)-1.44e-6_kp*(t1(i)-t0k) - & * (t1(i)-t0k))*0.02411_kp/(rho_a(i)*cp) ! heat diffusivity - wetc = 622.0_kp*le*qss(i)/(rd*t1(i)*t1(i)) - alfac = one / (one + (wetc*le*dwat)/(cp*dtmp)) ! wet bulb factor - tem = (1.0e3_kp * rain(i) / rho_w) * alfac * cp_w - qrain(i) = tem * (tsea-t1(i)+1.0e3_kp*(qss(i)-q0(i))*le/cp) - -!> - Calculate input non solar heat flux as upward = positive to models here - - f_nsol = hflx(i) + evap(i) + ulwflx(i) - dlwflx(i) - & + omg_sh*qrain(i) - -! if (lprnt .and. i == ipr) print *,' f_nsol=',f_nsol,' hflx=', -! &hflx(i),' evap=',evap(i),' ulwflx=',ulwflx(i),' dlwflx=',dlwflx(i) -! &,' omg_sh=',omg_sh,' qrain=',qrain(i) - - sep = sss*(evap(i)/le-rain(i))/rho_w - ustar_a = sqrt(stress(i)/rho_a(i)) ! air friction velocity -! -! sensitivities of heat flux components to ts -! - rnl_ts = 4.0_kp*sfcemis(i)*sbc*tsea*tsea*tsea ! d(rnl)/d(ts) - hs_ts = rch(i) - hl_ts = rch(i)*elocp*eps*hvap*qss(i)/(rd*t12) - rf_ts = tem * (one+rch(i)*hl_ts) - q_ts = rnl_ts + hs_ts + hl_ts + omg_sh*rf_ts -! -!> - Call cool_skin(), which is the sub-layer cooling parameterization -!! (Fairfall et al. (1996) \cite fairall_et_al_1996). -! & calculate c_0, c_d -! - call cool_skin(ustar_a,f_nsol,nswsfc(i),evap(i),sss,alpha,beta - &, rho_w,rho_a(i),tsea,q_ts,hl_ts,grav,le - &, dt_cool(i),z_c(i),c_0(i),c_d(i)) - - tem = one / wndmag(i) - cosa = u1(i)*tem - sina = v1(i)*tem - taux = max(stress(i),tau_min)*cosa - tauy = max(stress(i),tau_min)*sina - fc = const_rot*sinlat(i) -! -! Run DTM-1p system. -! - if ( (soltim > solar_time_6am .and. ifd(i) == zero) ) then - else - ifd(i) = one -! -! calculate fcl thickness with current forcing and previous time's profile -! -! if (lprnt .and. i == ipr) print *,' beg xz=',xz(i) - -!> - Call convdepth() to calculate depth for convective adjustments. - if ( f_nsol > zero .and. xt(i) > zero ) then - call convdepth(kdt,timestep,nswsfc(i),f_nsol,sss,sep,rho_w - &, alpha,beta,xt(i),xs(i),xz(i),d_conv(i)) - else - d_conv(i) = zero - endif - -! if (lprnt .and. i == ipr) print *,' beg xz1=',xz(i) -! -! determine rich: wind speed dependent (right now) -! -! if ( wind(i) < 1.0 ) then -! rich = 0.25 + 0.03*wind(i) -! elseif ( wind(i) >= 1.0 .and. wind(i) < 1.5 ) then -! rich = 0.25 + 0.1*wind(i) -! elseif ( wind(i) >= 1.5 .and. wind(i) < 6.0 ) then -! rich = 0.25 + 0.6*wind(i) -! elseif ( wind(i) >= 6.0 ) then -! rich = 0.25 + min(0.8*wind(i),0.50) -! endif - - rich = ri_c - -!> - Call the diurnal thermocline layer model dtm_1p(). - call dtm_1p(kdt,timestep,rich,taux,tauy,nswsfc(i), - & f_nsol,sss,sep,q_ts,hl_ts,rho_w,alpha,beta,alon, - & sinlat(i),soltim,grav,le,d_conv(i), - & xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - -! if (lprnt .and. i == ipr) print *,' beg xz2=',xz(i) - -! apply mda - if ( xt(i) > zero ) then -!> - If \a dtl heat content \a xt > 0.0, call dtm_1p_mda() to apply -!! minimum depth adjustment (mda). - call dtm_1p_mda(xt(i),xtts(i),xz(i),xzts(i)) - if ( xz(i) >= z_w_max ) then -!> - If \a dtl thickness >= module_nst_parameters::z_w_max, call dtl_reset() -!! to reset xt/xs/x/xv to zero, and xz to module_nst_parameters::z_w_max. - call dtl_reset(xt(i),xs(i),xu(i),xv(i),xz(i),xtts(i), - & xzts(i)) - -! if (lprnt .and. i == ipr) print *,' beg xz3=',xz(i),' z_w_max=' -! &,z_w_max - endif - -! apply fca - if ( d_conv(i) > zero ) then -!> - If thickness of free convection layer > 0.0, call dtm_1p_fca() -!! to apply free convection adjustment. -!> - If \a dtl thickness >= module_nst_parameters::z_w_max(), call dtl_reset() -!! to reset xt/xs/x/xv to zero, and xz to module_nst_parameters::z_w_max(). - call dtm_1p_fca(d_conv(i),xt(i),xtts(i),xz(i),xzts(i)) - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif - -! if (lprnt .and. i == ipr) print *,' beg xz4=',xz(i) - -! apply tla - dz = min(xz(i),max(d_conv(i),delz)) -! -!> - Call sw_ps_9b() to compute the fraction of the solar radiation -!! absorbed by the depth \a delz (Paulson and Simpson (1981) \cite paulson_and_simpson_1981). -!! And calculate the total heat absorbed in warm layer. - call sw_ps_9b(delz,fw) - q_warm = fw*nswsfc(i)-f_nsol !total heat absorbed in warm layer - -!> - Call cal_ttop() to calculate the diurnal warming amount at the top layer with -!! thickness of \a dz. - if ( q_warm > zero ) then - call cal_ttop(kdt,timestep,q_warm,rho_w,dz, - & xt(i),xz(i),ttop0) - -! if (lprnt .and. i == ipr) print *,' d_conv=',d_conv(i),' delz=', -! &delz,' kdt=',kdt,' timestep=',timestep,' nswsfc=',nswsfc(i), -! &' f_nsol=',f_nsol,' rho_w=',rho_w,' dz=',dz,' xt=',xt(i), -! &' xz=',xz(i),' qrain=',qrain(i) - - ttop = ((xt(i)+xt(i))/xz(i))*(one-dz/((xz(i)+xz(i)))) - -! if (lprnt .and. i == ipr) print *,' beg xz4a=',xz(i) -! &,' ttop=',ttop,' ttop0=',ttop0,' xt=',xt(i),' dz=',dz -! &,' xznew=',(xt(i)+sqrt(xt(i)*(xt(i)-dz*ttop0)))/ttop0 - -!> - Call dtm_1p_tla() to apply top layer adjustment. - if ( ttop > ttop0 ) then - call dtm_1p_tla(dz,ttop0,xt(i),xtts(i),xz(i),xzts(i)) - -! if (lprnt .and. i == ipr) print *,' beg xz4b=',xz(i),'z_w_max=', -! &z_w_max - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif - endif ! if ( q_warm > 0.0 ) then - -! if (lprnt .and. i == ipr) print *,' beg xz5=',xz(i) - -! apply mwa -!> - Call dt_1p_mwa() to apply maximum warming adjustment. - t0 = (xt(i)+xt(i))/xz(i) - if ( t0 > tw_max ) then - call dtm_1p_mwa(xt(i),xtts(i),xz(i),xzts(i)) - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif - -! if (lprnt .and. i == ipr) print *,' beg xz6=',xz(i) - -! apply mta -!> - Call dtm_1p_mta() to apply maximum temperature adjustment. - sstc = tref(i) + (xt(i)+xt(i))/xz(i) - dt_cool(i) - - if ( sstc > sst_max ) then - dta = sstc - sst_max - call dtm_1p_mta(dta,xt(i),xtts(i),xz(i),xzts(i)) -! write(*,'(a,f3.0,7f8.3)') 'mta, sstc,dta :',islimsk(i), -! & sstc,dta,tref(i),xt(i),xz(i),2.0*xt(i)/xz(i),dt_cool(i) - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif -! - endif ! if ( xt(i) > 0.0 ) then -! reset dtl at midnight and when solar zenith angle > 89.994 degree - if ( abs(soltim) < 2.0_kp*timestep ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - - endif ! if (solar_time > solar_time_6am .and. ifd(i) == 0.0 ) then: too late to start the first day - -! if (lprnt .and. i == ipr) print *,' beg xz7=',xz(i) - -! update tsurf (when flag(i) .eqv. .true. ) -!> - Call get_dtzm_point() to computes \a dtz and \a tsurf. - call get_dtzm_point(xt(i),xz(i),dt_cool(i),z_c(i), - & zsea1,zsea2,dtz) - tsurf(i) = max(tgice, tref(i) + dtz ) - -! if (lprnt .and. i == ipr) print *,' tsurf=',tsurf(i),' tref=', -! &tref(i),' xz=',xz(i),' dt_cool=',dt_cool(i) - -!> - Call cal_w() to calculate \a w_0 and \a w_d. - if ( xt(i) > zero ) then - call cal_w(kdt,xz(i),xt(i),xzts(i),xtts(i),w_0(i),w_d(i)) - else - w_0(i) = zero - w_d(i) = zero - endif - -! if ( xt(i) > 0.0 ) then -! rig(i) = grav*xz(i)*xz(i)*(alpha*xt(i)-beta*xs(i)) -! & /(2.0*(xu(i)*xu(i)+xv(i)*xv(i))) -! else -! rig(i) = 0.25 -! endif - -! qrain(i) = rig(i) - zm(i) = wind(i) - - endif - enddo - -! restore nst-related prognostic fields for guess run - do i=1, im -! if (wet(i) .and. .not.icy(i)) then - if (wet(i) .and. use_lake_model(i)/=1) then - if (flag_guess(i)) then ! when it is guess of - xt(i) = xt_old(i) - xs(i) = xs_old(i) - xu(i) = xu_old(i) - xv(i) = xv_old(i) - xz(i) = xz_old(i) - zm(i) = zm_old(i) - xtts(i) = xtts_old(i) - xzts(i) = xzts_old(i) - ifd(i) = ifd_old(i) - tskin(i) = tskin_old(i) - dt_cool(i) = dt_cool_old(i) - z_c(i) = z_c_old(i) - else -! -! update tskin when coupled and not guess run -! (all other NSST variables have been updated in this case) -! - if ( nstf_name1 > 1 ) then - tskin(i) = tsurf(i) - endif ! if nstf_name1 > 1 then - endif ! if flag_guess(i) then - endif ! if wet(i) .and. .not.icy(i) then - enddo - -! if (lprnt .and. i == ipr) print *,' beg xz8=',xz(i) - - if ( nstf_name1 > 1 ) then -!> - Calculate latent and sensible heat flux over open water with updated tskin -!! for the grids of open water and the iteration is on. - do i = 1, im - if ( flag(i) ) then - qss(i) = fpvs( tskin(i) ) - qss(i) = eps*qss(i) / (ps(i) + epsm1*qss(i)) - qsurf(i) = qss(i) - evap(i) = elocp*rch(i) * (qss(i) - q0(i)) - - if(thsfc_loc) then ! Use local potential temperature - hflx(i) = rch(i) * (tskin(i) - theta1(i)) - else ! Use potential temperature referenced to 1000 hPa - hflx(i) = rch(i) * (tskin(i)/prsik1(i) - theta1(i)) - endif - - endif - enddo - endif ! if ( nstf_name1 > 1 ) then -! -!> - Include sea spray effects -! - do i=1,im - if(lseaspray .and. flag(i)) then - f10m = fm10(i) / fm(i) - u10m = f10m * u1(i) - v10m = f10m * v1(i) - ws10 = sqrt(u10m*u10m + v10m*v10m) - ws10 = max(ws10,1.) - ws10 = min(ws10,ws10cr) - tem = .015 * ws10 * ws10 - ru10 = 1. - .087 * log(10./tem) - qss1 = fpvs(t1(i)) - qss1 = eps * qss1 / (prsl1(i) + epsm1 * qss1) - tem = rd * cp * t1(i) * t1(i) - tem = 1. + eps * hvap * hvap * qss1 / tem - bb1 = 1. / tem - evaps = conlf * (ws10**5.4) * ru10 * bb1 - evaps = evaps * rho_a(i) * hvap * (qss1 - q0(i)) - evap(i) = evap(i) + alps * evaps - hflxs = consf * (ws10**3.4) * ru10 - hflxs = hflxs * rho_a(i) * cp * (tskin(i) - t1(i)) - ptem = alps - gams - hflx(i) = hflx(i) + bets * hflxs - ptem * evaps - endif - enddo -! - do i=1,im - if ( flag(i) ) then - tem = one / rho_a(i) - hflx(i) = hflx(i) * tem * cpinv - evap(i) = evap(i) * tem * hvapi - endif - enddo -! -! if (lprnt) print *,' tskin=',tskin(ipr) - - return - end subroutine sfc_nst_run -!> @} - end module sfc_nst diff --git a/physics/sfc_nst.f90 b/physics/sfc_nst.f90 new file mode 100644 index 000000000..08b1b48e4 --- /dev/null +++ b/physics/sfc_nst.f90 @@ -0,0 +1,664 @@ +!>\file sfc_nst.f90 +!! This file contains the GFS NSST model. + +!> This module contains the CCPP-compliant GFS near-surface sea temperature scheme. +module sfc_nst + + use machine , only : kind_phys, kp => kind_phys + use funcphys , only : fpvs + use module_nst_parameters , only : one, zero, half + use module_nst_parameters , only : t0k, cp_w, omg_m, omg_sh, sigma_r, solar_time_6am, sst_max + use module_nst_parameters , only : ri_c, z_w_max, delz, wd_max, rad2deg, const_rot, tau_min, tw_max + use module_nst_water_prop , only : get_dtzm_point, density, rhocoef, grv, sw_ps_9b + use nst_module , only : cool_skin, dtm_1p, cal_w, cal_ttop, convdepth, dtm_1p_fca + use nst_module , only : dtm_1p_tla, dtm_1p_mwa, dtm_1p_mda, dtm_1p_mta, dtl_reset + ! + implicit none +contains + + !>\defgroup gfs_nst_main_mod GFS Near-Surface Sea Temperature Module + !! This module contains the CCPP-compliant GFS near-surface sea temperature scheme. + !> @{ + !! This subroutine calls the Thermal Skin-layer and Diurnal Thermocline models to update the NSST profile. + !! \section arg_table_sfc_nst_run Argument Table + !! \htmlinclude sfc_nst_run.html + !! + !> \section NSST_general_algorithm GFS Near-Surface Sea Temperature Scheme General Algorithm + subroutine sfc_nst_run & + ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs: + pi, tgice, sbc, ps, u1, v1, t1, q1, tref, cm, ch, & + lseaspray, fm, fm10, & + prsl1, prslki, prsik1, prslk1, wet, use_lake_model, xlon, & + sinlat, stress, & + sfcemis, dlwflx, sfcnsw, rain, timestep, kdt, solhr,xcosz, & + wind, flag_iter, flag_guess, nstf_name1, nstf_name4, & + nstf_name5, lprnt, ipr, thsfc_loc, & + tskin, tsurf, xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & ! --- input/output: + z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain, & + qsurf, gflux, cmm, chh, evap, hflx, ep, errmsg, errflg & ! --- outputs: + ) + ! + ! ===================================================================== ! + ! description: ! + ! ! + ! ! + ! usage: ! + ! ! + ! call sfc_nst ! + ! inputs: ! + ! ( im, ps, u1, v1, t1, q1, tref, cm, ch, ! + ! lseaspray, fm, fm10, ! + ! prsl1, prslki, wet, use_lake_model, xlon, sinlat, stress, ! + ! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, ! + ! wind, flag_iter, flag_guess, nstf_name1, nstf_name4, ! + ! nstf_name5, lprnt, ipr, thsfc_loc, ! + ! input/outputs: ! + ! tskin, tsurf, 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: + ! qsurf, gflux, cmm, chh, evap, hflx, ep ! + ! ) + ! ! + ! ! + ! subprogram/functions called: fpvs, density, rhocoef, cool_skin ! + ! ! + ! program history log: ! + ! 2007 -- xu li createad original code ! + ! 2008 -- s. moorthi adapted to the parallel version ! + ! may 2009 -- y.-t. hou modified to include input lw surface ! + ! emissivity from radiation. also replaced the ! + ! often comfusing combined sw and lw suface ! + ! flux with separate sfc net sw flux (defined ! + ! as dn-up) and lw flux. added a program doc block. ! + ! sep 2009 -- s. moorthi removed rcl and additional reformatting ! + ! and optimization + made pa as input pressure unit.! + ! 2009 -- xu li recreatead the code ! + ! feb 2010 -- s. moorthi added some changes made to the previous ! + ! version ! + ! Jul 2016 -- X. Li, modify the diurnal warming event reset ! + ! ! + ! ! + ! ==================== definition of variables ==================== ! + ! ! + ! inputs: size ! + ! im - integer, horiz dimension 1 ! + ! ps - real, surface pressure (pa) im ! + ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! + ! t1 - real, surface layer mean temperature ( k ) im ! + ! q1 - real, surface layer mean specific humidity im ! + ! tref - real, reference/foundation temperature ( k ) im ! + ! cm - real, surface exchange coeff for momentum (m/s) im ! + ! ch - real, surface exchange coeff heat & moisture(m/s) im ! + ! lseaspray- logical, .t. for parameterization for sea spray 1 ! + ! fm - real, a stability profile function for momentum im ! + ! fm10 - real, a stability profile function for momentum im ! + ! at 10m ! + ! prsl1 - real, surface layer mean pressure (pa) im ! + ! prslki - real, im ! + ! prsik1 - real, im ! + ! prslk1 - real, im ! + ! wet - logical, =T if any ocn/lake water (F otherwise) im ! + ! use_lake_model- logical, =T if flake model is used for lake im ! + ! icy - logical, =T if any ice im ! + ! xlon - real, longitude (radians) im ! + ! sinlat - real, sin of latitude im ! + ! stress - real, wind stress (n/m**2) im ! + ! sfcemis - real, sfc lw emissivity (fraction) im ! + ! dlwflx - real, total sky sfc downward lw flux (w/m**2) im ! + ! sfcnsw - real, total sky sfc netsw flx into ocean (w/m**2) im ! + ! rain - real, rainfall rate (kg/m**2/s) im ! + ! timestep - real, timestep interval (second) 1 ! + ! kdt - integer, time step counter 1 ! + ! solhr - real, fcst hour at the end of prev time step 1 ! + ! xcosz - real, consine of solar zenith angle 1 ! + ! wind - real, wind speed (m/s) im ! + ! flag_iter- logical, execution or not im ! + ! when iter = 1, flag_iter = .true. for all grids im ! + ! when iter = 2, flag_iter = .true. when wind < 2 im ! + ! for both land and ocean (when nstf_name1 > 0) im ! + ! flag_guess-logical, .true.= guess step to get CD et al im ! + ! when iter = 1, flag_guess = .true. when wind < 2 im ! + ! when iter = 2, flag_guess = .false. for all grids im ! + ! nstf_name - integers , NSST related flag parameters 1 ! + ! nstf_name1 : 0 = NSSTM off 1 ! + ! 1 = NSSTM on but uncoupled 1 ! + ! 2 = NSSTM on and coupled 1 ! + ! nstf_name4 : zsea1 in mm 1 ! + ! nstf_name5 : zsea2 in mm 1 ! + ! lprnt - logical, control flag for check print out 1 ! + ! ipr - integer, grid index for check print out 1 ! + ! thsfc_loc- logical, flag for reference pressure in theta 1 ! + ! ! + ! input/outputs: + ! li added for oceanic components + ! tskin - real, ocean surface skin temperature ( k ) im ! + ! tsurf - real, the same as tskin ( k ) but for guess run im ! + ! xt - real, heat content in dtl im ! + ! xs - real, salinity content in dtl im ! + ! xu - real, u-current content in dtl im ! + ! xv - real, v-current content in dtl im ! + ! xz - real, dtl thickness im ! + ! zm - real, mxl thickness im ! + ! xtts - real, d(xt)/d(ts) im ! + ! xzts - real, d(xz)/d(ts) im ! + ! dt_cool - real, sub-layer cooling amount im ! + ! d_conv - real, thickness of free convection layer (fcl) im ! + ! z_c - sub-layer cooling thickness im ! + ! c_0 - coefficient1 to calculate d(tz)/d(ts) im ! + ! c_d - coefficient2 to calculate d(tz)/d(ts) im ! + ! w_0 - coefficient3 to calculate d(tz)/d(ts) im ! + ! w_d - coefficient4 to calculate d(tz)/d(ts) im ! + ! ifd - real, index to start dtlm run or not im ! + ! qrain - real, sensible heat flux due to rainfall (watts) im ! + + ! outputs: ! + + ! qsurf - real, surface air saturation specific humidity im ! + ! gflux - real, soil heat flux (w/m**2) im ! + ! cmm - real, im ! + ! chh - real, im ! + ! evap - real, evaperation from latent heat flux im ! + ! hflx - real, sensible heat flux im ! + ! ep - real, potential evaporation im ! + ! ! + ! ===================================================================== ! + + + + ! --- inputs: + integer, intent(in) :: im, kdt, ipr, nstf_name1, nstf_name4, nstf_name5 + 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, & + t1, q1, tref, cm, ch, fm, fm10, & + prsl1, prslki, prsik1, prslk1, xlon, xcosz, & + sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind + real (kind=kind_phys), intent(in) :: timestep + real (kind=kind_phys), intent(in) :: solhr + + ! For sea spray effect + logical, intent(in) :: lseaspray + ! + logical, dimension(:), intent(in) :: flag_iter, flag_guess, wet + integer, dimension(:), intent(in) :: use_lake_model + logical, intent(in) :: lprnt + logical, intent(in) :: thsfc_loc + + ! --- 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, & + z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain + + ! --- outputs: + real (kind=kind_phys), dimension(:), intent(inout) :: qsurf, gflux, cmm, chh, evap, hflx, ep + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! + ! locals + ! + integer :: k,i + ! + real (kind=kind_phys), dimension(im) :: q0, qss, rch, rho_a, theta1, tv1, wndmag + + real(kind=kind_phys) :: elocp,tem,cpinv,hvapi + ! + ! nstm related prognostic fields + ! + logical :: flag(im) + real (kind=kind_phys), dimension(im) :: xt_old, xs_old, xu_old, xv_old, xz_old, & + zm_old,xtts_old, xzts_old, ifd_old, tref_old, tskin_old, dt_cool_old,z_c_old + + real(kind=kind_phys) :: ulwflx(im), nswsfc(im) + ! real(kind=kind_phys) rig(im), + ! & ulwflx(im),dlwflx(im), + ! & slrad(im),nswsfc(im) + real(kind=kind_phys) :: alpha,beta,rho_w,f_nsol,sss,sep, cosa,sina,taux,tauy, & + grav,dz,t0,ttop0,ttop + + real(kind=kind_phys) :: le,fc,dwat,dtmp,wetc,alfac,ustar_a,rich + real(kind=kind_phys) :: rnl_ts,hs_ts,hl_ts,rf_ts,q_ts + real(kind=kind_phys) :: fw,q_warm + real(kind=kind_phys) :: t12,alon,tsea,sstc,dta,dtz + real(kind=kind_phys) :: zsea1,zsea2,soltim + logical :: do_nst + ! + ! parameters for sea spray effect + ! + real (kind=kind_phys) :: f10m, u10m, v10m, ws10, ru10, qss1, & + bb1, hflxs, evaps, ptem + ! + ! real (kind=kind_phys), parameter :: alps=0.5, bets=0.5, gams=0.1, + ! real (kind=kind_phys), parameter :: alps=0.5, bets=0.5, gams=0.0, + ! real (kind=kind_phys), parameter :: alps=1.0, bets=1.0, gams=0.2, + real (kind=kind_phys), parameter :: alps=0.75,bets=0.75,gams=0.15, & + ws10cr=30., conlf=7.2e-9, consf=6.4e-8 + ! + !====================================================================================================== + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + if (nstf_name1 == 0) return ! No NSST model used + + cpinv = one/cp + hvapi = one/hvap + elocp = hvap/cp + + sss = 34.0_kp ! temporarily, when sea surface salinity data is not ready + ! + ! flag for open water and where the iteration is on + ! + do_nst = .false. + do i = 1, im + ! flag(i) = wet(i) .and. .not.icy(i) .and. flag_iter(i) + flag(i) = wet(i) .and. flag_iter(i) .and. use_lake_model(i)/=1 + do_nst = do_nst .or. flag(i) + enddo + if (.not. do_nst) return + ! + ! save nst-related prognostic fields for guess run + ! + do i=1, im + ! if(wet(i) .and. .not.icy(i) .and. flag_guess(i)) then + if(wet(i) .and. flag_guess(i) .and. use_lake_model(i)/=1) then + xt_old(i) = xt(i) + xs_old(i) = xs(i) + xu_old(i) = xu(i) + xv_old(i) = xv(i) + xz_old(i) = xz(i) + zm_old(i) = zm(i) + xtts_old(i) = xtts(i) + xzts_old(i) = xzts(i) + ifd_old(i) = ifd(i) + tskin_old(i) = tskin(i) + dt_cool_old(i) = dt_cool(i) + z_c_old(i) = z_c(i) + endif + enddo + + + ! --- ... initialize variables. all units are m.k.s. unless specified. + ! ps is in pascals, wind is wind speed, theta1 is surface air + ! estimated from level 1 temperature, rho_a is air density and + ! qss is saturation specific humidity at the water surface + !! + do i = 1, im + if ( flag(i) ) then + + nswsfc(i) = sfcnsw(i) ! net solar radiation at the air-sea surface (positive downward) + wndmag(i) = sqrt(u1(i)*u1(i) + v1(i)*v1(i)) + + q0(i) = max(q1(i), 1.0e-8_kp) + + if(thsfc_loc) then ! Use local potential temperature + theta1(i) = t1(i) * prslki(i) + else ! Use potential temperature referenced to 1000 hPa + theta1(i) = t1(i) / prslk1(i) ! potential temperature at the middle of lowest model layer + endif + + tv1(i) = t1(i) * (one + rvrdm1*q0(i)) + rho_a(i) = prsl1(i) / (rd*tv1(i)) + qss(i) = fpvs(tsurf(i)) ! pa + qss(i) = eps*qss(i) / (ps(i) + epsm1*qss(i)) ! pa + ! + evap(i) = zero + hflx(i) = zero + gflux(i) = zero + ep(i) = zero + + ! --- ... rcp = rho cp ch v + + rch(i) = rho_a(i) * cp * ch(i) * wind(i) + cmm(i) = cm (i) * wind(i) + chh(i) = rho_a(i) * ch(i) * wind(i) + + !> - Calculate latent and sensible heat flux over open water with tskin. + ! at previous time step + evap(i) = elocp * rch(i) * (qss(i) - q0(i)) + qsurf(i) = qss(i) + + if(thsfc_loc) then ! Use local potential temperature + hflx(i) = rch(i) * (tsurf(i) - theta1(i)) + else ! Use potential temperature referenced to 1000 hPa + hflx(i) = rch(i) * (tsurf(i)/prsik1(i) - theta1(i)) + endif + + ! if (lprnt .and. i == ipr) print *,' tskin=',tskin(i),' theta1=', + ! & theta1(i),' hflx=',hflx(i),' t1=',t1(i),'prslki=',prslki(i) + ! &,' tsurf=',tsurf(i) + endif + enddo + + ! run nst model: dtm + slm + ! + zsea1 = 0.001_kp*real(nstf_name4) + zsea2 = 0.001_kp*real(nstf_name5) + + !> - Call module_nst_water_prop::density() to compute sea water density. + !> - Call module_nst_water_prop::rhocoef() to compute thermal expansion + !! coefficient (\a alpha) and saline contraction coefficient (\a beta). + do i = 1, im + if ( flag(i) ) then + tsea = tsurf(i) + t12 = tsea*tsea + ulwflx(i) = sfcemis(i) * sbc * t12 * t12 + alon = xlon(i)*rad2deg + grav = grv(sinlat(i)) + soltim = mod(alon/15.0_kp + solhr, 24.0_kp)*3600.0_kp + call density(tsea,sss,rho_w) ! sea water density + call rhocoef(tsea,sss,rho_w,alpha,beta) ! alpha & beta + ! + !> - Calculate sensible heat flux (\a qrain) due to rainfall. + ! + le = (2.501_kp-0.00237_kp*tsea)*1.0e6_kp + dwat = 2.11e-5_kp*(t1(i)/t0k)**1.94_kp ! water vapor diffusivity + dtmp = (one+3.309e-3_kp*(t1(i)-t0k)-1.44e-6_kp*(t1(i)-t0k) & + * (t1(i)-t0k))*0.02411_kp/(rho_a(i)*cp) ! heat diffusivity + wetc = 622.0_kp*le*qss(i)/(rd*t1(i)*t1(i)) + alfac = one / (one + (wetc*le*dwat)/(cp*dtmp)) ! wet bulb factor + tem = (1.0e3_kp * rain(i) / rho_w) * alfac * cp_w + qrain(i) = tem * (tsea-t1(i)+1.0e3_kp*(qss(i)-q0(i))*le/cp) + + !> - Calculate input non solar heat flux as upward = positive to models here + + f_nsol = hflx(i) + evap(i) + ulwflx(i) - dlwflx(i) + omg_sh*qrain(i) + + ! if (lprnt .and. i == ipr) print *,' f_nsol=',f_nsol,' hflx=', + ! &hflx(i),' evap=',evap(i),' ulwflx=',ulwflx(i),' dlwflx=',dlwflx(i) + ! &,' omg_sh=',omg_sh,' qrain=',qrain(i) + + sep = sss*(evap(i)/le-rain(i))/rho_w + ustar_a = sqrt(stress(i)/rho_a(i)) ! air friction velocity + ! + ! sensitivities of heat flux components to ts + ! + rnl_ts = 4.0_kp*sfcemis(i)*sbc*tsea*tsea*tsea ! d(rnl)/d(ts) + hs_ts = rch(i) + hl_ts = rch(i)*elocp*eps*hvap*qss(i)/(rd*t12) + rf_ts = tem * (one+rch(i)*hl_ts) + q_ts = rnl_ts + hs_ts + hl_ts + omg_sh*rf_ts + ! + !> - Call cool_skin(), which is the sub-layer cooling parameterization + !! (Fairfall et al. (1996) \cite fairall_et_al_1996). + ! & calculate c_0, c_d + ! + call cool_skin(ustar_a,f_nsol,nswsfc(i),evap(i),sss,alpha,beta, & + rho_w,rho_a(i),tsea,q_ts,hl_ts,grav,le, & + dt_cool(i),z_c(i),c_0(i),c_d(i)) + + tem = one / wndmag(i) + cosa = u1(i)*tem + sina = v1(i)*tem + taux = max(stress(i),tau_min)*cosa + tauy = max(stress(i),tau_min)*sina + fc = const_rot*sinlat(i) + ! + ! Run DTM-1p system. + ! + if ( (soltim > solar_time_6am .and. ifd(i) == zero) ) then + else + ifd(i) = one + ! + ! calculate fcl thickness with current forcing and previous time's profile + ! + ! if (lprnt .and. i == ipr) print *,' beg xz=',xz(i) + + !> - Call convdepth() to calculate depth for convective adjustments. + if ( f_nsol > zero .and. xt(i) > zero ) then + call convdepth(kdt,timestep,nswsfc(i),f_nsol,sss,sep,rho_w, & + alpha,beta,xt(i),xs(i),xz(i),d_conv(i)) + else + d_conv(i) = zero + endif + + ! if (lprnt .and. i == ipr) print *,' beg xz1=',xz(i) + ! + ! determine rich: wind speed dependent (right now) + ! + ! if ( wind(i) < 1.0 ) then + ! rich = 0.25 + 0.03*wind(i) + ! elseif ( wind(i) >= 1.0 .and. wind(i) < 1.5 ) then + ! rich = 0.25 + 0.1*wind(i) + ! elseif ( wind(i) >= 1.5 .and. wind(i) < 6.0 ) then + ! rich = 0.25 + 0.6*wind(i) + ! elseif ( wind(i) >= 6.0 ) then + ! rich = 0.25 + min(0.8*wind(i),0.50) + ! endif + + rich = ri_c + + !> - Call the diurnal thermocline layer model dtm_1p(). + call dtm_1p(kdt,timestep,rich,taux,tauy,nswsfc(i), & + f_nsol,sss,sep,q_ts,hl_ts,rho_w,alpha,beta,alon, & + sinlat(i),soltim,grav,le,d_conv(i), & + xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) + + ! if (lprnt .and. i == ipr) print *,' beg xz2=',xz(i) + + ! apply mda + if ( xt(i) > zero ) then + !> - If \a dtl heat content \a xt > 0.0, call dtm_1p_mda() to apply + !! minimum depth adjustment (mda). + call dtm_1p_mda(xt(i),xtts(i),xz(i),xzts(i)) + if ( xz(i) >= z_w_max ) then + !> - If \a dtl thickness >= module_nst_parameters::z_w_max, call dtl_reset() + !! to reset xt/xs/x/xv to zero, and xz to module_nst_parameters::z_w_max. + call dtl_reset(xt(i),xs(i),xu(i),xv(i),xz(i),xtts(i), xzts(i)) + + ! if (lprnt .and. i == ipr) print *,' beg xz3=',xz(i),' z_w_max=' + ! &,z_w_max + endif + + ! apply fca + if ( d_conv(i) > zero ) then + !> - If thickness of free convection layer > 0.0, call dtm_1p_fca() + !! to apply free convection adjustment. + !> - If \a dtl thickness >= module_nst_parameters::z_w_max(), call dtl_reset() + !! to reset xt/xs/x/xv to zero, and xz to module_nst_parameters::z_w_max(). + call dtm_1p_fca(d_conv(i),xt(i),xtts(i),xz(i),xzts(i)) + if ( xz(i) >= z_w_max ) then + call dtl_reset (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) + endif + endif + + ! if (lprnt .and. i == ipr) print *,' beg xz4=',xz(i) + + ! apply tla + dz = min(xz(i),max(d_conv(i),delz)) + ! + !> - Call sw_ps_9b() to compute the fraction of the solar radiation + !! absorbed by the depth \a delz (Paulson and Simpson (1981) \cite paulson_and_simpson_1981). + !! And calculate the total heat absorbed in warm layer. + call sw_ps_9b(delz,fw) + q_warm = fw*nswsfc(i)-f_nsol !total heat absorbed in warm layer + + !> - Call cal_ttop() to calculate the diurnal warming amount at the top layer with + !! thickness of \a dz. + if ( q_warm > zero ) then + call cal_ttop(kdt,timestep,q_warm,rho_w,dz, xt(i),xz(i),ttop0) + + ! if (lprnt .and. i == ipr) print *,' d_conv=',d_conv(i),' delz=', + ! &delz,' kdt=',kdt,' timestep=',timestep,' nswsfc=',nswsfc(i), + ! &' f_nsol=',f_nsol,' rho_w=',rho_w,' dz=',dz,' xt=',xt(i), + ! &' xz=',xz(i),' qrain=',qrain(i) + + ttop = ((xt(i)+xt(i))/xz(i))*(one-dz/((xz(i)+xz(i)))) + + ! if (lprnt .and. i == ipr) print *,' beg xz4a=',xz(i) + ! &,' ttop=',ttop,' ttop0=',ttop0,' xt=',xt(i),' dz=',dz + ! &,' xznew=',(xt(i)+sqrt(xt(i)*(xt(i)-dz*ttop0)))/ttop0 + + !> - Call dtm_1p_tla() to apply top layer adjustment. + if ( ttop > ttop0 ) then + call dtm_1p_tla(dz,ttop0,xt(i),xtts(i),xz(i),xzts(i)) + + ! if (lprnt .and. i == ipr) print *,' beg xz4b=',xz(i),'z_w_max=', + ! &z_w_max + if ( xz(i) >= z_w_max ) then + call dtl_reset (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) + endif + endif + endif ! if ( q_warm > 0.0 ) then + + ! if (lprnt .and. i == ipr) print *,' beg xz5=',xz(i) + + ! apply mwa + !> - Call dt_1p_mwa() to apply maximum warming adjustment. + t0 = (xt(i)+xt(i))/xz(i) + if ( t0 > tw_max ) then + call dtm_1p_mwa(xt(i),xtts(i),xz(i),xzts(i)) + if ( xz(i) >= z_w_max ) then + call dtl_reset (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) + endif + endif + + ! if (lprnt .and. i == ipr) print *,' beg xz6=',xz(i) + + ! apply mta + !> - Call dtm_1p_mta() to apply maximum temperature adjustment. + sstc = tref(i) + (xt(i)+xt(i))/xz(i) - dt_cool(i) + + if ( sstc > sst_max ) then + dta = sstc - sst_max + call dtm_1p_mta(dta,xt(i),xtts(i),xz(i),xzts(i)) + ! write(*,'(a,f3.0,7f8.3)') 'mta, sstc,dta :',islimsk(i), + ! & sstc,dta,tref(i),xt(i),xz(i),2.0*xt(i)/xz(i),dt_cool(i) + if ( xz(i) >= z_w_max ) then + call dtl_reset (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) + endif + endif + ! + endif ! if ( xt(i) > 0.0 ) then + ! reset dtl at midnight and when solar zenith angle > 89.994 degree + if ( abs(soltim) < 2.0_kp*timestep ) then + call dtl_reset (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) + endif + + endif ! if (solar_time > solar_time_6am .and. ifd(i) == 0.0 ) then: too late to start the first day + + ! if (lprnt .and. i == ipr) print *,' beg xz7=',xz(i) + + ! update tsurf (when flag(i) .eqv. .true. ) + !> - Call get_dtzm_point() to computes \a dtz and \a tsurf. + call get_dtzm_point(xt(i),xz(i),dt_cool(i),z_c(i), zsea1,zsea2,dtz) + tsurf(i) = max(tgice, tref(i) + dtz ) + + ! if (lprnt .and. i == ipr) print *,' tsurf=',tsurf(i),' tref=', + ! &tref(i),' xz=',xz(i),' dt_cool=',dt_cool(i) + + !> - Call cal_w() to calculate \a w_0 and \a w_d. + if ( xt(i) > zero ) then + call cal_w(kdt,xz(i),xt(i),xzts(i),xtts(i),w_0(i),w_d(i)) + else + w_0(i) = zero + w_d(i) = zero + endif + + ! if ( xt(i) > 0.0 ) then + ! rig(i) = grav*xz(i)*xz(i)*(alpha*xt(i)-beta*xs(i)) + ! & /(2.0*(xu(i)*xu(i)+xv(i)*xv(i))) + ! else + ! rig(i) = 0.25 + ! endif + + ! qrain(i) = rig(i) + zm(i) = wind(i) + + endif + enddo + + ! restore nst-related prognostic fields for guess run + do i=1, im + ! if (wet(i) .and. .not.icy(i)) then + if (wet(i) .and. use_lake_model(i)/=1) then + if (flag_guess(i)) then ! when it is guess of + xt(i) = xt_old(i) + xs(i) = xs_old(i) + xu(i) = xu_old(i) + xv(i) = xv_old(i) + xz(i) = xz_old(i) + zm(i) = zm_old(i) + xtts(i) = xtts_old(i) + xzts(i) = xzts_old(i) + ifd(i) = ifd_old(i) + tskin(i) = tskin_old(i) + dt_cool(i) = dt_cool_old(i) + z_c(i) = z_c_old(i) + else + ! + ! update tskin when coupled and not guess run + ! (all other NSST variables have been updated in this case) + ! + if ( nstf_name1 > 1 ) then + tskin(i) = tsurf(i) + endif ! if nstf_name1 > 1 then + endif ! if flag_guess(i) then + endif ! if wet(i) .and. .not.icy(i) then + enddo + + ! if (lprnt .and. i == ipr) print *,' beg xz8=',xz(i) + + if ( nstf_name1 > 1 ) then + !> - Calculate latent and sensible heat flux over open water with updated tskin + !! for the grids of open water and the iteration is on. + do i = 1, im + if ( flag(i) ) then + qss(i) = fpvs( tskin(i) ) + qss(i) = eps*qss(i) / (ps(i) + epsm1*qss(i)) + qsurf(i) = qss(i) + evap(i) = elocp*rch(i) * (qss(i) - q0(i)) + + if(thsfc_loc) then ! Use local potential temperature + hflx(i) = rch(i) * (tskin(i) - theta1(i)) + else ! Use potential temperature referenced to 1000 hPa + hflx(i) = rch(i) * (tskin(i)/prsik1(i) - theta1(i)) + endif + + endif + enddo + endif ! if ( nstf_name1 > 1 ) then + ! + !> - Include sea spray effects + ! + do i=1,im + if(lseaspray .and. flag(i)) then + f10m = fm10(i) / fm(i) + u10m = f10m * u1(i) + v10m = f10m * v1(i) + ws10 = sqrt(u10m*u10m + v10m*v10m) + ws10 = max(ws10,1.) + ws10 = min(ws10,ws10cr) + tem = .015 * ws10 * ws10 + ru10 = 1. - .087 * log(10./tem) + qss1 = fpvs(t1(i)) + qss1 = eps * qss1 / (prsl1(i) + epsm1 * qss1) + tem = rd * cp * t1(i) * t1(i) + tem = 1. + eps * hvap * hvap * qss1 / tem + bb1 = 1. / tem + evaps = conlf * (ws10**5.4) * ru10 * bb1 + evaps = evaps * rho_a(i) * hvap * (qss1 - q0(i)) + evap(i) = evap(i) + alps * evaps + hflxs = consf * (ws10**3.4) * ru10 + hflxs = hflxs * rho_a(i) * cp * (tskin(i) - t1(i)) + ptem = alps - gams + hflx(i) = hflx(i) + bets * hflxs - ptem * evaps + endif + enddo + ! + do i=1,im + if ( flag(i) ) then + tem = one / rho_a(i) + hflx(i) = hflx(i) * tem * cpinv + evap(i) = evap(i) * tem * hvapi + endif + enddo + ! + ! if (lprnt) print *,' tskin=',tskin(ipr) + + return + end subroutine sfc_nst_run + !> @} +end module sfc_nst diff --git a/physics/sfc_nst_post.f b/physics/sfc_nst_post.f deleted file mode 100644 index 83bc2f273..000000000 --- a/physics/sfc_nst_post.f +++ /dev/null @@ -1,93 +0,0 @@ -!> \file sfc_nst_post.f -!! This file contains code to be executed after the GFS NSST model. - - module sfc_nst_post - - contains - -! \defgroup GFS_NSST_POST GFS Near-Surface Sea Temperature Post - -!> \section arg_table_sfc_nst_post_run Argument Table -!! \htmlinclude sfc_nst_post_run.html -!! -! \section NSST_general_post_algorithm General Algorithm -! -! \section NSST_detailed_post_algorithm Detailed Algorithm -! @{ - subroutine sfc_nst_post_run & - & ( im, kdt, rlapse, tgice, wet, use_lake_model, icy, oro, & - & oro_uf, nstf_name1, & - & nstf_name4, nstf_name5, xt, xz, dt_cool, z_c, tref, xlon, & - & tsurf_wat, tsfc_wat, nthreads, dtzm, errmsg, errflg & - & ) - - use machine , only : kind_phys - use module_nst_water_prop, only: get_dtzm_2d - - implicit none - - integer, parameter :: kp = kind_phys - -! --- inputs: - integer, intent(in) :: im, kdt, nthreads - logical, dimension(:), intent(in) :: wet, icy - integer, dimension(:), intent(in) :: use_lake_model - 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 - -! --- input/outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, & - & tsfc_wat - -! --- outputs: - real (kind=kind_phys), dimension(:), intent(out) :: dtzm - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! --- locals - integer :: i - real(kind=kind_phys) :: zsea1, zsea2 - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - -! if (lprnt) print *,' tseaz2=',tseal(ipr),' tref=',tref(ipr), -! & ' dt_cool=',dt_cool(ipr),' dt_warm=',2.0*xt(ipr)/xz(ipr), -! & ' kdt=',kdt - -! do i = 1, im -! if (wet(i) .and. .not. icy(i)) then -! tsurf_wat(i) = tsurf_wat(i) - (oro(i)-oro_uf(i)) * rlapse -! endif -! enddo - -! --- ... run nsst model ... --- - - if (nstf_name1 > 1) then - zsea1 = 0.001_kp*real(nstf_name4) - zsea2 = 0.001_kp*real(nstf_name5) - call get_dtzm_2d (xt, xz, dt_cool, z_c, wet, zsea1, zsea2, & - & im, 1, nthreads, dtzm) - do i = 1, im -! if (wet(i) .and. .not.icy(i)) then -! if (wet(i) .and. (frac_grid .or. .not. icy(i))) then - if (wet(i) .and. use_lake_model(i) /=1) then - tsfc_wat(i) = max(tgice, tref(i) + dtzm(i)) -! tsfc_wat(i) = max(271.2, tref(i) + dtzm(i)) - & -! (oro(i)-oro_uf(i))*rlapse - endif - enddo - endif - -! if (lprnt) print *,' tseaz2=',tsea(ipr),' tref=',tref(ipr), & -! & ' dt_cool=',dt_cool(ipr),' dt_warm=',dt_warm(ipr),' kdt=',kdt - - return - end subroutine sfc_nst_post_run - - end module sfc_nst_post diff --git a/physics/sfc_nst_post.f90 b/physics/sfc_nst_post.f90 new file mode 100644 index 000000000..174d5df76 --- /dev/null +++ b/physics/sfc_nst_post.f90 @@ -0,0 +1,87 @@ +!> \file sfc_nst_post.f90 +!! This file contains code to be executed after the GFS NSST model. + +module sfc_nst_post + + use machine , only : kind_phys, kp => kind_phys + use module_nst_water_prop , only : get_dtzm_2d + + implicit none + +contains + + ! \defgroup GFS_NSST_POST GFS Near-Surface Sea Temperature Post + + !> \section arg_table_sfc_nst_post_run Argument Table + !! \htmlinclude sfc_nst_post_run.html + !! + ! \section NSST_general_post_algorithm General Algorithm + ! + ! \section NSST_detailed_post_algorithm Detailed Algorithm + ! @{ + subroutine sfc_nst_post_run & + ( im, kdt, rlapse, tgice, wet, use_lake_model, icy, oro, & + oro_uf, nstf_name1, & + nstf_name4, nstf_name5, xt, xz, dt_cool, z_c, tref, xlon, & + tsurf_wat, tsfc_wat, nthreads, dtzm, errmsg, errflg & + ) + ! --- inputs: + integer, intent(in) :: im, kdt, nthreads + logical, dimension(:), intent(in) :: wet, icy + integer, dimension(:), intent(in) :: use_lake_model + 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 + + ! --- input/outputs: + real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, tsfc_wat + + ! --- outputs: + real (kind=kind_phys), dimension(:), intent(out) :: dtzm + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! --- locals + integer :: i + real(kind=kind_phys) :: zsea1, zsea2 + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! if (lprnt) print *,' tseaz2=',tseal(ipr),' tref=',tref(ipr), + ! & ' dt_cool=',dt_cool(ipr),' dt_warm=',2.0*xt(ipr)/xz(ipr), + ! & ' kdt=',kdt + + ! do i = 1, im + ! if (wet(i) .and. .not. icy(i)) then + ! tsurf_wat(i) = tsurf_wat(i) - (oro(i)-oro_uf(i)) * rlapse + ! endif + ! enddo + + ! --- ... run nsst model ... --- + + if (nstf_name1 > 1) then + zsea1 = 0.001_kp*real(nstf_name4) + zsea2 = 0.001_kp*real(nstf_name5) + call get_dtzm_2d (xt, xz, dt_cool, z_c, wet, zsea1, zsea2, im, 1, nthreads, dtzm) + do i = 1, im + ! if (wet(i) .and. .not.icy(i)) then + ! if (wet(i) .and. (frac_grid .or. .not. icy(i))) then + if (wet(i) .and. use_lake_model(i) /=1) then + tsfc_wat(i) = max(tgice, tref(i) + dtzm(i)) + ! tsfc_wat(i) = max(271.2, tref(i) + dtzm(i)) - & + ! (oro(i)-oro_uf(i))*rlapse + endif + enddo + endif + + ! if (lprnt) print *,' tseaz2=',tsea(ipr),' tref=',tref(ipr), & + ! & ' dt_cool=',dt_cool(ipr),' dt_warm=',dt_warm(ipr),' kdt=',kdt + + return + end subroutine sfc_nst_post_run + +end module sfc_nst_post diff --git a/physics/sfc_nst_pre.f b/physics/sfc_nst_pre.f deleted file mode 100644 index 77ff61f00..000000000 --- a/physics/sfc_nst_pre.f +++ /dev/null @@ -1,96 +0,0 @@ -!> \file sfc_nst_pre.f -!! This file contains preparation for the GFS NSST model. - - module sfc_nst_pre - - contains - -!> \defgroup GFS_NSST_PRE GFS Near-Surface Sea Temperature Pre -!! -!! The NSST scheme is one of the three schemes used to represent the -!! surface in the GFS physics suite. The other two are the Noah land -!! surface model and the sice simplified ice model. -!! -!! \section arg_table_sfc_nst_pre_run Argument Table -!! \htmlinclude sfc_nst_pre_run.html -!! -!> \section NSST_general_pre_algorithm General Algorithm - subroutine sfc_nst_pre_run - & (im, wet, tgice, tsfco, tsurf_wat, - & tseal, xt, xz, dt_cool, z_c, tref, cplflx, - & oceanfrac, nthreads, errmsg, errflg) - - use machine , only : kind_phys - use module_nst_water_prop, only: get_dtzm_2d - - implicit none - - integer, parameter :: kp = kind_phys - -! --- inputs: - 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 - logical, intent(in) :: cplflx - -! --- input/outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: - & tsurf_wat, tseal, tref - -! --- outputs: - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! --- locals - integer :: i - real(kind=kind_phys), parameter :: zero = 0.0_kp, - & one = 1.0_kp, - & half = 0.5_kp, - & omz1 = 2.0_kp - real(kind=kind_phys) :: tem1, tem2, dnsst - real(kind=kind_phys), dimension(im) :: dtzm, z_c_0 - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - do i=1,im - if (wet(i) .and. oceanfrac(i) > 0.0) then -! tem = (oro(i)-oro_uf(i)) * rlapse - ! DH* 20190927 simplyfing this code because tem is zero - !tem = zero - !tseal(i) = tsfco(i) + tem - tseal(i) = tsfco(i) - !tsurf_wat(i) = tsurf_wat(i) + tem - ! *DH - endif - enddo -! -! update tsfc & tref with T1 from OGCM & NSST Profile if coupled -! - if (cplflx) then - z_c_0 = zero - call get_dtzm_2d (xt, xz, dt_cool, & - & z_c_0, wet, zero, omz1, im, 1, nthreads, dtzm) - do i=1,im - if (wet(i) .and. oceanfrac(i) > zero ) then -! dnsst = tsfc_wat(i) - tref(i) ! retrive/get difference of Ts and Tf - tref(i) = max(tgice, tsfco(i) - dtzm(i)) ! update Tf with T1 and NSST T-Profile -! tsfc_wat(i) = max(271.2,tref(i) + dnsst) ! get Ts updated due to Tf update -! tseal(i) = tsfc_wat(i) - if (abs(xz(i)) > zero) then - tem2 = one / xz(i) - else - tem2 = zero - endif - tseal(i) = tref(i) + (xt(i)+xt(i)) * tem2 - dt_cool(i) - tsurf_wat(i) = tseal(i) - endif - enddo - endif - - return - end subroutine sfc_nst_pre_run - end module sfc_nst_pre diff --git a/physics/sfc_nst_pre.f90 b/physics/sfc_nst_pre.f90 new file mode 100644 index 000000000..3e77f2d6b --- /dev/null +++ b/physics/sfc_nst_pre.f90 @@ -0,0 +1,89 @@ +!> \file sfc_nst_pre.f90 +!! This file contains preparation for the GFS NSST model. + +module sfc_nst_pre + + use machine , only : kind_phys + use module_nst_water_prop , only : get_dtzm_2d + use module_nst_parameters , only : zero, one + + implicit none + +contains + + !> \defgroup GFS_NSST_PRE GFS Near-Surface Sea Temperature Pre + !! + !! The NSST scheme is one of the three schemes used to represent the + !! surface in the GFS physics suite. The other two are the Noah land + !! surface model and the sice simplified ice model. + !! + !! \section arg_table_sfc_nst_pre_run Argument Table + !! \htmlinclude sfc_nst_pre_run.html + !! + !> \section NSST_general_pre_algorithm General Algorithm + subroutine sfc_nst_pre_run & + (im, wet, tgice, tsfco, tsurf_wat, & + tseal, xt, xz, dt_cool, z_c, tref, cplflx, & + oceanfrac, nthreads, errmsg, errflg) + + ! --- inputs: + 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 + logical, intent(in) :: cplflx + + ! --- input/outputs: + real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, tseal, tref + + ! --- outputs: + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + ! --- locals + integer :: i + real(kind=kind_phys), parameter :: omz1 = 2.0_kind_phys + real(kind=kind_phys) :: tem2, dnsst + real(kind=kind_phys), dimension(im) :: dtzm, z_c_0 + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + do i=1,im + if (wet(i) .and. oceanfrac(i) > 0.0) then + ! tem = (oro(i)-oro_uf(i)) * rlapse + ! DH* 20190927 simplyfing this code because tem is zero + !tem = zero + !tseal(i) = tsfco(i) + tem + tseal(i) = tsfco(i) + !tsurf_wat(i) = tsurf_wat(i) + tem + ! *DH + endif + enddo + ! + ! update tsfc & tref with T1 from OGCM & NSST Profile if coupled + ! + if (cplflx) then + z_c_0 = zero + call get_dtzm_2d (xt, xz, dt_cool, z_c_0, wet, zero, omz1, im, 1, nthreads, dtzm) + do i=1,im + if (wet(i) .and. oceanfrac(i) > zero ) then + ! dnsst = tsfc_wat(i) - tref(i) ! retrive/get difference of Ts and Tf + tref(i) = max(tgice, tsfco(i) - dtzm(i)) ! update Tf with T1 and NSST T-Profile + ! tsfc_wat(i) = max(271.2,tref(i) + dnsst) ! get Ts updated due to Tf update + ! tseal(i) = tsfc_wat(i) + if (abs(xz(i)) > zero) then + tem2 = one / xz(i) + else + tem2 = zero + endif + tseal(i) = tref(i) + (xt(i)+xt(i)) * tem2 - dt_cool(i) + tsurf_wat(i) = tseal(i) + endif + enddo + endif + + return + end subroutine sfc_nst_pre_run +end module sfc_nst_pre From cf408aa7c740e2dca1cf2140ec2c261d1a1b8af3 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Mon, 27 Nov 2023 10:27:31 +0000 Subject: [PATCH 098/249] Update sfc_diff.meta --- physics/sfc_diff.meta | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index 95e2bce81..7f0139ab6 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -217,6 +217,22 @@ type = real kind = kind_phys intent = in +[u1] + standard_name = x_wind_at_surface_adjacent_layer + long_name = x component of surface layer wind + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[v1] + standard_name = y_wind_at_surface_adjacent_layer + long_name = y component of surface layer wind + units = m s-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [ssu] standard_name = ocn_current_zonal long_name = ocn_current_zonal From 1fb6b842b4952a37d61426fbd2876d6d8f8ab15a Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 28 Nov 2023 17:01:03 +0000 Subject: [PATCH 099/249] Bug fix in metadata --- physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta | 2 +- physics/MP/GFDL/gfdl_cloud_microphys.meta | 4 +++- physics/MP/Thompson/mp_thompson.meta | 4 +++- physics/MP/{Thompson => }/module_mp_radar.F90 | 0 4 files changed, 7 insertions(+), 3 deletions(-) rename physics/MP/{Thompson => }/module_mp_radar.F90 (100%) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta index 5701909fd..758b9d8b8 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = GFS_physics_post type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] diff --git a/physics/MP/GFDL/gfdl_cloud_microphys.meta b/physics/MP/GFDL/gfdl_cloud_microphys.meta index 35b216d4a..719a340e5 100644 --- a/physics/MP/GFDL/gfdl_cloud_microphys.meta +++ b/physics/MP/GFDL/gfdl_cloud_microphys.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = gfdl_cloud_microphys type = scheme - dependencies = ../../hooks/machine.F,module_gfdl_cloud_microphys.F90 + dependencies = ../../hooks/machine.F + dependencies = ../module_mp_radar.F90 + dependencies = module_gfdl_cloud_microphys.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/MP/Thompson/mp_thompson.meta b/physics/MP/Thompson/mp_thompson.meta index be0720531..ffe34bafb 100644 --- a/physics/MP/Thompson/mp_thompson.meta +++ b/physics/MP/Thompson/mp_thompson.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = mp_thompson type = scheme - dependencies = ../../hooks/machine.F,module_mp_radar.F90,module_mp_thompson.F90,module_mp_thompson_make_number_concentrations.F90 + dependencies = ../../hooks/machine.F + dependencies = ../module_mp_radar.F90 + dependencies = module_mp_thompson.F90,module_mp_thompson_make_number_concentrations.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/MP/Thompson/module_mp_radar.F90 b/physics/MP/module_mp_radar.F90 similarity index 100% rename from physics/MP/Thompson/module_mp_radar.F90 rename to physics/MP/module_mp_radar.F90 From 562377cc0b337f8f335eb5eec2b68ea3e9ec74e6 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Tue, 28 Nov 2023 15:30:10 -0500 Subject: [PATCH 100/249] remove files from old version --- physics/GFS_ccpp_suite_sim_pre.F90 | 442 ----------------------- physics/GFS_ccpp_suite_sim_pre.meta | 174 --------- physics/ccpp_suite_simulator.F90 | 212 ----------- physics/ccpp_suite_simulator.meta | 201 ----------- physics/module_ccpp_suite_simulator.F90 | 328 ----------------- physics/module_ccpp_suite_simulator.meta | 24 -- 6 files changed, 1381 deletions(-) delete mode 100644 physics/GFS_ccpp_suite_sim_pre.F90 delete mode 100644 physics/GFS_ccpp_suite_sim_pre.meta delete mode 100644 physics/ccpp_suite_simulator.F90 delete mode 100644 physics/ccpp_suite_simulator.meta delete mode 100644 physics/module_ccpp_suite_simulator.F90 delete mode 100644 physics/module_ccpp_suite_simulator.meta diff --git a/physics/GFS_ccpp_suite_sim_pre.F90 b/physics/GFS_ccpp_suite_sim_pre.F90 deleted file mode 100644 index fbaf5a1d9..000000000 --- a/physics/GFS_ccpp_suite_sim_pre.F90 +++ /dev/null @@ -1,442 +0,0 @@ -! ######################################################################################## -! -! Description: Interstitial CCPP suite to couple UFS physics to ccpp_suite_simulator. -! -! Contains: -! - load_ccpp_suite_sim(): read and load data into type used by ccpp_suite_simulator. -! called once during model initialization -! - GFS_ccpp_suite_sim_pre_run(): prepare GFS diagnostic physics tendencies for -! ccpp_suite_simulator. -! -! ######################################################################################## -module GFS_ccpp_suite_sim_pre - use machine, only: kind_phys - use module_ccpp_suite_simulator, only: base_physics_process - use netcdf - implicit none - public GFS_ccpp_suite_sim_pre_run, load_ccpp_suite_sim -contains - - ! ###################################################################################### - ! - ! SUBROUTINE GFS_ccpp_suite_sim_pre_run - ! - ! ###################################################################################### -!! \section arg_table_GFS_ccpp_suite_sim_pre_run -!! \htmlinclude GFS_ccpp_suite_sim_pre_run.html -!! - subroutine GFS_ccpp_suite_sim_pre_run(do_ccpp_suite_sim, dtend, ntqv, dtidx, dtp, & - index_of_process_dcnv, index_of_process_longwave, index_of_process_shortwave, & - index_of_process_scnv, index_of_process_orographic_gwd, index_of_process_pbl, & - index_of_process_mp, index_of_temperature, index_of_x_wind, index_of_y_wind, & - physics_process, iactive_T, iactive_u, iactive_v, iactive_q, active_phys_tend, & - errmsg, errflg) - - ! Inputs - logical, intent(in) :: do_ccpp_suite_sim - integer, intent(in) :: ntqv, index_of_process_dcnv, index_of_process_longwave, & - index_of_process_shortwave, index_of_process_scnv, & - index_of_process_orographic_gwd, index_of_process_pbl, index_of_process_mp, & - index_of_temperature, index_of_x_wind, index_of_y_wind - integer, intent(in), dimension(:,:) :: dtidx - real(kind_phys), intent(in) :: dtp - real(kind_phys), intent(in), dimension(:,:,:) :: dtend - type(base_physics_process),intent(in) :: physics_process(:) - integer, intent(in) :: iactive_T, iactive_u, iactive_v, iactive_q - - ! Outputs - real(kind_phys), intent(out) :: active_phys_tend(:,:,:) - character(len=*),intent(out) :: errmsg - integer, intent(out) :: errflg - - ! Locals - integer :: idtend, iactive - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not. do_ccpp_suite_sim) return - - ! Get tendency for "active" process. - - ! ###################################################################################### - ! DJS2023: For the UFS and SCM, the physics tendencies are stored in a multi-dimensional - ! array, CCPP standard_name = cumulative_change_of_state_variables. - ! These are not the instantaneous physics tendencies that are applied to the state by - ! the physics suites. Not all suites output physics tendencies... - ! Rather these are intended for diagnostic puposes and are accumulated over some - ! interval. - ! In the UFS/SCM this is controlled by the diagnostic bucket interval, namelist option - ! "fhzero". For this to work, you need to clear the diagnostic buckets after each - ! physics timestep when running in the UFS/SCM. - ! - ! In the SCM this is done by adding the following runtime options: - ! --n_itt_out 1 --n_itt_diag 1 - ! - ! ###################################################################################### - if (physics_process(1)%active_name == "LWRAD") iactive = index_of_process_longwave - if (physics_process(1)%active_name == "SWRAD") iactive = index_of_process_shortwave - if (physics_process(1)%active_name == "PBL") iactive = index_of_process_pbl - if (physics_process(1)%active_name == "GWD") iactive = index_of_process_orographic_gwd - if (physics_process(1)%active_name == "SCNV") iactive = index_of_process_scnv - if (physics_process(1)%active_name == "DCNV") iactive = index_of_process_dcnv - if (physics_process(1)%active_name == "cldMP") iactive = index_of_process_mp - - ! Heat - idtend = dtidx(index_of_temperature,iactive) - if (idtend >= 1) then - active_phys_tend(:,:,iactive_T) = dtend(:,:,idtend)/dtp - endif - - ! u-wind - idtend = dtidx(index_of_x_wind,iactive) - if (idtend >= 1) then - active_phys_tend(:,:,iactive_u) = dtend(:,:,idtend)/dtp - endif - - ! v-wind - idtend = dtidx(index_of_y_wind,iactive) - if (idtend >= 1) then - active_phys_tend(:,:,iactive_v) = dtend(:,:,idtend)/dtp - endif - - ! Moisture - idtend = dtidx(100+ntqv,iactive) - if (idtend >= 1) then - active_phys_tend(:,:,iactive_q) = dtend(:,:,idtend)/dtp - endif - - end subroutine GFS_ccpp_suite_sim_pre_run - - ! ###################################################################################### - subroutine load_ccpp_suite_sim(nlunit, nml_file, physics_process, iactive_T, & - iactive_u, iactive_v, iactive_q, errmsg, errflg) - - ! Inputs - integer, intent (in) :: nlunit - character(len=*), intent (in) :: nml_file - - ! Outputs - type(base_physics_process),intent(inout),allocatable :: physics_process(:) - integer, intent(inout) :: iactive_T, iactive_u, iactive_v, iactive_q - integer, intent(out) :: errflg - character(len=256), intent(out) :: errmsg - - ! Local variables - integer :: ncid, dimID, varID, status, ios, iprc, nlev_data, ntime_data - character(len=256) :: suite_sim_file - logical :: exists, do_ccpp_suite_sim - integer :: nprc_sim - - ! For each process there is a corresponding namelist entry, which is constructed as - ! follows: - ! {use_suite_sim[0(no)/1(yes)], time_split[0(no)/1(yes)], order[1:nPhysProcess]} - integer, dimension(3) :: & - prc_LWRAD_cfg = (/0,0,0/), & - prc_SWRAD_cfg = (/0,0,0/), & - prc_PBL_cfg = (/0,0,0/), & - prc_GWD_cfg = (/0,0,0/), & - prc_SCNV_cfg = (/0,0,0/), & - prc_DCNV_cfg = (/0,0,0/), & - prc_cldMP_cfg = (/0,0,0/) - - ! Namelist - namelist / ccpp_suite_sim_nml / do_ccpp_suite_sim, suite_sim_file, nprc_sim, & - prc_LWRAD_cfg, prc_SWRAD_cfg, prc_PBL_cfg, prc_GWD_cfg, prc_SCNV_cfg, & - prc_DCNV_cfg, prc_cldMP_cfg - - errmsg = '' - errflg = 0 - - ! Read in namelist - inquire (file = trim (nml_file), exist = exists) - if (.not. exists) then - errmsg = 'CCPP suite simulator namelist file: '//trim(nml_file)//' does not exist.' - errflg = 1 - return - else - open (unit = nlunit, file = nml_file, action = 'read', status = 'old', iostat = ios) - endif - rewind (nlunit) - read (nlunit, nml = ccpp_suite_sim_nml, iostat=status) - close (nlunit) - - ! Only proceed if suite simulator requested. - if (prc_SWRAD_cfg(1) == 1 .or. prc_LWRAD_cfg(1) == 1 .or. prc_PBL_cfg(1) == 1 .or. & - prc_GWD_cfg(1) == 1 .or. prc_SCNV_cfg(1) == 1 .or. prc_DCNV_cfg(1) == 1 .or. & - prc_cldMP_cfg(1) == 1 ) then - else - return - endif - - ! Check that input data file exists. - inquire (file = trim (suite_sim_file), exist = exists) - if (.not. exists) then - errmsg = 'CCPP suite simulator file: '//trim(suite_sim_file)//' does not exist' - errflg = 1 - return - endif - - ! - ! Read data file... - ! - - ! Open file - status = nf90_open(trim(suite_sim_file), NF90_NOWRITE, ncid) - if (status /= nf90_noerr) then - errmsg = 'Error reading in CCPP suite simulator file: '//trim(suite_sim_file) - errflg = 1 - return - endif - - ! Metadata (dimensions) - status = nf90_inq_dimid(ncid, 'time', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = ntime_data) - else - errmsg = 'CCPP suite simulator file: '//trim(suite_sim_file)//' does not contain [time] dimension' - errflg = 1 - return - endif - - status = nf90_inq_dimid(ncid, 'lev', dimid) - if (status == nf90_noerr) then - status = nf90_inquire_dimension(ncid, dimid, len = nlev_data) - else - errmsg = 'CCPP suite simulator file: '//trim(suite_sim_file)//' does not contain [lev] dimension' - errflg = 1 - return - endif - - ! Allocate space and read in data - allocate(physics_process(nprc_sim)) - physics_process(1)%active_name = '' - physics_process(1)%iactive_scheme = 0 - physics_process(1)%active_tsp = .false. - do iprc = 1,nprc_sim - allocate(physics_process(iprc)%tend1d%T( nlev_data )) - allocate(physics_process(iprc)%tend1d%u( nlev_data )) - allocate(physics_process(iprc)%tend1d%v( nlev_data )) - allocate(physics_process(iprc)%tend1d%q( nlev_data )) - allocate(physics_process(iprc)%tend2d%time( ntime_data)) - allocate(physics_process(iprc)%tend2d%T( nlev_data, ntime_data)) - allocate(physics_process(iprc)%tend2d%u( nlev_data, ntime_data)) - allocate(physics_process(iprc)%tend2d%v( nlev_data, ntime_data)) - allocate(physics_process(iprc)%tend2d%q( nlev_data, ntime_data)) - - ! Temporal info - status = nf90_inq_varid(ncid, 'times', varID) - if (status == nf90_noerr) then - status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%time) - else - errmsg = 'SCM data tendency file: '//trim(suite_sim_file)//' does not contain times variable' - errflg = 1 - return - endif - - if (iprc == prc_SWRAD_cfg(3)) then - ! Metadata - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "SWRAD" - if (prc_SWRAD_cfg(1) == 1) then - physics_process(iprc)%use_sim = .true. - else - physics_process(1)%nprg_active = 1 - iactive_T = 1 - endif - if (prc_SWRAD_cfg(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - - ! Data - status = nf90_inq_varid(ncid, 'dT_dt_swrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - endif - - if (iprc == prc_LWRAD_cfg(3)) then - ! Metadata - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "LWRAD" - if (prc_LWRAD_cfg(1) == 1) then - physics_process(iprc)%use_sim = .true. - else - physics_process(1)%nprg_active = 1 - iactive_T = 1 - endif - if (prc_LWRAD_cfg(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - - ! Data - status = nf90_inq_varid(ncid, 'dT_dt_lwrad', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - endif - - if (iprc == prc_GWD_cfg(3)) then - ! Metadata - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "GWD" - if (prc_GWD_cfg(1) == 1) then - physics_process(iprc)%use_sim = .true. - else - physics_process(1)%nprg_active = 3 - iactive_T = 1 - iactive_u = 2 - iactive_v = 3 - endif - if (prc_GWD_cfg(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - - ! Data - status = nf90_inq_varid(ncid, 'dT_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - status = nf90_inq_varid(ncid, 'du_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) - status = nf90_inq_varid(ncid, 'dv_dt_cgwd', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) - endif - - if (iprc == prc_PBL_cfg(3)) then - ! Metadata - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "PBL" - if (prc_PBL_cfg(1) == 1) then - physics_process(iprc)%use_sim = .true. - else - physics_process(1)%nprg_active = 4 - iactive_T = 1 - iactive_u = 2 - iactive_v = 3 - iactive_q = 4 - endif - if (prc_PBL_cfg(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - - ! Data - status = nf90_inq_varid(ncid, 'dT_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - status = nf90_inq_varid(ncid, 'dq_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) - status = nf90_inq_varid(ncid, 'du_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) - status = nf90_inq_varid(ncid, 'dv_dt_pbl', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) - endif - - if (iprc == prc_SCNV_cfg(3)) then - ! Metadata - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "SCNV" - if (prc_SCNV_cfg(1) == 1) then - physics_process(iprc)%use_sim = .true. - else - physics_process(1)%nprg_active = 4 - iactive_T = 1 - iactive_u = 2 - iactive_v = 3 - iactive_q = 4 - endif - if (prc_SCNV_cfg(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - - ! Data - status = nf90_inq_varid(ncid, 'dT_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - status = nf90_inq_varid(ncid, 'du_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) - status = nf90_inq_varid(ncid, 'dv_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) - status = nf90_inq_varid(ncid, 'dq_dt_shalconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) - endif - - if (iprc == prc_DCNV_cfg(3)) then - ! Metadata - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "DCNV" - if (prc_DCNV_cfg(1) == 1) then - physics_process(iprc)%use_sim = .true. - else - physics_process(1)%nprg_active = 4 - iactive_T = 1 - iactive_u = 2 - iactive_v = 3 - iactive_q = 4 - endif - if (prc_DCNV_cfg(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - ! Data - status = nf90_inq_varid(ncid, 'dT_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - status = nf90_inq_varid(ncid, 'du_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%u) - status = nf90_inq_varid(ncid, 'dv_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%v) - status = nf90_inq_varid(ncid, 'dq_dt_deepconv', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) - endif - - if (iprc == prc_cldMP_cfg(3)) then - ! Metadata - physics_process(iprc)%order = iprc - physics_process(iprc)%name = "cldMP" - if (prc_cldMP_cfg(1) == 1) then - physics_process(iprc)%use_sim = .true. - else - physics_process(1)%nprg_active = 2 - iactive_T = 1 - iactive_q = 2 - endif - if (prc_cldMP_cfg(2) == 1) then - physics_process(iprc)%time_split = .true. - endif - - ! Data - status = nf90_inq_varid(ncid, 'dT_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%T) - status = nf90_inq_varid(ncid, 'dq_dt_micro', varID) - if (status == nf90_noerr) status = nf90_get_var( ncid, varID, physics_process(iprc)%tend2d%q) - endif - - ! Which process-suite is "active"? Is process time-split? - if (.not. physics_process(iprc)%use_sim) then - physics_process(1)%iactive_scheme = iprc - physics_process(1)%active_name = physics_process(iprc)%name - if (physics_process(iprc)%time_split) then - physics_process(1)%active_tsp = .true. - endif - endif - - enddo - - if (physics_process(1)%iactive_scheme == 0) then - errflg = 1 - errmsg = "ERROR: No active suite set for CCPP suite simulator" - return - endif - - print*, "-----------------------------------" - print*, "--- Using CCPP suite simulator ---" - print*, "-----------------------------------" - do iprc = 1,nprc_sim - if (physics_process(iprc)%use_sim) then - print*," simulate_suite: ", trim(physics_process(iprc)%name) - print*," order: ", physics_process(iprc)%order - print*," time_split: ", physics_process(iprc)%time_split - else - print*, " active_suite: ", trim(physics_process(1)%active_name) - print*, " order: ", physics_process(physics_process(1)%iactive_scheme)%order - print*, " time_split : ", physics_process(1)%active_tsp - endif - enddo - print*, "-----------------------------------" - print*, "-----------------------------------" - - end subroutine load_ccpp_suite_sim - -end module GFS_ccpp_suite_sim_pre diff --git a/physics/GFS_ccpp_suite_sim_pre.meta b/physics/GFS_ccpp_suite_sim_pre.meta deleted file mode 100644 index cc73813fa..000000000 --- a/physics/GFS_ccpp_suite_sim_pre.meta +++ /dev/null @@ -1,174 +0,0 @@ -[ccpp-table-properties] - name = GFS_ccpp_suite_sim_pre - type = scheme - dependencies = machine.F,module_ccpp_suite_simulator.F90 - -######################################################################## -[ccpp-arg-table] - name = GFS_ccpp_suite_sim_pre_run - type = scheme -[do_ccpp_suite_sim] - standard_name = flag_for_ccpp_suite_simulator - long_name = flag for ccpp suite simulator - units = flag - dimensions = () - type = logical - intent = in -[physics_process] - standard_name = physics_process_type_for_CCPP_suite_simulator - long_name = physics process type for CCPP suite simulator - units = mixed - dimensions = (number_of_physics_process_in_CCPP_suite_simulator) - type = base_physics_process - intent = in -[dtend] - standard_name = cumulative_change_of_state_variables - long_name = diagnostic tendencies for state variables - units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) - type = real - kind = kind_phys - intent = in -[dtidx] - standard_name = cumulative_change_of_state_variables_outer_index - long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index - units = index - dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) - type = integer - intent = in -[dtp] - standard_name = timestep_for_physics - long_name = physics timestep - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[index_of_process_dcnv] - standard_name = index_of_deep_convection_process_process_in_cumulative_change_index - long_name = index of deep convection process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_longwave] - standard_name = index_of_longwave_heating_process_in_cumulative_change_index - long_name = index of longwave heating process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_shortwave] - standard_name = index_of_shortwave_heating_process_in_cumulative_change_index - long_name = index of shortwave heating process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_orographic_gwd] - standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index - long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_scnv] - standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index - long_name = index of shallow convection process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_pbl] - standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index - long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_process_mp] - standard_name = index_of_microphysics_process_process_in_cumulative_change_index - long_name = index of microphysics transport process in second dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_temperature] - standard_name = index_of_temperature_in_cumulative_change_index - long_name = index of temperature in first dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_x_wind] - standard_name = index_of_x_wind_in_cumulative_change_index - long_name = index of x-wind in first dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[index_of_y_wind] - standard_name = index_of_y_wind_in_cumulative_change_index - long_name = index of x-wind in first dimension of array cumulative change index - units = index - dimensions = () - type = integer - intent = in -[ntqv] - standard_name = index_of_specific_humidity_in_tracer_concentration_array - long_name = tracer index for water vapor (specific humidity) - units = index - dimensions = () - type = integer - intent = in -[active_phys_tend] - standard_name = tendencies_for_active_process_in_ccpp_suite_simulator - long_name = tendencies for active physics process in ccpp suite simulator - units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_suite_simulator) - type = real - kind = kind_phys - intent = out -[iactive_T] - standard_name = index_for_active_T_in_CCPP_suite_simulator - long_name = index into active process tracer array for temperature in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[iactive_u] - standard_name = index_for_active_u_in_CCPP_suite_simulator - long_name = index into active process tracer array for zonal wind in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[iactive_v] - standard_name = index_for_active_v_in_CCPP_suite_simulator - long_name = index into active process tracer array for meridional wind in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[iactive_q] - standard_name = index_for_active_q_in_CCPP_suite_simulator - long_name = index into active process tracer array for moisture in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out \ No newline at end of file diff --git a/physics/ccpp_suite_simulator.F90 b/physics/ccpp_suite_simulator.F90 deleted file mode 100644 index c1592263d..000000000 --- a/physics/ccpp_suite_simulator.F90 +++ /dev/null @@ -1,212 +0,0 @@ -! ######################################################################################## -! -! Description: This suite simulates the evolution of the internal physics state -! represented by a CCPP Suite Definition File (SDF). -! -! To activate this suite it must be a) embedded within the SDF and b) activated through -! the physics namelist. -! The derived-data type "base_physics_process" contains the metadata needed to reconstruct -! the temporal evolution of the state. An array of base_physics_process, physics_process, -! is populated by the host during initialization and passed to the physics. Additionally, -! this type holds any data, or type-bound procedures, required by the suite simulator(s). -! -! For this initial demonstration we are using 2-dimensional (height, time) forcing data, -! which is on the same native vertical grid as the SCM. The dataset has a temporal -! resolution of 1-hour, created by averaging all local times from a Tropical Warm Pool -! International Cloud Experiment (TWPICE) case. This was to create a dataset with a -! (constant) diurnal cycle. -! -! ######################################################################################## -module ccpp_suite_simulator - use machine, only: kind_phys - use module_ccpp_suite_simulator, only: base_physics_process, sim_LWRAD, sim_SWRAD, & - sim_PBL, sim_GWD, sim_DCNV, sim_SCNV, sim_cldMP - implicit none - public ccpp_suite_simulator_run -contains - - ! ###################################################################################### - ! - ! SUBROUTINE ccpp_suite_simulator_run - ! - ! ###################################################################################### -!! \section arg_table_ccpp_suite_simulator_run -!! \htmlinclude ccpp_suite_simulator_run.html -!! - subroutine ccpp_suite_simulator_run(do_ccpp_suite_sim, kdt, nCol, nLay, dtp, jdat, & - iactive_T, iactive_u, iactive_v, iactive_q, proc_start, proc_end, physics_process,& - in_pre_active, in_post_active, tgrs, ugrs, vgrs, qgrs, active_phys_tend, gt0, gu0,& - gv0, gq0, errmsg, errflg) - - ! Inputs - logical, intent(in) :: do_ccpp_suite_sim - integer, intent(in) :: kdt, nCol, nLay, jdat(8), iactive_T, iactive_u, & - iactive_v, iactive_q - real(kind_phys), intent(in) :: dtp, tgrs(:,:), ugrs(:,:), vgrs(:,:), qgrs(:,:,:), & - active_phys_tend(:,:,:) - ! Outputs - type(base_physics_process),intent(inout) :: physics_process(:) - real(kind_phys), intent(inout) :: gt0(:,:), gu0(:,:), gv0(:,:), gq0(:,:) - character(len=*),intent(out) :: errmsg - integer, intent(out) :: errflg - integer, intent(inout) :: proc_start, proc_end - logical, intent(inout) :: in_pre_active, in_post_active - - ! Locals - integer :: iCol, year, month, day, hour, min, sec, iprc - real(kind_phys), dimension(nCol,nLay) :: gt1, gu1, gv1, dTdt, dudt, dvdt, gq1, dqdt - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (.not. do_ccpp_suite_sim) return - - ! Current forecast time (Data-format specific) - year = jdat(1) - month = jdat(2) - day = jdat(3) - hour = jdat(5) - min = jdat(6) - sec = jdat(7) - - ! Set state at beginning of the physics timestep. - gt1(:,:) = tgrs(:,:) - gu1(:,:) = ugrs(:,:) - gv1(:,:) = vgrs(:,:) - gq1(:,:) = qgrs(:,:,1) - dTdt(:,:) = 0. - dudt(:,:) = 0. - dvdt(:,:) = 0. - dqdt(:,:) = 0. - - ! - ! Set bookeeping indices - ! - if (in_pre_active) then - proc_start = 1 - proc_end = max(1,physics_process(1)%iactive_scheme-1) - endif - if (in_post_active) then - proc_start = physics_process(1)%iactive_scheme - proc_end = size(physics_process) - endif - - ! - ! Simulate internal physics timestep evolution. - ! - do iprc = proc_start,proc_end - do iCol = 1,nCol - - ! Reset locals - physics_process(iprc)%tend1d%T(:) = 0. - physics_process(iprc)%tend1d%u(:) = 0. - physics_process(iprc)%tend1d%v(:) = 0. - physics_process(iprc)%tend1d%q(:) = 0. - - ! Using scheme simulator - ! Very simple... - ! Interpolate 2D data (time,level) tendency to local time. - ! Here the data is already on the SCM vertical coordinate. - ! - ! In theory the data can be of any dimensionality and the onus falls on the - ! developer to extend the type "base_physics_process" to work with for their - ! application. - ! - if (physics_process(iprc)%use_sim) then - if (physics_process(iprc)%name == "LWRAD") then - call sim_LWRAD(year, month, day, hour, min, sec, physics_process(iprc)) - endif - if (physics_process(iprc)%name == "SWRAD")then - call sim_SWRAD(year, month, day, hour, min, sec, physics_process(iprc)) - endif - if (physics_process(iprc)%name == "GWD")then - call sim_GWD(year, month, day, hour, min, sec, physics_process(iprc)) - endif - if (physics_process(iprc)%name == "PBL")then - call sim_PBL(year, month, day, hour, min, sec, physics_process(iprc)) - endif - if (physics_process(iprc)%name == "SCNV")then - call sim_SCNV(year, month, day, hour, min, sec, physics_process(iprc)) - endif - if (physics_process(iprc)%name == "DCNV")then - call sim_DCNV(year, month, day, hour, min, sec, physics_process(iprc)) - endif - if (physics_process(iprc)%name == "cldMP")then - call sim_cldMP(year, month, day, hour, min, sec, physics_process(iprc)) - endif - - ! Using data tendency from "active" scheme(s). - else - if (iactive_T > 0) physics_process(iprc)%tend1d%T = active_phys_tend(iCol,:,iactive_T) - if (iactive_u > 0) physics_process(iprc)%tend1d%u = active_phys_tend(iCol,:,iactive_u) - if (iactive_v > 0) physics_process(iprc)%tend1d%v = active_phys_tend(iCol,:,iactive_v) - if (iactive_q > 0) physics_process(iprc)%tend1d%q = active_phys_tend(iCol,:,iactive_q) - endif - - ! Update state now? (time-split scheme) - if (physics_process(iprc)%time_split) then - gt1(iCol,:) = gt1(iCol,:) + (dTdt(iCol,:) + physics_process(iprc)%tend1d%T)*dtp - gu1(iCol,:) = gu1(iCol,:) + (dudt(iCol,:) + physics_process(iprc)%tend1d%u)*dtp - gv1(iCol,:) = gv1(iCol,:) + (dvdt(iCol,:) + physics_process(iprc)%tend1d%v)*dtp - gq1(iCol,:) = gq1(iCol,:) + (dqdt(iCol,:) + physics_process(iprc)%tend1d%q)*dtp - dTdt(iCol,:) = 0. - dudt(iCol,:) = 0. - dvdt(iCol,:) = 0. - dqdt(iCol,:) = 0. - ! Accumulate tendencies, update later? (process-split scheme) - else - dTdt(iCol,:) = dTdt(iCol,:) + physics_process(iprc)%tend1d%T - dudt(iCol,:) = dudt(iCol,:) + physics_process(iprc)%tend1d%u - dvdt(iCol,:) = dvdt(iCol,:) + physics_process(iprc)%tend1d%v - dqdt(iCol,:) = dqdt(iCol,:) + physics_process(iprc)%tend1d%q - endif - enddo ! END: Loop over columns - - ! Print diagnostics - if (physics_process(iprc)%use_sim) then - if (physics_process(iprc)%time_split) then - write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'time split scheme (simulated)' - else - write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'process split scheme (simulated)' - endif - else - if (physics_process(iprc)%time_split) then - write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'time split scheme (active)' - else - write(*,'(a25,i2,a4,i2,a5,a10,a35)') 'CCPP suite simulator: ',iprc,' of ',proc_end,' ',physics_process(iprc)%name,'process split scheme (active)' - endif - write(*,'(a25,i2)') ' # prog. vars.: ',physics_process(1)%nprg_active - endif - enddo ! END: Loop over physics processes - - ! - ! Update state with accumulated tendencies (process-split only) - ! (Suites where active scheme is last physical process) - ! - iprc = minval([iprc,proc_end]) - if (.not. physics_process(iprc)%time_split) then - do iCol = 1,nCol - gt0(iCol,:) = gt1(iCol,:) + dTdt(iCol,:)*dtp - gu0(iCol,:) = gu1(iCol,:) + dudt(iCol,:)*dtp - gv0(iCol,:) = gv1(iCol,:) + dvdt(iCol,:)*dtp - gq0(iCol,:) = gq1(iCol,:) + dqdt(iCol,:)*dtp - enddo - endif - - ! - ! Update bookeeping indices - ! - if (in_pre_active) then - in_pre_active = .false. - in_post_active = .true. - endif - - if (size(physics_process) == proc_end) then - in_pre_active = .true. - in_post_active = .false. - endif - - end subroutine ccpp_suite_simulator_run - -end module ccpp_suite_simulator diff --git a/physics/ccpp_suite_simulator.meta b/physics/ccpp_suite_simulator.meta deleted file mode 100644 index bfa664922..000000000 --- a/physics/ccpp_suite_simulator.meta +++ /dev/null @@ -1,201 +0,0 @@ -[ccpp-table-properties] - name = ccpp_suite_simulator - type = scheme - dependencies = machine.F,module_ccpp_suite_simulator.F90 - -[ccpp-arg-table] - name = ccpp_suite_simulator_run - type = scheme -[do_ccpp_suite_sim] - standard_name = flag_for_ccpp_suite_simulator - long_name = flag for ccpp suite simulator - units = flag - dimensions = () - type = logical - intent = in -[kdt] - standard_name = index_of_timestep - long_name = current forecast iteration - units = index - dimensions = () - type = integer - intent = in -[nCol] - standard_name = horizontal_loop_extent - long_name = horizontal dimension - units = count - dimensions = () - type = integer - intent = in -[nLay] - standard_name = vertical_layer_dimension - long_name = number of vertical levels - units = count - dimensions = () - type = integer - intent = in -[dtp] - standard_name = timestep_for_physics - long_name = physics timestep - units = s - dimensions = () - type = real - kind = kind_phys - intent = in -[jdat] - standard_name = date_and_time_of_forecast_in_united_states_order - long_name = current forecast date and time - units = none - dimensions = (8) - type = integer - intent = in -[proc_start] - standard_name = index_for_first_physics_process_in_CCPP_suite_simulator - long_name = index for first physics process in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = inout -[proc_end] - standard_name = index_for_last_physics_process_in_CCPP_suite_simulator - long_name = index for last physics process in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = inout -[in_pre_active] - standard_name = flag_to_indicate_location_in_physics_process_loop_before_active_scheme - long_name = flag to indicate location in physics process loop before active scheme - units = flag - dimensions = () - type = logical - intent = inout -[in_post_active] - standard_name = flag_to_indicate_location_in_physics_process_loop_after_active_scheme - long_name = flag to indicate location in physics process loop after active scheme - units = flag - dimensions = () - type = logical - intent = inout -[tgrs] - standard_name = air_temperature - long_name = model layer mean temperature - units = K - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[ugrs] - standard_name = x_wind - long_name = zonal wind - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[vgrs] - standard_name = y_wind - long_name = meridional wind - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in -[qgrs] - standard_name = tracer_concentration - long_name = model layer mean tracer concentration - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) - type = real - kind = kind_phys - intent = in -[active_phys_tend] - standard_name = tendencies_for_active_process_in_ccpp_suite_simulator - long_name = tendencies for active physics process in ccpp suite simulator - units = mixed - dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_prognostics_varaibles_in_CCPP_suite_simulator) - type = real - kind = kind_phys - intent = in -[iactive_T] - standard_name = index_for_active_T_in_CCPP_suite_simulator - long_name = index into active process tracer array for temperature in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[iactive_u] - standard_name = index_for_active_u_in_CCPP_suite_simulator - long_name = index into active process tracer array for zonal wind in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[iactive_v] - standard_name = index_for_active_v_in_CCPP_suite_simulator - long_name = index into active process tracer array for meridional wind in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[iactive_q] - standard_name = index_for_active_q_in_CCPP_suite_simulator - long_name = index into active process tracer array for moisture in CCPP suite simulator - units = count - dimensions = () - type = integer - intent = in -[gt0] - standard_name = air_temperature_of_new_state - long_name = temperature updated by physics - units = K - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[gu0] - standard_name = x_wind_of_new_state - long_name = zonal wind updated by physics - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[gv0] - standard_name = y_wind_of_new_state - long_name = meridional wind updated by physics - units = m s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[gq0] - standard_name = specific_humidity_of_new_state - long_name = tracer concentration updated by physics - units = kg kg-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = inout -[physics_process] - standard_name = physics_process_type_for_CCPP_suite_simulator - long_name = physics process type for CCPP suite simulator - units = mixed - dimensions = (number_of_physics_process_in_CCPP_suite_simulator) - type = base_physics_process - intent = inout -[errmsg] - standard_name = ccpp_error_message - long_name = error message for error handling in CCPP - units = none - dimensions = () - type = character - kind = len=* - intent = out -[errflg] - standard_name = ccpp_error_code - long_name = error code for error handling in CCPP - units = 1 - dimensions = () - type = integer - intent = out \ No newline at end of file diff --git a/physics/module_ccpp_suite_simulator.F90 b/physics/module_ccpp_suite_simulator.F90 deleted file mode 100644 index c4f9fc4e4..000000000 --- a/physics/module_ccpp_suite_simulator.F90 +++ /dev/null @@ -1,328 +0,0 @@ -! ######################################################################################## -! -! This module contains the type, base_physics_process, and supporting subroutines needed -! by the ccpp suite simulator. -! -! ######################################################################################## -module module_ccpp_suite_simulator -!> \section arg_table_module_ccpp_suite_simulator Argument table -!! \htmlinclude module_ccpp_suite_simulator.html -!! - use machine, only : kind_phys - implicit none - - public base_physics_process - - ! Type containing 1D (time) physics tendencies. - type phys_tend_1d - real(kind_phys), dimension(:), allocatable :: T - real(kind_phys), dimension(:), allocatable :: u - real(kind_phys), dimension(:), allocatable :: v - real(kind_phys), dimension(:), allocatable :: q - real(kind_phys), dimension(:), allocatable :: p - real(kind_phys), dimension(:), allocatable :: z - end type phys_tend_1d - - ! Type containing 2D (lev,time) physics tendencies. - type phys_tend_2d - real(kind_phys), dimension(:), allocatable :: time - real(kind_phys), dimension(:,:), allocatable :: T - real(kind_phys), dimension(:,:), allocatable :: u - real(kind_phys), dimension(:,:), allocatable :: v - real(kind_phys), dimension(:,:), allocatable :: q - real(kind_phys), dimension(:,:), allocatable :: p - real(kind_phys), dimension(:,:), allocatable :: z - end type phys_tend_2d - - ! Type containing 3D (loc,lev,time) physics tendencies. - type phys_tend_3d - real(kind_phys), dimension(:), allocatable :: time - real(kind_phys), dimension(:), allocatable :: lon - real(kind_phys), dimension(:), allocatable :: lat - real(kind_phys), dimension(:,:,:), allocatable :: T - real(kind_phys), dimension(:,:,:), allocatable :: u - real(kind_phys), dimension(:,:,:), allocatable :: v - real(kind_phys), dimension(:,:,:), allocatable :: q - end type phys_tend_3d - - ! Type containing 4D (lon,lat,lev,time) physics tendencies. - type phys_tend_4d - real(kind_phys), dimension(:), allocatable :: time - real(kind_phys), dimension(:,:), allocatable :: lon - real(kind_phys), dimension(:,:), allocatable :: lat - real(kind_phys), dimension(:,:,:,:), allocatable :: T - real(kind_phys), dimension(:,:,:,:), allocatable :: u - real(kind_phys), dimension(:,:,:,:), allocatable :: v - real(kind_phys), dimension(:,:,:,:), allocatable :: q - end type phys_tend_4d - -! This type contains the meta information and data for each physics process. - -!> \section arg_table_base_physics_process Argument Table -!! \htmlinclude base_physics_process.html -!! - type base_physics_process - character(len=16) :: name ! Physics process name - logical :: time_split = .false. ! Is process time-split? - logical :: use_sim = .false. ! Is process "active"? - integer :: order ! Order of process in process-loop - type(phys_tend_1d) :: tend1d ! Instantaneous data - type(phys_tend_2d) :: tend2d ! 2-dimensional data - type(phys_tend_3d) :: tend3d ! Not used. Placeholder for 3-dimensional spatial data. - type(phys_tend_4d) :: tend4d ! Not used. Placeholder for 4-dimensional spatio-tempo data. - character(len=16) :: active_name ! "Active" scheme: Physics process name - integer :: iactive_scheme ! "Active" scheme: Order of process in process-loop - logical :: active_tsp ! "Active" scheme: Is process time-split? - integer :: nprg_active ! "Active" scheme: Number of prognostic variables - contains - generic, public :: linterp => linterp_1D, linterp_2D - procedure, private :: linterp_1D - procedure, private :: linterp_2D - procedure, public :: find_nearest_loc_2d_1d - procedure, public :: cmp_time_wts - end type base_physics_process - -contains - - ! #################################################################################### - ! Type-bound procedure to compute tendency profile for time-of-day. - ! - ! For use with 1D data (level, time) tendencies with diurnal (24-hr) forcing. - ! #################################################################################### - function linterp_1D(this, var_name, year, month, day, hour, min, sec) result(err_message) - class(base_physics_process), intent(inout) :: this - character(len=*), intent(in) :: var_name - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: err_message - integer :: ti(1), tf(1), ntime - real(kind_phys) :: w1, w2 - - ! Interpolation weights - call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) - - ntime = size(this%tend2d%T(1,:)) - - select case(var_name) - case("T") - if (tf(1) .le. ntime) then - this%tend1d%T = w1*this%tend2d%T(:,ti(1)) + w2*this%tend2d%T(:,tf(1)) - else - this%tend1d%T = this%tend2d%T(:,1) - endif - case("u") - if (tf(1) .le. ntime) then - this%tend1d%u = w1*this%tend2d%u(:,ti(1)) + w2*this%tend2d%u(:,tf(1)) - else - this%tend1d%u = this%tend2d%u(:,1) - endif - case("v") - if (tf(1) .le. ntime) then - this%tend1d%v = w1*this%tend2d%v(:,ti(1)) + w2*this%tend2d%v(:,tf(1)) - else - this%tend1d%v = this%tend2d%v(:,1) - endif - case("q") - if (tf(1) .le. ntime) then - this%tend1d%q = w1*this%tend2d%q(:,ti(1)) + w2*this%tend2d%q(:,tf(1)) - else - this%tend1d%q = this%tend2d%q(:,1) - endif - end select - - end function linterp_1D - - ! #################################################################################### - ! Type-bound procedure to compute tendency profile for time-of-day. - ! - ! For use with 2D data (location, level, time) tendencies with diurnal (24-hr) forcing. - ! This assumes that the location dimension has a [longitude, latitude] allocated with - ! each location. - ! #################################################################################### - function linterp_2D(this, var_name, lon, lat, year, month, day, hour, min, sec) result(err_message) - class(base_physics_process), intent(inout) :: this - character(len=*), intent(in) :: var_name - integer, intent(in) :: year, month, day, hour, min, sec - real(kind_phys), intent(in) :: lon, lat - character(len=128) :: err_message - integer :: ti(1), tf(1), iNearest - real(kind_phys) :: w1, w2 - - ! Interpolation weights (temporal) - call this%cmp_time_wts(year, month, day, hour, min, sec, w1, w2, ti, tf) - - ! Grab data tendency closest to column [lon,lat] - iNearest = this%find_nearest_loc_2d_1d(lon,lat) - - select case(var_name) - case("T") - this%tend1d%T = w1*this%tend3d%T(iNearest,:,ti(1)) + w2*this%tend3d%T(iNearest,:,tf(1)) - case("u") - this%tend1d%u = w1*this%tend3d%u(iNearest,:,ti(1)) + w2*this%tend3d%u(iNearest,:,tf(1)) - case("v") - this%tend1d%v = w1*this%tend3d%v(iNearest,:,ti(1)) + w2*this%tend3d%v(iNearest,:,tf(1)) - case("q") - this%tend1d%q = w1*this%tend3d%q(iNearest,:,ti(1)) + w2*this%tend3d%q(iNearest,:,tf(1)) - end select - end function linterp_2D - - ! #################################################################################### - ! Type-bound procedure to find nearest location. - ! For use with linterp_2D, NOT YET IMPLEMENTED. - ! #################################################################################### - pure function find_nearest_loc_2d_1d(this, lon, lat) - class(base_physics_process), intent(in) :: this - real(kind_phys), intent(in) :: lon, lat - integer :: find_nearest_loc_2d_1d - - find_nearest_loc_2d_1d = 1 - end function find_nearest_loc_2d_1d - - ! #################################################################################### - ! Type-bound procedure to compute linear interpolation weights for a diurnal (24-hour) - ! forcing. - ! #################################################################################### - subroutine cmp_time_wts(this, year, month, day, hour, minute, sec, w1, w2, ti, tf) - ! Inputs - class(base_physics_process), intent(in) :: this - integer, intent(in) :: year, month, day, hour, minute, sec - ! Outputs - integer,intent(out) :: ti(1), tf(1) - real(kind_phys),intent(out) :: w1, w2 - ! Locals - real(kind_phys) :: hrofday - - hrofday = hour*3600. + minute*60. + sec - ti = max(hour,1) - tf = min(ti + 1,24) - w1 = ((hour+1)*3600 - hrofday)/3600 - w2 = 1 - w1 - - end subroutine cmp_time_wts - - ! #################################################################################### - ! #################################################################################### - subroutine sim_LWRAD( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (allocated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - - end subroutine sim_LWRAD - - ! #################################################################################### - ! #################################################################################### - subroutine sim_SWRAD( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (allocated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - - end subroutine sim_SWRAD - - ! #################################################################################### - ! #################################################################################### - subroutine sim_GWD( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (allocated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - - end subroutine sim_GWD - - ! #################################################################################### - ! #################################################################################### - subroutine sim_PBL( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (allocated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - - end subroutine sim_PBL - - ! #################################################################################### - ! #################################################################################### - subroutine sim_DCNV( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (allocated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - - end subroutine sim_DCNV - - ! #################################################################################### - ! #################################################################################### - subroutine sim_SCNV( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (allocated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%u)) then - errmsg = process%linterp("u", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%v)) then - errmsg = process%linterp("v", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - - end subroutine sim_SCNV - - ! #################################################################################### - ! #################################################################################### - subroutine sim_cldMP( year, month, day, hour, min, sec, process) - type(base_physics_process), intent(inout) :: process - integer, intent(in) :: year, month, day, hour, min, sec - character(len=128) :: errmsg - - if (allocated(process%tend2d%T)) then - errmsg = process%linterp("T", year,month,day,hour,min,sec) - endif - if (allocated(process%tend2d%q)) then - errmsg = process%linterp("q", year,month,day,hour,min,sec) - endif - end subroutine sim_cldMP - -end module module_ccpp_suite_simulator diff --git a/physics/module_ccpp_suite_simulator.meta b/physics/module_ccpp_suite_simulator.meta deleted file mode 100644 index cd8e3db1b..000000000 --- a/physics/module_ccpp_suite_simulator.meta +++ /dev/null @@ -1,24 +0,0 @@ -[ccpp-table-properties] - name = base_physics_process - type = ddt - dependencies = - -[ccpp-arg-table] - name = base_physics_process - type = ddt - -######################################################################## -[ccpp-table-properties] - name = module_ccpp_suite_simulator - type = module - dependencies = machine.F - -[ccpp-arg-table] - name = module_ccpp_suite_simulator - type = module -[base_physics_process] - standard_name = base_physics_process - long_name = definition of type base_physics_process - units = DDT - dimensions = () - type = base_physics_process From 12cd9c698ad9bc97bb4c84a2225542ccaf0ce3bc Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Tue, 28 Nov 2023 15:35:12 -0500 Subject: [PATCH 101/249] update files satmedmfvdifq.F samfshalcnv.f sfc_diff.f --- physics/samfshalcnv.f | 2 +- physics/satmedmfvdifq.F | 2 +- physics/scm_sfc_flux_spec.F90 | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/samfshalcnv.f b/physics/samfshalcnv.f index 3869ea6ea..d0bab05dd 100644 --- a/physics/samfshalcnv.f +++ b/physics/samfshalcnv.f @@ -191,7 +191,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & parameter(cinacrmx=-120.,shevf=2.0) parameter(dtmax=10800.,dtmin=600.) parameter(bb1=4.0,bb2=0.8,csmf=0.2) - parameter(tkcrt=2.,cmxfac=15.) + parameter(tkcrt=2.,cmxfac=10.) ! parameter(bet1=1.875,cd1=.506,f1=2.0,gam1=.5) parameter(betaw=.03,dxcrtc0=9.e3) parameter(h1=0.33333333) diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 73fc4aff8..7b54b6d12 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -271,7 +271,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(elmfac=1.0,elefac=1.0,cql=100.) parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=1000.) parameter(qlcr=3.5e-5,zstblmax=2500.) - parameter(xkinv1=0.15,xkinv2=0.3) + parameter(xkinv1=0.4,xkinv2=0.3) parameter(h1=0.33333333,hcrinv=250.) parameter(vegflo=0.1,vegfup=1.0,z0lo=0.1,z0up=1.0) parameter(vc0=1.0,zc0=1.0) diff --git a/physics/scm_sfc_flux_spec.F90 b/physics/scm_sfc_flux_spec.F90 index e835b77ff..835b468ff 100644 --- a/physics/scm_sfc_flux_spec.F90 +++ b/physics/scm_sfc_flux_spec.F90 @@ -58,9 +58,9 @@ subroutine scm_sfc_flux_spec_run (im, u1, v1, z1, t1, q1, p1, roughness_length, use machine, only: kind_phys integer, intent(in) :: im, lkm - integer, intent(inout) :: islmsk(:), use_lake_model(:) + integer, intent(inout) :: islmsk(:) logical, intent(in) :: cplflx, cplice - logical, intent(inout) :: dry(:), icy(:), flag_cice(:), wet(:) + logical, intent(inout) :: dry(:), icy(:), flag_cice(:), wet(:), use_lake_model(:) real(kind=kind_phys), intent(in) :: cp, grav, hvap, rd, fvirt, vonKarman, min_seaice, tgice, min_lakeice real(kind=kind_phys), intent(in) :: u1(:), v1(:), z1(:), t1(:), q1(:), p1(:), roughness_length(:), & spec_sh_flux(:), spec_lh_flux(:), exner_inverse(:), T_surf(:), oceanfrac(:), lakefrac(:), lakedepth(:) From 6bdadb5e7c61f2cabe391736cb3d29e1d041b434 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Wed, 29 Nov 2023 09:47:20 +0000 Subject: [PATCH 102/249] Set check_ssu_ssv to false in the following files: satmedmfvdif.F satmedmfvdifq.F sfc_diag.f sfc_diff.f --- physics/satmedmfvdif.F | 4 +--- physics/satmedmfvdifq.F | 7 ++----- physics/sfc_diag.f | 3 +-- physics/sfc_diff.f | 3 +-- physics/sfc_nst.f | 3 +-- 5 files changed, 6 insertions(+), 14 deletions(-) diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index a0441e8f4..cc7ce95b3 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -255,18 +255,16 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & errmsg = '' errflg = 0 ! - check_ssu_ssv=.true. + check_ssu_ssv=.false. if(check_ssu_ssv) then ssumax=0.0 ssvmax=0.0 do ii=1,im if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) - !windrel(ii) = sqrt((u1(ii)-ssu(ii))**2+(v1(ii)-ssv(ii))**2) enddo print*, 'in satmedmfvdif.F ssumax,ssvmax =',ssumax,ssvmax endif - !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. !> -# Compute preliminary variables from input arguments dt2 = delt diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 62bf6473f..8a200eb92 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -280,13 +280,11 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(cs0=0.4,csmf=0.5) parameter(rchck=1.5,ndt=20) -!BL integer ii real(kind=kind_phys) :: ssumax, ssvmax logical :: check_ssu_ssv - write(*,*)'in_satmedmfvdifq,u1 v1',u1(1,1),v1(1,1) - check_ssu_ssv=.true. + check_ssu_ssv=.false. if(check_ssu_ssv) then ssumax=0.0 ssvmax=0.0 @@ -294,10 +292,9 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) enddo + write(*,*)'in_satmedmfvdifq,u1 v1',u1(1,1),v1(1,1) print*, 'in satmedmfvdifq.F ssumax,ssvmax =',ssumax,ssvmax endif - !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. -!BL if (tc_pbl == 0) then ck0 = 0.4 diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index b9006d6a9..acfad7b27 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -77,7 +77,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & errmsg = '' errflg = 0 - check_ssu_ssv=.true. + check_ssu_ssv=.false. if(check_ssu_ssv) then ssumax=0.0 ssvmax=0.0 @@ -87,7 +87,6 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & enddo print*, 'in sfc_diag ssumax,ssvmax =',ssumax,ssvmax endif - !if(abs(ssumax-0.02).lt.0.01) check_ssu_ssv=.false. !-- testptlat = 35.3_kind_phys diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 0ac51fda0..58614c452 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -175,7 +175,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type - check_ssu_ssv=.true. + check_ssu_ssv=.false. if(check_ssu_ssv) then ssumax=0.0 ssvmax=0.0 @@ -186,7 +186,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) print*, 'in sfc_diff ssumax,ssvmax =',ssumax,ssvmax print*, 'in sfc_diff wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) endif - !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. do i=1,im windrel(i)=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) enddo diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 8aad8fc8f..526271aa3 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -269,7 +269,7 @@ subroutine sfc_nst_run & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - check_ssu_ssv=.true. + check_ssu_ssv=.false. if(check_ssu_ssv) then ssumax=0.0 ssvmax=0.0 @@ -280,7 +280,6 @@ subroutine sfc_nst_run & print*, 'in sfc_nst ssumax,ssvmax =',ssumax,ssvmax print*, 'in sfc_nst wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) endif - !if(abs(ssumax-0.02) .lt. 0.01) check_ssu_ssv=.false. if (nstf_name1 == 0) return ! No NSST model used From a2a242487053a091b338f4ef1f3431f3304b205e Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Wed, 29 Nov 2023 15:16:31 +0000 Subject: [PATCH 103/249] Update sfc_diff.meta --- physics/sfc_diff.meta | 7 ------- 1 file changed, 7 deletions(-) diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index 7f0139ab6..80a89fc1b 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -102,13 +102,6 @@ type = real kind = kind_phys intent = in -[windrel] - standard_name = relative_wind_speed_at_lowest_model_layer - long_name = relative wind speed at lowest model level - units = m s-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys [prsl1] standard_name = air_pressure_at_surface_adjacent_layer long_name = Model layer 1 mean pressure From c6ba923815172c07652e0c0536dea9628bb10d08 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Fri, 1 Dec 2023 18:32:56 +0000 Subject: [PATCH 104/249] "Add GF convective transport & wet removal of smoke/dust" --- physics/cu_gf_deep.F90 | 256 +++++++++++++++++++++++++++++---- physics/cu_gf_driver.F90 | 22 ++- physics/cu_gf_driver.meta | 38 +++++ physics/cu_gf_driver_post.F90 | 11 +- physics/cu_gf_driver_post.meta | 44 ++++++ physics/cu_gf_driver_pre.F90 | 10 ++ physics/cu_gf_driver_pre.meta | 44 ++++++ 7 files changed, 395 insertions(+), 30 deletions(-) diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index 0d1fc68c7..ab72c662c 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -3,6 +3,7 @@ module cu_gf_deep use machine , only : kind_phys + use physcons, only : qamin real(kind=kind_phys), parameter::g=9.81 real(kind=kind_phys), parameter:: cp=1004. real(kind=kind_phys), parameter:: xlv=2.5e6 @@ -124,6 +125,11 @@ subroutine cu_gf_deep_run( & ,frh_out & ! fractional coverage ,ierr & ! ierr flags are error flags, used for debugging ,ierrc & ! the following should be set to zero if not available + ,nchem & + ,fscav & + ,chem3d & + ,wetdpc_deep & + ,do_smoke_transport & ,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist ,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist ,rand_clos & ! for stochastics closures, if temporal and spatial patterns exist @@ -144,7 +150,7 @@ subroutine cu_gf_deep_run( & ,intent (in ) :: & nranflag,itf,ktf,its,ite, kts,kte,ipr,imid integer, intent (in ) :: & - ichoice + ichoice,nchem real(kind=kind_phys), dimension (its:ite,4) & ,intent (in ) :: rand_clos real(kind=kind_phys), dimension (its:ite) & @@ -163,17 +169,17 @@ subroutine cu_gf_deep_run( & ! outq = output q tendency (per s) ! outqc = output qc tendency (per s) ! pre = output precip - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:ite,kts:kte) & ,intent (inout ) :: & cnvwt,outu,outv,outt,outq,outqc,cupclw - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:ite) & ,intent (out ) :: & frh_out - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:ite) & ,intent (inout ) :: & pre,xmb_out !$acc declare copy(cnvwt,outu,outv,outt,outq,outqc,cupclw,frh_out,pre,xmb_out) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:ite) & ,intent (in ) :: & hfx,qfx,xmbm_in,xmbs_in !$acc declare copyin(hfx,qfx,xmbm_in,xmbs_in) @@ -190,29 +196,35 @@ subroutine cu_gf_deep_run( & ! omega (omeg), windspeed (us,vs), and a flag (ierr) to turn off ! convection for this call only and at that particular gridpoint ! - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:ite,kts:kte) & ,intent (in ) :: & dhdt,rho,t,po,us,vs,tn !$acc declare copyin(dhdt,rho,t,po,us,vs,tn) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:ite,kts:kte) & ,intent (inout ) :: & omeg !$acc declare copy(omeg) - real(kind=kind_phys), dimension (its:ite,kts:kte) & + real(kind=kind_phys), dimension (its:ite,kts:kte) & ,intent (inout) :: & q,qo,zuo,zdo,zdm !$acc declare copy(q,qo,zuo,zdo,zdm) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:ite) & ,intent (in ) :: & dx,z1,psur,xland !$acc declare copyin(dx,z1,psur,xland) - real(kind=kind_phys), dimension (its:ite) & + real(kind=kind_phys), dimension (its:ite) & ,intent (inout ) :: & mconv,ccn !$acc declare copy(mconv,ccn) + real(kind=kind_phys), dimension (its:ite,kts:kte,nchem) & + ,intent (inout) :: & + chem3d + logical, intent (in) :: do_smoke_transport + real(kind=kind_phys), dimension (its:ite,nchem) & + , intent (out) :: wetdpc_deep + real(kind=kind_phys), intent (in) :: fscav(:) - - real(kind=kind_phys) & + real(kind=kind_phys) & ,intent (in ) :: & dtime,ccnclean @@ -220,11 +232,11 @@ subroutine cu_gf_deep_run( & ! ! local ensemble dependent variables in this routine ! - real(kind=kind_phys), dimension (its:ite,1) :: & + real(kind=kind_phys), dimension (its:ite,1) :: & xaa0_ens - real(kind=kind_phys), dimension (its:ite,1) :: & + real(kind=kind_phys), dimension (its:ite,1) :: & edtc - real(kind=kind_phys), dimension (its:ite,kts:kte,1) :: & + real(kind=kind_phys), dimension (its:ite,kts:kte,1) :: & dellat_ens,dellaqc_ens,dellaq_ens,pwo_ens !$acc declare create(xaa0_ens,edtc,dellat_ens,dellaqc_ens,dellaq_ens,pwo_ens) ! @@ -292,8 +304,18 @@ subroutine cu_gf_deep_run( & ! xmb = total base mass flux ! hc = cloud moist static energy ! hkb = moist static energy at originating level - - real(kind=kind_phys), dimension (its:ite,kts:kte) :: & + real(kind=kind_phys), dimension (its:ite,kts:kte,nchem) :: & + chem + real(kind=kind_phys), dimension (its:ite,kts:kte,nchem) :: & + chem_cup,chem_up,chem_down,dellac,dellac2,chem_c,chem_pw,chem_pwd + real(kind=kind_phys), dimension (its:ite,nchem) :: & + chem_pwav,chem_psum + real(kind=kind_phys):: dtime_max,sum1,sum2 + real(kind=kind_phys), dimension (kts:kte) :: trac,trcflx_in,trcflx_out,trc,trco + real(kind=kind_phys), dimension (its:ite,kts:kte) :: pwdper, massflx + integer :: nv + + real(kind=kind_phys), dimension (its:ite,kts:kte) :: & entr_rate_2d,mentrd_rate_2d,he,hes,qes,z, heo,heso,qeso,zo, & xhe,xhes,xqes,xz,xt,xq,qes_cup,q_cup,he_cup,hes_cup,z_cup, & p_cup,gamma_cup,t_cup, qeso_cup,qo_cup,heo_cup,heso_cup, & @@ -330,13 +352,13 @@ subroutine cu_gf_deep_run( & ! xaa0 = cloud work function with cloud effects (ensemble dependent) ! edt = epsilon - real(kind=kind_phys), dimension (its:ite) :: & - edt,edto,edtm,aa1,aa0,xaa0,hkb, & + real(kind=kind_phys), dimension (its:ite) :: & + edt,edto,edtm,aa1,aa0,xaa0,hkb, & hkbo,xhkb, & xmb,pwavo,ccnloss, & pwevo,bu,bud,cap_max, & cap_max_increment,closure_n,psum,psumh,sig,sigd - real(kind=kind_phys), dimension (its:ite) :: & + real(kind=kind_phys), dimension (its:ite) :: & axx,edtmax,edtmin,entr_rate integer, dimension (its:ite) :: & kzdown,kdet,k22,jmin,kstabi,kstabm,k22x,xland1, & @@ -372,10 +394,10 @@ subroutine cu_gf_deep_run( & character*50 :: ierrc(its:ite) character*4 :: cumulus - real(kind=kind_phys), dimension (its:ite,kts:kte) :: & + real(kind=kind_phys), dimension (its:ite,kts:kte) :: & up_massentr,up_massdetr,c1d & ,up_massentro,up_massdetro,dd_massentro,dd_massdetro - real(kind=kind_phys), dimension (its:ite,kts:kte) :: & + real(kind=kind_phys), dimension (its:ite,kts:kte) :: & up_massentru,up_massdetru,dd_massentru,dd_massdetru !$acc declare create(up_massentr,up_massdetr,c1d,up_massentro,up_massdetro,dd_massentro,dd_massdetro, & !$acc up_massentru,up_massdetru,dd_massentru,dd_massdetru) @@ -401,6 +423,7 @@ subroutine cu_gf_deep_run( & real(kind=kind_phys), dimension (its:ite,kts:kte) :: dtempdz integer, dimension (its:ite,kts:kte) :: k_inv_layers real(kind=kind_phys), dimension (its:ite) :: c0 ! HCB + real(kind=kind_phys), dimension (its:ite,kts:kte) :: c0t3d ! hli for smoke/dust wet scavenging !$acc declare create(pmin_lev,start_level,ktopkeep,dtempdz,k_inv_layers,c0) ! rainevap from sas @@ -1058,14 +1081,14 @@ subroutine cu_gf_deep_run( & if(imid.eq.1)then call cup_up_moisture('mid',ierr,zo_cup,qco,qrco,pwo,pwavo, & p_cup,kbcon,ktop,dbyo,clw_all,xland1, & - qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0, & + qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0,c0t3d, & zqexec,ccn,ccnclean,rho,c1d,tn_cup,autoconv,up_massentr,up_massdetr,psum,psumh, & 1,itf,ktf, & its,ite, kts,kte) else call cup_up_moisture('deep',ierr,zo_cup,qco,qrco,pwo,pwavo, & p_cup,kbcon,ktop,dbyo,clw_all,xland1, & - qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0, & + qo,gammao_cup,zuo,qeso_cup,k22,qo_cup,c0,c0t3d, & zqexec,ccn,ccnclean,rho,c1d,tn_cup,autoconv,up_massentr,up_massdetr,psum,psumh, & 1,itf,ktf, & its,ite, kts,kte) @@ -2013,6 +2036,185 @@ subroutine cu_gf_deep_run( & kts,kte,ierr,kbcon,xmb,psur,xland,qo_cup, & po_cup,qes_cup,pwavo,edto,pwevo,pre,outt,outq) !,outbuoy) +! +! +!>- atmospheric composition tracers +! +!> ## Determine whether to perform aerosol transport + if (do_smoke_transport .and. nchem > 0) then +! +! initialize tracers if they exist +! + chem (:,:,:) = 0. + do nv = 1,nchem + do k = 1, ktf + do i = 1, itf + chem(i,k,nv) = max(qamin, chem3d(i,k,nv)) + enddo + enddo + enddo + + wetdpc_deep = 0. + + chem_pwav(:,:) = 0. + chem_psum(:,:) = 0. + chem_pw (:,:,:) = 0. + chem_pwd (:,:,:) = 0. + pwdper (:,:) = 0. + chem_down(:,:,:) = 0. + chem_up (:,:,:) = 0. + chem_c (:,:,:) = 0. + chem_cup (:,:,:) = 0. + + do i=its,itf + if(ierr(i).eq.0)then + do k=kts,jmin(i) + pwdper(i,k)=-edtc(i,1)*pwdo(i,k)/pwavo(i) + enddo + pwdper(i,:)=0. + do nv=1,nchem + do k=kts+1,ktf + chem_cup(i,k,nv)=.5*(chem(i,k-1,nv)+chem(i,k,nv)) + enddo + chem_cup(i,kts,nv)=chem(i,kts,nv) +! +! in updraft +! + do k=1,k22(i) + chem_up(i,k,nv)=chem_cup(i,k,nv) + enddo + do k=k22(i)+1,ktop(i) + chem_up(i,k,nv)=(chem_up(i,k-1,nv)*zuo(i,k-1) & + -.5*up_massdetr(i,k-1)*chem_up(i,k-1,nv)+ & + up_massentr(i,k-1)*chem(i,k-1,nv)) / & + (zuo(i,k-1)-.5*up_massdetr(i,k-1)+up_massentr(i,k-1)) + chem_c(i,k,nv)=fscav(nv)*chem_up(i,k,nv) + dz=zo_cup(i,K)-zo_cup(i,K-1) + trash2=chem_up(i,k,nv)-chem_c(i,k,nv) + trash=chem_c(i,k,nv)/(1.+c0t3d(i,k)*dz) + chem_pw=c0t3d(i,k)*dz*trash*zuo(i,k) + chem_up(i,k,nv)=trash2+trash +! chem_pw(i,k,nv)=min(chem_up(i,k,nv),chem_c(i,k,nv)*pwo(i,k)/zuo(i,k)/(1.e-8+qrco(i,k))) +! chem_up(i,k,nv)=chem_up(i,k,nv)-chem_pw(i,k,nv) + chem_pwav(i,nv)=chem_pwav(i,nv)+chem_pw(i,k,nv)! *g/dp + enddo + do k=ktop(i)+1,ktf + chem_up(i,k,nv)=chem_cup(i,k,nv) + enddo +! +! in downdraft +! + chem_down(i,jmin(i)+1,nv)=chem_cup(i,jmin(i)+1,nv) + chem_psum(i,nv)=0. + do ki=jmin(i),2,-1 + dp=100.*(po_cup(i,ki)-po_cup(i,ki+1)) + chem_down(i,ki,nv)=(chem_down(i,ki+1,nv)*zdo(i,ki+1) & + -.5*dd_massdetro(i,ki)*chem_down(i,ki+1,nv)+ & + dd_massentro(i,ki)*chem(i,ki,nv)) / & + (zdo(i,ki+1)-.5*dd_massdetro(i,ki)+dd_massentro(i,ki)) + chem_down(i,ki,nv)=chem_down(i,ki,nv)+pwdper(i,ki)*chem_pwav(i,nv) + chem_pwd(i,ki,nv)=max(0.,pwdper(i,ki)*chem_pwav(i,nv)) + enddo +! total wet deposition + do k=1,ktf-1 + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + chem_psum(i,nv)=chem_psum(i,nv)+chem_pw(i,k,nv)*g !/dp + enddo + chem_psum(i,nv)=chem_psum(i,nv)*xmb(i)*dtime +! + enddo ! nchem + endif ! ierr=0 + enddo ! i + + dellac(:,:,:)=0. + + do nv=1,nchem + do i=its,itf + if(ierr(i).eq.0)then + dp=100.*(po_cup(i,1)-po_cup(i,2)) + dellac(i,1,nv)=dellac(i,1,nv)+(edto(i)*zdo(i,2)*chem_down(i,2,nv))*g/dp*xmb(i) + if(k22(i).eq.2)then + entupk=zuo(i,2) + dellac(i,1,nv)=dellac(i,1,nv)-entupk*chem_cup(i,2,nv)*g/dp*xmb(i) + endif + do k=kts+1,ktop(i)-1 + detup=0. + detdo=0. + entup=0. + entdo=0. + entdoj=0. + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + ! entrainment/detrainment for updraft + entdo=edto(i)*dd_massentro(i,k)*chem(i,k,nv) + detdo=edto(i)*dd_massdetro(i,k)*.5*(chem_down(i,k+1,nv)+chem_down(i,k,nv)) + entup=up_massentro(i,k)*chem(i,k,nv) + detup=up_massdetro(i,k)*.5*(chem_up(i,k+1,nv)+chem_up(i,k,nv)) + ! special levels + if(k == k22(i)-1) then + entup=zuo(i,k+1)*chem_cup(i,k+1,nv) + detup=0. + endif + if(k.eq.jmin(i))entdoj=edto(i)*zdo(i,k)*chem_cup(i,k,nv) +! mass budget + dellac(i,k,nv) =dellac(i,k,nv) + (detup+detdo-entdo-entup-entdoj)*g/dp*xmb(i) + enddo + dellac(i,ktop(i),nv)=zuo(i,ktop(i))*chem_up(i,ktop(i),nv)*g/dp*xmb(i) + endif ! ierr + enddo ! i + enddo ! nchem loop + +! fct for subsidence + dellac2(:,:,:)=0. + massflx(:,:)=0. + do nv=1,nchem + do i=its,itf + if(ierr(i).eq.0)then + trcflx_in(:)=0. + dtime_max=dtime + +! initialize fct routine + do k=kts,ktop(i) + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + dtime_max=min(dtime_max,.5*dp) + massflx(i,k)=-xmb(i)*(zuo(i,k)-edto(i)*zdo(i,k)) + trcflx_in(k)=massflx(i,k)*chem_cup(i,k,nv) + enddo + trcflx_in(1)=0. + massflx(i,1)=0. + call fct1d3(ktop(i),kte,dtime_max,po_cup(i,:),chem(i,:,nv),massflx(i,:), & + trcflx_in,dellac2(i,:,nv),g) + do k=kts,ktop(i) + trash=chem (i,k,nv) + chem (i,k,nv)=chem (i,k,nv) + (dellac(i,k,nv)+dellac2(i,k,nv))*dtime + if(chem(i,k,nv).lt.qamin)then + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + wetdpc_deep(i,nv)=wetdpc_deep(i,nv)+(qamin-chem(i,k,nv))*dp/g/dtime + chem(i,k,nv)=qamin + endif + enddo + endif + + enddo ! i + enddo ! nchem loop + +!> - Store aerosol concentrations if present + do nv = 1, nchem + do i = 1, itf + do k = 1, ktf + if(ierr(i).eq.0) then + if (k <= ktop(i)) then + dp=100.*(po_cup(i,k)-po_cup(i,k+1)) + wetdpc_deep(i,nv)=wetdpc_deep(i,nv) + ((chem3d(i,k,nv)-chem(i,k,nv))*dp/(g*dtime)) + chem3d(i,k,nv) = chem(i,k,nv) + endif + endif + enddo + wetdpc_deep(i,nv)=max(wetdpc_deep(i,nv),qamin) + enddo + enddo + + endif ! nchem > 0 + k=1 !$acc kernels do i=its,itf @@ -4101,7 +4303,7 @@ end subroutine cup_output_ens_3d !> Calculates moisture properties of the updraft. subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & p_cup,kbcon,ktop,dby,clw_all,xland1, & - q,gamma_cup,zu,qes_cup,k22,qe_cup,c0, & + q,gamma_cup,zu,qes_cup,k22,qe_cup,c0,c0t3d, & zqexec,ccn,ccnclean,rho,c1d,t,autoconv, & up_massentr,up_massdetr,psum,psumh, & itest,itf,ktf, & @@ -4137,6 +4339,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & real(kind=kind_phys), dimension (its:ite) & ,intent (in ) :: & zqexec,c0 + real(kind=kind_phys), dimension (its:ite,kts:kte), intent (out) :: c0t3d ! entr= entrainment rate integer, dimension (its:ite) & ,intent (in ) :: & @@ -4218,6 +4421,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & c0_iceconv=0.01 c1d_b=c1d bdsp(:)=bdispm + c0t3d = 0. ! !--- no precip for small clouds @@ -4288,6 +4492,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & else c0t = c0(i) * exp(c0_iceconv * (t(i,k) - 273.16)) endif + c0t3d(i,k)=c0t qc(i,k)= (qc(i,k-1)*zu(i,k-1)-.5*up_massdetr(i,k-1)* qc(i,k-1)+ & up_massentr(i,k-1)*q(i,k-1)) / & (zu(i,k-1)-.5*up_massdetr(i,k-1)+up_massentr(i,k-1)) @@ -4320,6 +4525,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & c0t = c0(i) * exp(c0_iceconv * (t(i,k) - 273.16)) endif if(is_mid)c0t=0.004 + c0t3d(i,k)=c0t if(autoconv .gt.1) c0t=c0(i) denom=zu(i,k-1)-.5*up_massdetr(i,k-1)+up_massentr(i,k-1) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index d85b7ac52..d8bc11629 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -67,8 +67,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& fhour,fh_dfi_radar,ix_dfi_radar,num_dfi_radar,cap_suppress, & dfi_radar_max_intervals,ldiag3d,qci_conv,do_cap_suppress, & maxupmf,maxMF,do_mynnedmf,ichoice_in,ichoicem_in,ichoice_s_in, & - spp_cu_deep,spp_wts_cu_deep, & - errmsg,errflg) + spp_cu_deep,spp_wts_cu_deep,nchem,chem3d,fscav,wetdpc_deep, & + do_smoke_transport,errmsg,errflg) !------------------------------------------------------------- implicit none integer, parameter :: maxiens=1 @@ -86,7 +86,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& & spp_wts_cu_deep real(kind=kind_phys) :: spp_wts_cu_deep_tmp - logical, intent(in) :: do_cap_suppress + logical, intent(in) :: do_cap_suppress, do_smoke_transport real(kind=kind_phys), parameter :: aodc0=0.14 real(kind=kind_phys), parameter :: aodreturn=30. real(kind=kind_phys) :: dts,fpi,fp @@ -94,7 +94,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer, parameter :: dicycle_m=0 !- diurnal cycle flag integer :: ishallow_g3 ! depend on imfshalcnv !------------------------------------------------------------- - integer :: its,ite, jts,jte, kts,kte + integer :: its,ite, jts,jte, kts,kte, nchem integer, intent(in ) :: im,km,ntracer integer, intent(in ) :: ichoice_in,ichoicem_in,ichoice_s_in logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf @@ -154,6 +154,9 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer, intent(in ) :: imfshalcnv integer, dimension(:), intent(inout) :: cactiv,cactiv_m + real(kind_phys), dimension(:), intent(in) :: fscav + real(kind_phys), dimension(:,:,:), intent(inout) :: chem3d + real(kind_phys), dimension(:,:), intent(inout) :: wetdpc_deep !$acc declare copy(cactiv,cactiv_m) character(len=*), intent(out) :: errmsg @@ -179,6 +182,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& real(kind=kind_phys), dimension (im) :: tau_ecmwf,edt,edtm,edtd,ter11,aa0,xlandi real(kind=kind_phys), dimension (im) :: pret,prets,pretm,hexec real(kind=kind_phys), dimension (im,10) :: forcing,forcing2 + real(kind=kind_phys), dimension (im,nchem) :: wetdpc_mid integer, dimension (im) :: kbcon, ktop,ierr,ierrs,ierrm,kpbli integer, dimension (im) :: k22s,kbcons,ktops,k22,jmin,jminm @@ -743,6 +747,11 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,frhm & ,ierrm & ,ierrcm & + ,nchem & + ,fscav & + ,chem3d & + ,wetdpc_mid & + ,do_smoke_transport & ! the following should be set to zero if not available ,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist ,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist @@ -825,6 +834,11 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,frhd & ,ierr & ,ierrc & + ,nchem & + ,fscav & + ,chem3d & + ,wetdpc_deep & + ,do_smoke_transport & ! the following should be set to zero if not available ,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist ,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index 08e9de201..d6d874f7e 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -612,6 +612,44 @@ dimensions = () type = integer intent = in +[nchem] + standard_name = number_of_chemical_species_vertically_mixed + long_name = number of chemical vertically mixed + units = count + dimensions = () + type = integer + intent = in +[chem3d] + standard_name = chem3d_mynn_pbl_transport + long_name = mynn pbl transport of smoke and dust + units = various + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_chemical_species_vertically_mixed) + type = real + kind = kind_phys + intent = inout +[fscav] + standard_name = smoke_dust_conv_wet_coef + long_name = smoke dust convetive wet scavanging coefficents + units = none + dimensions = (3) + type = real + kind = kind_phys + intent = in +[do_smoke_transport] + standard_name = do_smoke_conv_transport + long_name = flag for rrfs smoke convective transport + units = flag + dimensions = () + type = logical + intent = in +[wetdpc_deep] + standard_name = conv_wet_deposition_smoke_dust + long_name = convective wet removal of smoke and dust + units = kg kg-1 + dimensions = (horizontal_loop_extent,number_of_chemical_species_vertically_mixed) + type = real + kind = kind_phys + intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/cu_gf_driver_post.F90 b/physics/cu_gf_driver_post.F90 index 111bf0863..1700fbde9 100644 --- a/physics/cu_gf_driver_post.F90 +++ b/physics/cu_gf_driver_post.F90 @@ -15,7 +15,7 @@ module cu_gf_driver_post !> \section arg_table_cu_gf_driver_post_run Argument Table !! \htmlinclude cu_gf_driver_post_run.html !! - subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m, conv_act, conv_act_m, errmsg, errflg) + subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m, conv_act, conv_act_m, rrfs_sd, ntsmoke, ntdust, ntcoarsepm, chem3d, gq0, errmsg, errflg) use machine, only: kind_phys @@ -31,6 +31,9 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m integer, intent(in) :: cactiv_m(:) real(kind_phys), intent(out) :: conv_act(:) real(kind_phys), intent(out) :: conv_act_m(:) + logical, intent(in) :: rrfs_sd + integer, intent(in) :: ntsmoke, ntdust, ntcoarsepm + real(kind_phys), intent(inout) :: chem3d(:,:,:), gq0(:,:,:) character(len=*), intent(out) :: errmsg !$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m) integer, intent(out) :: errflg @@ -60,6 +63,12 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m enddo !$acc end kernels + if (rrfs_sd) then + gq0(:,:,ntsmoke ) = chem3d(:,:,1) + gq0(:,:,ntdust ) = chem3d(:,:,2) + gq0(:,:,ntcoarsepm) = chem3d(:,:,3) + endif + end subroutine cu_gf_driver_post_run end module cu_gf_driver_post diff --git a/physics/cu_gf_driver_post.meta b/physics/cu_gf_driver_post.meta index 6c6ceeb66..4c04224dc 100644 --- a/physics/cu_gf_driver_post.meta +++ b/physics/cu_gf_driver_post.meta @@ -83,6 +83,34 @@ type = real kind = kind_phys intent = out +[rrfs_sd] + standard_name = do_smoke_coupling + long_name = flag controlling rrfs_sd collection (default off) + units = flag + dimensions = () + type = logical + intent = in +[ntsmoke] + standard_name = index_for_smoke_in_tracer_concentration_array + long_name = tracer index for smoke + units = index + dimensions = () + type = integer + intent = in +[ntdust] + standard_name = index_for_dust_in_tracer_concentration_array + long_name = tracer index for dust + units = index + dimensions = () + type = integer + intent = in +[ntcoarsepm] + standard_name = index_for_coarse_particulate_matter_in_tracer_concentration_array + long_name = tracer index for coarse particulate matter + units = index + dimensions = () + type = integer + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -91,6 +119,22 @@ type = character kind = len=* intent = out +[chem3d] + standard_name = chem3d_mynn_pbl_transport + long_name = mynn pbl transport of smoke and dust + units = various + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_chemical_species_vertically_mixed) + type = real + kind = kind_phys + intent = inout +[gq0] + standard_name = tracer_concentration_of_new_state + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout [errflg] standard_name = ccpp_error_code long_name = error code for error handling in CCPP diff --git a/physics/cu_gf_driver_pre.F90 b/physics/cu_gf_driver_pre.F90 index 98cc76b95..6be7b8aec 100644 --- a/physics/cu_gf_driver_pre.F90 +++ b/physics/cu_gf_driver_pre.F90 @@ -17,6 +17,7 @@ module cu_gf_driver_pre !! subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, prevst, prevsq, & forcet, forceq, cactiv, cactiv_m, conv_act, conv_act_m, & + rrfs_sd, ntsmoke, ntdust, ntcoarsepm, chem3d, gq0, & errmsg, errflg) use machine, only: kind_phys @@ -25,6 +26,7 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, logical, intent(in) :: flag_init logical, intent(in) :: flag_restart + logical, intent(in) :: rrfs_sd integer, intent(in) :: kdt real(kind_phys), intent(in) :: fhour real(kind_phys), intent(in) :: dtp @@ -37,9 +39,11 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, real(kind_phys), intent(out) :: forceq(:,:) integer, intent(out) :: cactiv(:) integer, intent(out) :: 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(:,:,:) !$acc declare copyin(conv_act,conv_act_m) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -79,6 +83,12 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, cactiv_m(:)=nint(conv_act_m(:)) !$acc end kernels + if (rrfs_sd) then + chem3d(:,:,1) = gq0(:,:,ntsmoke) + chem3d(:,:,2) = gq0(:,:,ntdust) + chem3d(:,:,3) = gq0(:,:,ntcoarsepm) + endif + end subroutine cu_gf_driver_pre_run end module cu_gf_driver_pre diff --git a/physics/cu_gf_driver_pre.meta b/physics/cu_gf_driver_pre.meta index 7fd66d19b..6d8787d06 100644 --- a/physics/cu_gf_driver_pre.meta +++ b/physics/cu_gf_driver_pre.meta @@ -122,6 +122,50 @@ type = real kind = kind_phys intent = in +[rrfs_sd] + standard_name = do_smoke_coupling + long_name = flag controlling rrfs_sd collection (default off) + units = flag + dimensions = () + type = logical + intent = in +[ntsmoke] + standard_name = index_for_smoke_in_tracer_concentration_array + long_name = tracer index for smoke + units = index + dimensions = () + type = integer + intent = in +[ntdust] + standard_name = index_for_dust_in_tracer_concentration_array + long_name = tracer index for dust + units = index + dimensions = () + type = integer + intent = in +[ntcoarsepm] + standard_name = index_for_coarse_particulate_matter_in_tracer_concentration_array + long_name = tracer index for coarse particulate matter + units = index + dimensions = () + type = integer + intent = in +[chem3d] + standard_name = chem3d_mynn_pbl_transport + long_name = mynn pbl transport of smoke and dust + units = various + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_chemical_species_vertically_mixed) + type = real + kind = kind_phys + intent = inout +[gq0] + standard_name = tracer_concentration_of_new_state + long_name = tracer concentration updated by physics + units = kg kg-1 + dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) + type = real + kind = kind_phys + intent = inout [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 55427235fbf67a9d55bf5dca5b63e9b5d1f884bd Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Sun, 3 Dec 2023 00:21:15 +0000 Subject: [PATCH 105/249] "update for RRFS-SD code freeze" --- physics/smoke_dust/coarsepm_settling_mod.F90 | 12 +- physics/smoke_dust/dep_data_mod.F90 | 193 +++++ physics/smoke_dust/dep_dry_mod_emerson.F90 | 431 +++++++++++ ...dep_dry_mod.F90 => dep_dry_simple_mod.F90} | 22 +- physics/smoke_dust/dust_fengsha_mod.F90 | 9 +- physics/smoke_dust/module_add_emiss_burn.F90 | 313 +++----- physics/smoke_dust/module_plumerise1.F90 | 33 +- physics/smoke_dust/module_smoke_plumerise.F90 | 14 +- physics/smoke_dust/module_wetdep_ls.F90 | 17 +- physics/smoke_dust/plume_data_mod.F90 | 2 +- physics/smoke_dust/rrfs_smoke_config.F90 | 66 +- physics/smoke_dust/rrfs_smoke_postpbl.meta | 3 +- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 728 +++++++++++------- physics/smoke_dust/rrfs_smoke_wrapper.meta | 423 +++++----- 14 files changed, 1529 insertions(+), 737 deletions(-) create mode 100755 physics/smoke_dust/dep_data_mod.F90 create mode 100755 physics/smoke_dust/dep_dry_mod_emerson.F90 rename physics/smoke_dust/{dep_dry_mod.F90 => dep_dry_simple_mod.F90} (75%) diff --git a/physics/smoke_dust/coarsepm_settling_mod.F90 b/physics/smoke_dust/coarsepm_settling_mod.F90 index 9061840c3..49f229453 100755 --- a/physics/smoke_dust/coarsepm_settling_mod.F90 +++ b/physics/smoke_dust/coarsepm_settling_mod.F90 @@ -8,7 +8,7 @@ module coarsepm_settling_mod CONTAINS -SUBROUTINE coarsepm_settling_driver(dt,t_phy,rel_hum, & +SUBROUTINE coarsepm_settling_driver(dt,t_phy, & chem,rho_phy,dz8w,p8w,p_phy,sedim, & area,g,num_chem, & ids,ide, jds,jde, kds,kde, & @@ -24,7 +24,7 @@ SUBROUTINE coarsepm_settling_driver(dt,t_phy,rel_hum, & its,ite, jts,jte, kts,kte REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ),INTENT(INOUT ) :: chem REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), & - INTENT(IN ) :: t_phy,p_phy,dz8w,p8w,rho_phy,rel_hum + INTENT(IN ) :: t_phy,p_phy,dz8w,p8w,rho_phy REAL(kind_phys), DIMENSION( ims:ime , jms:jme ),INTENT(IN ) :: area REAL(kind_phys), INTENT(IN ) :: dt,g @@ -64,7 +64,7 @@ SUBROUTINE coarsepm_settling_driver(dt,t_phy,rel_hum, & airmas(1,1,kk)=-(p8w(i,k+1,j)-p8w(i,k,j))*area(i,j)/g airden(1,1,kk)=rho_phy(i,k,j) tmp(1,1,kk)=t_phy(i,k,j) - rh(1,1,kk) = rel_hum(i,k,j) ! hli +! rh(1,1,kk) = rel_hum(i,k,j) ! hli do nv = 1, num_chem chem_before(i,j,k,nv) = chem(i,k,j,nv) enddo @@ -82,7 +82,7 @@ SUBROUTINE coarsepm_settling_driver(dt,t_phy,rel_hum, & call settling(1, 1, lmx, 1,g,dyn_visc, & dust, tmp, p_mid, delz, airmas, & - den_dust, reff_dust, dt, bstl_dust, rh, idust, airden) + den_dust, reff_dust, dt, bstl_dust, idust, airden) kk = 0 do k = kts,kte @@ -111,7 +111,7 @@ END SUBROUTINE coarsepm_settling_driver subroutine settling(imx,jmx, lmx, nmx,g0,dyn_visc, & tc, tmp, p_mid, delz, airmas, & - den, reff, dt, bstl, rh, idust, airden) + den, reff, dt, bstl, idust, airden) ! **************************************************************************** ! * * ! * Calculate the loss by settling, using an implicit method * @@ -131,7 +131,7 @@ subroutine settling(imx,jmx, lmx, nmx,g0,dyn_visc, & INTEGER :: ntdt REAL(kind_phys), INTENT(IN) :: dt,g0,dyn_visc REAL(kind_phys), INTENT(IN) :: tmp(imx,jmx,lmx), delz(imx,jmx,lmx), & - airmas(imx,jmx,lmx), rh(imx,jmx,lmx), & + airmas(imx,jmx,lmx), & den(nmx), reff(nmx),p_mid(imx,jmx,lmx),& airden(imx,jmx,lmx) REAL(kind_phys), INTENT(INOUT) :: tc(imx,jmx,lmx,nmx) diff --git a/physics/smoke_dust/dep_data_mod.F90 b/physics/smoke_dust/dep_data_mod.F90 new file mode 100755 index 000000000..bf9ae7f0c --- /dev/null +++ b/physics/smoke_dust/dep_data_mod.F90 @@ -0,0 +1,193 @@ +!>\file dep_data_mod.F90 +!! This file contains data for the dry deposition modules. +module dep_data_mod + + use machine , only : kind_phys + + integer, parameter :: nvegtype = 25 + real(kind_phys), dimension(nvegtype), parameter :: & + kpart = (/500., 500., 500., 500., 500., & + 500., 500., 500., 500., 500., & + 500., 500., 500., 500., 500., & + 500., 500., 500., 500., 500., & + 500., 500., 500., 500., 500. /) + real(kind_phys), parameter :: max_dep_vel = 0.005 ! m/s (may need to set per species) + real(kind_phys), parameter :: dep_ref_hgt = 2.0 ! Meters + real(kind_phys), parameter :: pi = 3.1415926536 +! 3*PI + REAL(kind_phys), PARAMETER :: threepi=3.0*pi + real(kind_phys), parameter :: gravity = 9.81 +! mean gravitational acceleration [ m/sec**2 ] + REAL(kind_phys), PARAMETER :: grav=9.80622 + real(kind_phys), parameter :: boltzmann = 1.3807e-16 +! universal gas constant [ J/mol-K ] + REAL(kind_phys), PARAMETER :: rgasuniv=8.314510 +! Avogadro's Constant [ 1/mol ] + REAL, PARAMETER :: avo=6.0221367E23 + ! Boltzmann's Constant [ J / K ]i\ + REAL(kind_phys), PARAMETER :: boltz=rgasuniv/avo + real(kind_phys), parameter :: Cb = 2., Cim = 0.4, alpha = 0.8, Cin = 2.5, vv = 0.8 + real(kind_phys), parameter :: A_for = 0.1 ! forest + real(kind_phys), parameter :: A_grs = 0.2 ! grass + real(kind_phys), parameter :: A_wat = 100. ! water + real(kind_phys), parameter :: eps0_for = 0.8*0.01 ! forest + real(kind_phys), parameter :: eps0_grs = 0.4*0.01 ! grass + real(kind_phys), parameter :: eps0_wat = 0.6*0.01 ! water + + REAL(kind_phys), PARAMETER :: one3=1.0/3.0 + REAL(kind_phys), PARAMETER :: two3=2.0/3.0 +! SQRT( 2 ) + REAL(kind_phys), PARAMETER :: sqrt2=1.4142135623731 +! SQRT( PI ) + REAL(kind_phys), PARAMETER :: sqrtpi=1.7724539 + REAL(kind_phys) :: karman = 0.4 ! von Karman constant + REAL(kind_phys), PARAMETER :: conmin= 1.E-16 + REAL(kind_phys), PARAMETER :: pirs=3.14159265358979324 + REAL(kind_phys), PARAMETER :: f6dpi=6.0/pirs + REAL(kind_phys), PARAMETER :: f6dpim9=1.0E-9*f6dpi + REAL(kind_phys), PARAMETER :: rhosmoke = 1.4E3 + REAL(kind_phys), PARAMETER :: rhodust = 2.6E3 + REAL(kind_phys), PARAMETER :: smokefac=f6dpim9/rhosmoke + REAL(kind_phys), PARAMETER :: dustfac=f6dpim9/rhodust +! starting standard surface temperature [ K ] + REAL(kind_phys), PARAMETER :: tss0=288.15 + REAL(kind_phys), PARAMETER :: sigma1 = 1.8 + REAL(kind_phys), PARAMETER :: mean_diameter1 = 4.e-8 + REAL(kind_phys), PARAMETER :: fact_wfa = 1.e-9*6.0/pirs*exp(4.5*log(sigma1)**2)/mean_diameter1**3 + REAL(kind_phys), PARAMETER :: sginia=2.00 +! initial sigma-G for nucleimode + REAL(kind_phys), PARAMETER :: sginin=1.70 +! initial sigma-G for coarse mode + REAL(kind_phys), PARAMETER :: sginic=2.5 +! starting standard surface pressure [ Pa ] + REAL(kind_phys), PARAMETER :: pss0=101325.0 +! lowest particle diameter ( m ) + REAL(kind_phys), PARAMETER :: dgmin=1.0E-09 +! lowest particle density ( Kg/m**3 ) + REAL(kind_phys), PARAMETER :: densmin=1.0E03 +! index for Aitken mode number + INTEGER, PARAMETER :: vdnnuc=1 +! index for accumulation mode number + INTEGER, PARAMETER :: vdnacc=2 +! index for coarse mode number + INTEGER, PARAMETER :: vdncor=3 +! index for Aitken mode mass + INTEGER, PARAMETER :: vdmnuc=4 +! index for accumulation mode + INTEGER, PARAMETER :: vdmacc=5 +! index for fine mode mass (Aitken + accumulation) + INTEGER, PARAMETER :: vdmfine=6 +! index for coarse mode mass + INTEGER, PARAMETER :: vdmcor=7 +! index for Aitken mode number + INTEGER, PARAMETER :: vsnnuc=1 +! index for Accumulation mode number + INTEGER, PARAMETER :: vsnacc=2 +! index for coarse mode number + INTEGER, PARAMETER :: vsncor=3 +! index for Aitken mode mass + INTEGER, PARAMETER :: vsmnuc=4 +! index for accumulation mode mass + INTEGER, PARAMETER :: vsmacc=5 +! index for coarse mass + INTEGER, PARAMETER :: vsmcor=6 +! coarse mode exp( log^2( sigmag )/8 ) +! nuclei **4 + REAL(kind_phys) :: esn04 +! accumulation + REAL(kind_phys) :: esa04 + REAL(kind_phys) :: esc04 +! coarse +! nuclei **5 + REAL(kind_phys) :: esn05 + REAL(kind_phys) :: esa05 +! accumulation +! nuclei **8 + REAL(kind_phys) :: esn08 +! accumulation + REAL(kind_phys) :: esa08 + REAL(kind_phys) :: esc08 +! coarse +! nuclei **9 + REAL(kind_phys) :: esn09 + REAL(kind_phys) :: esa09 +! accumulation +! nuclei **12 + REAL(kind_phys) :: esn12 +! accumulation + REAL(kind_phys) :: esa12 + REAL(kind_phys) :: esc12 +! coarse mode +! nuclei **16 + REAL(kind_phys) :: esn16 +! accumulation + REAL(kind_phys) :: esa16 + REAL(kind_phys) :: esc16 +! coarse +! nuclei **20 + REAL(kind_phys) :: esn20 +! accumulation + REAL(kind_phys) :: esa20 + REAL(kind_phys) :: esc20 +! coarse +! nuclei **25 + REAL(kind_phys) :: esn25 + REAL(kind_phys) :: esa25 +! accumulation +! nuclei **24 + REAL(kind_phys) :: esn24 +! accumulation + REAL(kind_phys) :: esa24 + REAL(kind_phys) :: esc24 +! coarse +! nuclei **28 + REAL(kind_phys) :: esn28 +! accumulation + REAL(kind_phys) :: esa28 + REAL(kind_phys) :: esc28 +! coarse +! nuclei **32 + REAL(kind_phys) :: esn32 +! accumulation + REAL(kind_phys) :: esa32 + REAL(kind_phys) :: esc32 +! coarese +! nuclei **36 + REAL(kind_phys) :: esn36 +! accumulation + REAL(kind_phys) :: esa36 + REAL(kind_phys) :: esc36 +! coarse +! nuclei **49 + REAL(kind_phys) :: esn49 + REAL(kind_phys) :: esa49 +! accumulation +! nuclei **52 + REAL(kind_phys) :: esn52 + REAL(kind_phys) :: esa52 +! accumulation +! nuclei **64 + REAL(kind_phys) :: esn64 +! accumulation + REAL(kind_phys) :: esa64 + REAL(kind_phys) :: esc64 +! coarse + REAL(kind_phys) :: esn100 +! nuclei **100 +! nuclei **(-20) + REAL(kind_phys) :: esnm20 +! accumulation + REAL(kind_phys) :: esam20 + REAL(kind_phys) :: escm20 +! coarse +! nuclei **(-32) + REAL(kind_phys) :: esnm32 +! accumulation + REAL(kind_phys) :: esam32 + REAL(kind_phys) :: escm32 +!SAM 10/08 Gaussian quadrature constants for SOA_VBS deposition numerical +!integration + INTEGER, PARAMETER :: NGAUSdv= 7 ! Number of Gaussian Quadrature Points + REAL(kind_phys) :: xxlsgn, xxlsga, xxlsgc + REAL(kind_phys) :: Y_GQ(NGAUSdv), WGAUS(NGAUSdv) +end module dep_data_mod diff --git a/physics/smoke_dust/dep_dry_mod_emerson.F90 b/physics/smoke_dust/dep_dry_mod_emerson.F90 new file mode 100755 index 000000000..d2d34bb4e --- /dev/null +++ b/physics/smoke_dust/dep_dry_mod_emerson.F90 @@ -0,0 +1,431 @@ +!>\file dep_dry_mod.F90 +!! This file is for the dry depostion driver. +!-------------REVISION HISTORY---------------! +! XX/XX/XXXX : original implementation (Ravan Ahmadov) +! 08/17/2023 : modified to follow Emerson et al., (2020) (Jordan Schnell) +! 08/17/2023 : gravitational settling folowing the coarse pm settling driver (Jordan Schnell) + +module dep_dry_emerson_mod + + use machine , only : kind_phys + use dep_data_mod ! JLS + use rrfs_smoke_config + + implicit none + + private + + public :: dry_dep_driver_emerson + +contains + subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & + chem,delz,snowh,t_phy,p_phy,rho_phy,ivgtyp,g0,dt, & + settling_flag,drydep_flux,settling_flux, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte ) +! +! compute dry deposition velocity for aerosol particles +! Based on Emerson et al. (2020), PNAS, +! www.pnas.org/cgi/doi/10.1073/pnas.2014761117 +! Code adapted from Hee-Ryu and Min, (2022): +! https://agupubs.onlinelibrary.wiley.com/doi/epdf/10.1029/2021MS002792 +!---------------------------------------------------------------------- + IMPLICIT NONE + + INTEGER, INTENT(IN ) :: settling_flag,ndvel, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte + REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) , & + INTENT(INOUT) :: ustar, rmol, znt, snowh + REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), & + INTENT(IN ) :: t_phy, rho_phy, p_phy, delz + INTEGER, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: ivgtyp + REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), & + INTENT(INOUT ) :: chem + REAL(kind_phys), INTENT(IN) :: g0,dt + ! + ! Output arrays + REAL(kind_phys), DIMENSION( ims:ime, jms:jme, ndvel ), INTENT(INOUT) :: ddvel + REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, ndvel), & + INTENT(OUT) :: vgrav + REAL(kind_phys), DIMENSION( ims:ime, jms:jme, ndvel ), INTENT(OUT) :: settling_flux, drydep_flux + ! Local + REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) :: aer_res + REAL(kind_phys), DIMENSION( ndvel ) :: cblk + ! Modpar variables, mass, density, diameter, knudsen number, mean free path + REAL(kind_phys) :: pmasssn,pmassa,pmassc,pdensn,pdensa,pdensc, & + dgnuc,dgacc,dgcor,knnuc,knacc,kncor,xlm + real(kind_phys) :: Cc ! Cunningham/slip correction factor [-] + real(kind_phys) :: DDp, Eb ! Brownian diffusion [] + real(kind_phys) :: Eim ! Impaction [] + real(kind_phys) :: Ein ! Interception [] + real(kind_phys) :: Sc ! Schmit number [] + real(kind_phys) :: St ! Stokes number [] + real(kind_phys) :: vg ! gravitational settling [cm/s] + real(kind_phys) :: A, eps0, dumalnsg ! land surface params [-] + real(kind_phys) :: amu, amu_corrected ! dynamic viscosity [g/s] + real(kind_phys) :: airkinvisc ! Air kinetic viscosity [cm2/s] + real(kind_phys) :: freepath ! Air molecular freepath [cm] + real(kind_phys) :: dp ! aerosol diameter [cm] + real(kind_phys) :: aerodens ! aerosol density [g/cm3] + real(kind_phys) :: Rs ! Surface resistance + real(kind_phys) :: vgpart + real(kind_phys) :: growth_fac,vsettl,dtmax,conver,converi,dzmin + real(kind_phys), dimension( kts:kte) :: rho_col, delz_col + real(kind_phys), dimension(ndvel) :: dt_settl, chem_before, chem_after + real(kind_phys), dimension( kts:kte, ndvel ) :: cblk_col, vg_col + integer, dimension(ndvel) :: ndt_settl + integer :: i, j, k, ntdt, nv + ! chem pointers (p_*) are not sequentially numbered, need to define so nv loops work + integer, dimension(ndvel) :: chem_pointers +!> -- Gas constant + real(kind_phys), parameter :: RSI = 8.314510 + chem_pointers(1) = p_smoke + chem_pointers(2) = p_dust_1 + chem_pointers(3) = p_coarse_pm + + growth_fac = 1.0 + conver=1.e-9 + converi=1.e9 + + do j = jts, jte + do i = its, ite + aer_res(i,j) = 0.0 + do k = kts, kte + delz_col(k) = delz(i,k,j) + rho_col(k) = rho_phy(i,k,j) + do nv = 1, ndvel + cblk(nv) = chem(i,k,j,chem_pointers(nv)) + if ( k == kts ) then + ddvel(i,j,nv) = 0.0 + dt_settl(nv) = 0.0 + endif ! k==kts + end do ! nv + ! *** U.S. Standard Atmosphere 1962 page 14 expression + ! for dynamic viscosity = beta * T * sqrt(T) / ( T + S) + ! where beta = 1.458e-6 [ kg sec^-1 K**-0.5 ], s = 110.4 [ K ]. + amu = 1.458E-6 * t_phy(i,k,j) * sqrt(t_phy(i,k,j)) / ( t_phy(i,k,j) + 110.4 ) + ! Aerodynamic resistance + call depvel( rmol(i,j), dep_ref_hgt, znt(i,j), ustar(i,j), vgpart, aer_res(i,j) ) + ! depvel uses meters, need to convert to s/cm + aer_res(i,j) = max(aer_res(i,j)/100.,0.) + ! Get the aerosol properties dp and aerodens and mean free path (xlm) + ! FOR RRFS-SD, diameters and densities are explicityly defined + !call modpar( cblk,t_phy(i,k,j),p_phy(i,k,j), amu, & + ! pmasssn,pmassa,pmassc,pdensn,pdensa,pdensc, & + ! dgnuc,dgacc,dgcor,knnuc,knacc,kncor,xlm, ndvel ) + ! Air kinematic viscosity (cm^2/s) + airkinvisc = ( 1.8325e-4 * ( 416.16 / ( t_phy(i,k,j) + 120.0 ) ) * & + ( ( t_phy(i,k,j) / 296.16 )**1.5 ) ) / ( rho_phy(i,k,j) / 28.966e3 ) ! Convert density to mol/cm^3 + ! Air molecular freepath (cm) ! Check against XLM from above + freepath = 7.39758e-4 * airkinvisc / sqrt( t_phy(i,k,j) ) + do nv = 1, ndvel + if ( chem_pointers(nv) == p_smoke ) then + dp = 4.E-8 !dgacc + aerodens = 1.4e+3 !pdensa + elseif ( chem_pointers(nv) == p_dust_1) then + dp = 1.E-6 !dgacc + aerodens = 2.6e+3 !pdensa + elseif ( chem_pointers(nv) == p_coarse_pm ) then + dp = 4.5E-6 !dgcor + aerodens = 2.6e+3 !pdensc + else + continue + endif + ! Convert diameter to cm and aerodens to g/cm3 + aerodens = aerodens / 1000. + dp = dp * 1e+2 + ! Cunningham correction factor + Cc = 1. + 2. * freepath / dp * ( 1.257 + 0.4*exp( -0.55 * dp / freepath ) ) + ! Corrected dynamic viscosity (used for settling) + amu_corrected = amu / Cc + ! Gravitational Settling + vg = aerodens * dp * dp * gravity * 100. * Cc / & ! Convert gravity to cm/s^2 + ( 18. * airkinvisc * ( rho_phy(i,k,j) / 28.966e3 ) ) ! Convert density to mol/cm^3 + ! -- Rest of loop for the surface when deposition velocity needs to be cacluated + if ( k == kts ) then + ! Brownian Diffusion + DDp = ( boltzmann * t_phy(i,k,j) ) * Cc / (3. * pi * airkinvisc * ( rho_phy(i,k,j) / 28.966e3 ) * dp) ! Convert density to mol/cm^3 + ! Schmit number + Sc = airkinvisc / DDp + ! Brownian Diffusion + Eb = Cb * Sc**(-0.666666667) + ! Stokes number + St = ( 100. * ustar(i,j) ) * ( 100.* ustar(i,j) ) * vg / airkinvisc / ( gravity * 100.) ! Convert ustar to cm/s, gravity to cm/s^2 + ! Impaction + Eim = Cim * ( St / ( alpha + St ) )**1.7 + ! MODIS type lu, large roughness lengths (e.g., urban or forest) + ! ----------------------------------------------------------------------- + ! *** TO DO -- set A and eps0 for all land surface types *** !!! + ! ----------------------------------------------------------------------- + if ( ivgtyp(i,j) .eq. 13 .or. ivgtyp(i,j) .le. 5 ) then ! Forest + A = A_for + eps0 = eps0_for + else if ( ivgtyp(i,j) .eq. 17 ) then ! water + A = A_wat + eps0 = eps0_wat + else ! otherwise + A = A_grs + eps0 = eps0_grs + end if + ! Set if snow greater than 1 cm +! if ( snowh(i,j) .gt. 0.01 ) then ! snow +! A = A_wat +! eps0 = eps0_wat +! endif + ! Interception + Ein = Cin * ( dp / A )**vv + ! Surface resistance + Rs = 1. / ( ( ustar(i,j) * 100.) * ( Eb + Eim + Ein) * eps0 ) ! Convert ustar to cm/s + ! Compute final ddvel = aer_res + RS, set max at max_dep_vel in dep_data_mod.F[ m/s] + ! The /100. term converts from cm/s to m/s, required for MYNN. + ddvel(i,j,nv) = min( (1. / (aer_res(i,j) + Rs ))/100., max_dep_vel) + drydep_flux(i,j,nv) = chem(i,kts,j,chem_pointers(nv))*p_phy(i,kts,j) / & + (RSI*t_phy(i,kts,j))*ddvel(i,j,nv)*dt*1.E-6 + endif ! k == kts + vgrav(i,k,j,nv) = vg + ! Fill column variables + cblk_col(k,nv) = cblk(nv) + vg_col(k,nv) = vg + enddo ! nv + enddo ! k + ! -- Get necessary info for settling + ! -- Determine the maximum time-step satisying the CFL condition: + dzmin = minval(delz_col) + ntdt=INT(dt) + do nv = 1, ndvel + ! -- NOTE, diameters and densities are NOT converted to cm and g/cm3 like above + ! -- dt_settl calculations (from original coarsepm_settling) + if ( chem_pointers(nv) == p_smoke ) then + dp = 4.E-8 !dgacc + aerodens = 1.4e+3 !pdensa + elseif ( chem_pointers(nv) == p_dust_1) then + dp = 1.E-6 !dgacc + aerodens = 2.6e+3 !pdensa + elseif ( chem_pointers(nv) == p_coarse_pm ) then + dp = 4.5E-6 !dgcor + aerodens = 2.6e+3 !pdensc + else + continue + endif + ! 1.5E-5 = dyn_visc --> dust_data_mod.F90 + vsettl = 2.0 / 9.0 * g0 * aerodens * ( growth_fac * ( 0.5 * dp ))**2.0 / ( 0.5 * 1.5E-5 ) + dtmax = dzmin / vsettl + ndt_settl(nv) = MAX( 1, INT( ntdt /dtmax) ) + ! Limit maximum number of iterations + IF (ndt_settl(nv) > 12) ndt_settl(nv) = 12 + dt_settl(nv) = REAL(ntdt) / REAL(ndt_settl(nv)) + enddo + do nv = 1, ndvel + do k = kts, kte + chem_before(nv) = chem_before(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 + enddo + enddo + ! Perform gravitational settling if desired + if ( settling_flag == 1 ) then + call particle_settling(cblk_col,rho_col,delz_col,vg_col,dt_settl,ndt_settl,ndvel,kts,kte) + endif + ! Put cblk back into chem array + do nv= 1, ndvel + do k = kts, kte + chem(i,k,j,chem_pointers(nv)) = cblk_col(k,nv) + chem_after(nv) = chem_after(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 + enddo ! k + settling_flux(i,j,nv) = settling_flux(i,j,nv) + (chem_before(nv) - chem_after(nv)) ! ug/m2 + enddo ! nv + end do ! j + end do ! i +end subroutine dry_dep_driver_emerson +! +!-------------------------------------------------------------------------------- +! +subroutine depvel( rmol, zr, z0, ustar, vgpart, aer_res ) +!-------------------------------------------------- +! THIS FUNCTION HAS BEEN DESIGNED TO EVALUATE AN UPPER LIMIT +! FOR THE POLLUTANT DEPOSITION VELOCITY AS A FUNCTION OF THE +! SURFACE ROUGHNESS AND METEOROLOGICAL CONDITIONS. +! PROGRAM WRITTEN BY GREGORY J.MCRAE (NOVEMBER 1977) +! Modified by Darrell A. Winner (Feb. 1991) +! by Winfried Seidl (Aug. 1997) +!.....PROGRAM VARIABLES... +! RMOL - RECIPROCAL OF THE MONIN-OBUKHOV LENGTH +! ZR - REFERENCE HEIGHT +! Z0 - SURFACE ROUGHNESS HEIGHT +! USTAR - FRICTION VELOCITY U* +! AER_RES - AERODYNAMIC RESISTANCE +!.....REFERENCES... +! MCRAE, G.J. ET AL. (1983) MATHEMATICAL MODELING OF PHOTOCHEMICAL +! AIR POLLUTION, ENVIRONMENTAL QUALITY LABORATORY REPORT 18, +! CALIFORNIA INSTITUTE OF TECHNOLOGY, PASADENA, CALIFORNIA. +!.....RESTRICTIONS... +! 1. THE MODEL EDDY DIFFUSIVITIES ARE BASED ON MONIN-OBUKHOV +! SIMILARITY THEORY AND SO ARE ONLY APPLICABLE IN THE +! SURFACE LAYER, A HEIGHT OF O(30M). +! 2. ALL INPUT UNITS MUST BE CONSISTENT +! 3. THE PHI FUNCTIONS USED TO CALCULATE THE FRICTION +! VELOCITY U* AND THE POLLUTANT INTEGRALS ARE BASED +! ON THE WORK OF BUSINGER ET AL.(1971). +! 4. THE MOMENTUM AND POLLUTANT DIFFUSIVITIES ARE NOT +! THE SAME FOR THE CASES L<0 AND L>0. +!-------------------------------------------------- +! .. Scalar Arguments .. +!-------------------------------------------------- + REAL(kind_phys), intent(in) :: ustar, z0, zr + REAL(kind_phys), intent(out) :: vgpart, aer_res + REAL(kind_phys), intent(inout) :: rmol +!-------------------------------------------------- +! .. Local Scalars .. +!-------------------------------------------------- + INTEGER :: l + REAL(kind_phys) :: ao, ar, polint, vk +!-------------------------------------------------- +! .. Intrinsic Functions .. +!-------------------------------------------------- + INTRINSIC alog +!-------------------------------------------------- +! Set the von Karman constant +!-------------------------------------------------- + vk = karman +!-------------------------------------------------- +! DETERMINE THE STABILITY BASED ON THE CONDITIONS +! 1/L < 0 UNSTABLE +! 1/L = 0 NEUTRAL +! 1/L > 0 STABLE +!-------------------------------------------------- + if(abs(rmol) < 1.E-6 ) rmol = 0. + IF (rmol<0) THEN + ar = ((1.0-9.0*zr*rmol)**(0.25)+0.001)**2 + ao = ((1.0-9.0*z0*rmol)**(0.25)+0.001)**2 + polint = 0.74*(alog((ar-1.0)/(ar+1.0))-alog((ao-1.0)/(ao+1.0))) + ELSE IF (rmol==0.) THEN + polint = 0.74*alog(zr/z0) + ELSE + polint = 0.74*alog(zr/z0) + 4.7*rmol*(zr-z0) + END IF + vgpart = ustar*vk/polint + aer_res = polint/(karman*max(ustar,1.0e-4)) +end subroutine depvel +! +!-------------------------------------------------------------------------------- +! +subroutine modpar( cblk, blkta, blkprs, amu, & + pmassn,pmassa,pmassc, pdensn,pdensa,pdensc, & + dgnuc,dgacc,dgcor,knnuc,knacc,kncor, xlm,ndvel ) + IMPLICIT NONE + + INTEGER, INTENT(IN) :: ndvel + REAL(kind_phys), DIMENSION(ndvel), INTENT( IN) :: cblk + REAL(kind_phys), INTENT(IN ) :: blkta, blkprs, amu + REAL(kind_phys), INTENT(OUT) :: pmassn,pmassa,pmassc,pdensn,pdensa,pdensc, & + dgnuc,dgacc,dgcor,knnuc,knacc,kncor,xlm +! +! Local + REAL(kind_phys) :: xxlsgn,xxlsga,xxlsgc,l2sginin,l2sginia,l2sginic, & + en1,ea1,ec1,esn04,esa04,esc04, & + esn08,esa08,esc08,esn16,esa16,esc16, & + esn20,esa20,esc20,esn36,esa36,esc36 + REAL(kind_phys), DIMENSION( 6 ) :: nblk ! number densities +! Pointers + INTEGER, PARAMETER :: vnu0 = 1 + INTEGER, PARAMETER :: vac0 = 2 + INTEGER, PARAMETER :: vcorn = 3 + INTEGER, PARAMETER :: vnu3 = 4 + INTEGER, PARAMETER :: vac3 = 5 + INTEGER, PARAMETER :: vcor3 = 6 +! + xxlsgn = log(sginin) + xxlsga = log(sginia) + xxlsgc = log(sginic) + l2sginin = xxlsgn**2 + l2sginia = xxlsga**2 + l2sginic = xxlsgc**2 + en1 = exp(0.125*l2sginin) + ea1 = exp(0.125*l2sginia) + ec1 = exp(0.125*l2sginic) + esn04 = en1**4 + esa04 = ea1**4 + esc04 = ec1**4 + esn08 = esn04*esn04 + esa08 = esa04*esa04 + esc08 = esc04*esc04 + esn16 = esn08*esn08 + esa16 = esa08*esa08 + esc16 = esc08*esc08 + esn20 = esn16*esn04 + esa20 = esa16*esa04 + esc20 = esc16*esc04 + esn36 = esn16*esn20 + esa36 = esa16*esa20 + esc36 = esc16*esc20 +! First step in WRF-Chem is to add together the aitken, accumulation, and coarse modes +! Calculate number densities + nblk(vnu0) = max(conmin,0.0) + nblk(vnu3) = max(conmin,0.0) + nblk(vac0) = max(conmin, (cblk(1)/rhosmoke + cblk(2)/rhodust)*fact_wfa) + nblk(vcorn) = max(conmin, cblk(3)/rhodust*fact_wfa) + nblk(vac3) = max(conmin,smokefac*cblk(2) + dustfac*cblk(1)) ! Accumulation is smoke + fine dust + nblk(vcor3) = max(conmin,dustfac*cblk(3)) +! Dust in coarse + pmassn = max(conmin,0.0) + pmassa = max(conmin,cblk(1) + cblk(2)) + pmassc = max(conmin,cblk(3)) + pdensn = max(conmin,0.0) + pdensa = max(densmin,(f6dpim9*pmassa/nblk(vac3))) + pdensc = max(densmin,(f6dpim9*pmassc/nblk(vcor3))) +! Calculate mean free path + xlm = 6.6328E-8*pss0*blkta/(tss0*blkprs*1.e3) +! Calculate diameters + dgnuc = max(dgmin,0.0) + dgacc = max(dgmin,(nblk(vac3)/(nblk(vac0)*esa36))**one3) + dgcor = max(dgmin,(nblk(vcor3)/(nblk(vcorn)*esc36))**one3) +! Calculate Knudsen numbers + knnuc = 2.0*xlm/dgnuc + knacc = 2.0*xlm/dgacc + kncor = 2.0*xlm/dgcor +end subroutine modpar +! +!-------------------------------------------------------------------------------- +! +subroutine particle_settling(cblk,rho_phy,delz,vg,dt_settl,ndt_settl,ndvel,kts,kte) + IMPLICIT NONE + + INTEGER, INTENT(IN ) :: kts, kte, ndvel + REAL(kind_phys), DIMENSION(kts:kte), INTENT (IN) :: rho_phy, delz + REAL(kind_phys), DIMENSION(kts:kte,ndvel), INTENT(IN) :: vg + REAL(kind_phys), DIMENSION(kts:kte,ndvel), INTENT(INOUT) :: cblk + REAL(kind_phys), DIMENSION(ndvel), INTENT(IN) :: dt_settl + INTEGER, DIMENSION(ndvel), INTENT(IN) :: ndt_settl +! +!--- Local------ + INTEGER :: k,nv,n,l2 + REAL(kind_phys) :: temp_tc, transfer_to_below_level, vd_wrk1 + REAL(kind_phys), DIMENSION(kts:kte) :: delz_flip + + do k = kts,kte + delz_flip(k) = delz(kte-k+kts) + enddo + + do nv = 1, ndvel + do n = 1,ndt_settl(nv) + transfer_to_below_level = 0.0 + do k = kte,kts,-1 + l2 = kte - k + 1 + + temp_tc = cblk(k,nv) + + vd_wrk1 = dt_settl(nv) * vg(k,nv)/100. / delz_flip(l2) ! convert vg to m/s + + cblk(k,nv)= cblk(k,nv) * (1. - vd_wrk1) + transfer_to_below_level + if (k.gt.kts) then + transfer_to_below_level =(temp_tc*vd_wrk1)*((delz_flip(l2) & + *rho_phy(k))/(delz_flip(l2+1)*rho_phy(k-1))) ! [ug/kg] + endif + enddo ! k + enddo ! n + enddo ! nv +end subroutine particle_settling + +! +end module dep_dry_emerson_mod diff --git a/physics/smoke_dust/dep_dry_mod.F90 b/physics/smoke_dust/dep_dry_simple_mod.F90 similarity index 75% rename from physics/smoke_dust/dep_dry_mod.F90 rename to physics/smoke_dust/dep_dry_simple_mod.F90 index ea7dd9963..91e2997c5 100755 --- a/physics/smoke_dust/dep_dry_mod.F90 +++ b/physics/smoke_dust/dep_dry_simple_mod.F90 @@ -1,7 +1,7 @@ -!>\file dep_dry_mod.F90 +!>\file dep_dry_simple_mod.F90 !! This file is for the dry depostion driver. -module dep_dry_mod +module dep_dry_simple_mod use machine , only : kind_phys @@ -9,11 +9,11 @@ module dep_dry_mod private - public :: dry_dep_driver + public :: dry_dep_driver_simple contains - subroutine dry_dep_driver(rmol,ust,ndvel,ddvel,rel_hum, & + subroutine dry_dep_driver_simple(rmol,ust,ndvel,ddvel, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) @@ -26,8 +26,8 @@ subroutine dry_dep_driver(rmol,ust,ndvel,ddvel,rel_hum, & its,ite, jts,jte, kts,kte REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) , & INTENT(INOUT) :: ust, rmol - REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), & - INTENT(IN ) :: rel_hum +! REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), & +! INTENT(IN ) :: rel_hum REAL(kind_phys), PARAMETER :: kpart=500. REAL(kind_phys) :: dvpart @@ -56,14 +56,14 @@ subroutine dry_dep_driver(rmol,ust,ndvel,ddvel,rel_hum, & dvpart = dvpart*(1.+(-300.*rmol(i,j))**0.66667) ENDIF - IF (rel_hum(i,1,j)>0.8) THEN ! HIGH RELATIVE HUMIDITY CORRECTION - dvpart = dvpart*(1.+0.37*exp((rel_hum(i,1,j)-0.8)/0.2)) - END IF +! IF (rel_hum(i,1,j)>0.8) THEN ! HIGH RELATIVE HUMIDITY CORRECTION +! dvpart = dvpart*(1.+0.37*exp((rel_hum(i,1,j)-0.8)/0.2)) +! END IF ddvel(i,j,nv) = MIN(0.50,dvpart) ! m/s enddo enddo enddo -end subroutine dry_dep_driver +end subroutine dry_dep_driver_simple -end module dep_dry_mod +end module dep_dry_simple_mod diff --git a/physics/smoke_dust/dust_fengsha_mod.F90 b/physics/smoke_dust/dust_fengsha_mod.F90 index 1e24c8947..3902d6508 100755 --- a/physics/smoke_dust/dust_fengsha_mod.F90 +++ b/physics/smoke_dust/dust_fengsha_mod.F90 @@ -22,7 +22,7 @@ module dust_fengsha_mod subroutine gocart_dust_fengsha_driver(dt, & chem,rho_phy,smois,p8w,ssm, & - isltyp,vegfra,snowh,xland,area,g,emis_dust, & + isltyp,snowh,xland,area,g,emis_dust, & ust,znt,clay,sand,rdrag,uthr, & num_emis_dust,num_chem,num_soil_layers, & ids,ide, jds,jde, kds,kde, & @@ -37,7 +37,6 @@ subroutine gocart_dust_fengsha_driver(dt, & ! 2d input variables REAL(kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN) :: ssm ! Sediment supply map - REAL(kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN) :: vegfra ! vegetative fraction (-) REAL(kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN) :: snowh ! snow height (m) REAL(kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN) :: xland ! dominant land use type REAL(kind_phys), DIMENSION( ims:ime , jms:jme ), INTENT(IN) :: area ! area of grid cell @@ -141,9 +140,9 @@ subroutine gocart_dust_fengsha_driver(dt, & endif ! limit where there is lots of vegetation - if (vegfra(i,j) .gt. .17) then - ilwi = 0 - endif + !if (sum(vegfra(i,:,j)) .gt. .17) then + ! ilwi = 0 + !endif ! limit where there is snow on the ground if (snowh(i,j) .gt. 0) then diff --git a/physics/smoke_dust/module_add_emiss_burn.F90 b/physics/smoke_dust/module_add_emiss_burn.F90 index 6cdd2e071..70c14c54c 100755 --- a/physics/smoke_dust/module_add_emiss_burn.F90 +++ b/physics/smoke_dust/module_add_emiss_burn.F90 @@ -6,23 +6,16 @@ module module_add_emiss_burn use machine , only : kind_phys use rrfs_smoke_config CONTAINS - subroutine add_emis_burn(dtstep,dz8w,rho_phy,rel_hum, & - chem,julday,gmt,xlat,xlong, & - !luf_igbp,lu_fire1, & - vegtype,vfrac,peak_hr, & - time_int,ebu, & ! RAR - r_q,fhist,ext3d_smoke,ext3d_dust, & - ! nwfa,nifa, & - rainc,rainnc, swdown,smoke_forecast, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) - -! USE module_configure, only: grid_config_rec_type -! USE module_state_description - IMPLICIT NONE + subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & + chem,julday,gmt,xlat,xlong, & + fire_end_hr, peak_hr,time_int, & + coef_bb_dc, fhist, hwp, hwp_prevd, & + swdown,ebb_dcycle, ebu_in, ebu,fire_type,& + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte ) -! TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags + IMPLICIT NONE INTEGER, INTENT(IN ) :: julday, & ids,ide, jds,jde, kds,kde, & @@ -30,193 +23,135 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,rel_hum, & its,ite, jts,jte, kts,kte real(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), & - INTENT(INOUT ) :: chem + INTENT(INOUT ) :: chem ! shall we set num_chem=1 here? real(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme ), & - INTENT(IN) :: ebu - - real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: xlat,xlong, rainc,rainnc,swdown, peak_hr, vfrac - real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(OUT) :: r_q ! RAR: - real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: fhist ! RAR: - real(kind_phys), DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(OUT) :: ext3d_smoke, ext3d_dust ! RAR: - integer, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: vegtype - - real(kind_phys), DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(IN) :: dz8w,rho_phy,rel_hum -! real(kind_phys), DIMENSION(ims:ime,1:nlcat,jms:jme), INTENT(IN) :: luf_igbp - -! real(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ) , & -! OPTIONAL, INTENT(INOUT ) :: nwfa,nifa ! RAR: - - real(kind_phys), INTENT(IN) :: dtstep, gmt - real(kind_phys), INTENT(IN) :: time_int ! RAR: time in seconds since start of simulation - integer, INTENT(IN) :: smoke_forecast - - integer :: i,j,k,n,m - real(kind_phys) :: conv_rho, conv, ext2, dm_smoke, daero_num_wfa, daero_num_ifa !, lu_sum1_5, lu_sum12_14 - !real(kind_phys) :: ebumax -! CHARACTER (LEN=80) :: message - - INTEGER, PARAMETER :: kfire_max=51 ! max vertical level for BB plume rise - ! Diameters and standard deviations for emissions - ! the diameters are the volume (mass) geometric mean diameters, following MADE_SORGAM - real(kind_phys), PARAMETER :: dgvem_i= 0.08E-6 !0.03E-6 ! [ m ] - real(kind_phys), PARAMETER :: sgem_i = 1.8 !1.7 - - ! *** Accumulation mode: - real(kind_phys), PARAMETER :: dgvem_j= 0.3E-6 ! [ m ] - real(kind_phys), PARAMETER :: sgem_j = 2.0 - - ! *** Coarse mode - real(kind_phys), PARAMETER :: dgvem_c= 6.0E-6 ! [ m ] - real(kind_phys), PARAMETER :: sgem_c= 2.2 - real(kind_phys), PARAMETER :: pic= 3.14159 - - ! RAR: factors for getting number emissions rate from mass emissions rate following made_sorgam - real(kind_phys), PARAMETER :: fact_numn= 1.e-9*6.0/pic*exp(4.5*log(sgem_i)**2)/dgvem_i**3 ! Aitken mode - real(kind_phys), PARAMETER :: fact_numa= 1.e-9*6.0/pic*exp(4.5*log(sgem_j)**2)/dgvem_j**3 ! accumulation mode - real(kind_phys), PARAMETER :: fact_numc= 1.e-9*6.0/pic*exp(4.5*log(sgem_c)**2)/dgvem_c**3 ! coarse mode - - real(kind_phys), PARAMETER :: dens_oc_aer=1.4e3, dens_ec_aer=1.7e3 ! kg/m3 -! real(kind_phys), PARAMETER :: rinti=2.1813936e-8, cx=2.184936* 3600, timeq_max=3600.*24. ! constants for the diurnal cycle calculations - real(kind_phys), PARAMETER :: ax1=531., cx1=7800. ! For cropland, urban and small fires -! real(kind_phys), PARAMETER :: rinti=2.1813936e-8, ax2=3200., const2=100., coef2=10.6712963e-4, cx=2.184936* 3600, timeq_max=3600.*24. - real(kind_phys), PARAMETER :: rinti=2.1813936e-8, ax2=3400., const2=130., coef2=10.6712963e-4, cx2=7200., timeq_max=3600.*24. ! New parameters - real(kind_phys), PARAMETER :: sc_me= 4.0, ab_me=0.5 ! m2/g, scattering and absorption efficiency for smoke - -! Parameters used for the wfa and ifa in mp physics per Trude E. (NCAR) -! Water friendly: radius: 0.04 micron, standard deviation: 1.8, kappa (for hygroscopic growth): 0.2, real index of refraction: 1.53, imaginary index of refraction: 1e-7 -! Ice friendly: radius: 0.4 micron, standard deviation: 1.8, kappa : 0.04, real index of refraction: 1.56, imaginary index of refraction: 3e-3 + INTENT(INOUT ) :: ebu + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: xlat,xlong, swdown + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: hwp, peak_hr, fire_end_hr, ebu_in !, vfrac + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: coef_bb_dc ! RAR: + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: hwp_prevd + + real(kind_phys), DIMENSION(ims:ime,kms:kme,jms:jme), INTENT(IN) :: dz8w,rho_phy !,rel_hum + real(kind_phys), INTENT(IN) :: dtstep, gmt + real(kind_phys), INTENT(IN) :: time_int,pi ! RAR: time in seconds since start of simulation + INTEGER, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: fire_type + integer, INTENT(IN) :: ebb_dcycle ! RAR: this is going to be namelist dependent, ebb_dcycle=means + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: fhist +!>--local + integer :: i,j,k,n,m + real(kind_phys) :: conv_rho, conv, dm_smoke, dc_hwp, dc_gp, dc_fn !daero_num_wfa, daero_num_ifa !, lu_sum1_5, lu_sum12_14 + + INTEGER, PARAMETER :: kfire_max=51 ! max vertical level for BB plume rise + ! real, parameter :: cx = 2.184936 * 3600., rinti = 2.1813936e-8 , ax = 2000.6038 ! bx_bburn = 20.041288 * 3600., RAR: this depends on the vegetation class, location (local time) etc. - real(kind_phys) :: timeq, dt1,dt2,dtm ! For BB emis. diurnal cycle calculation + real(kind_phys) :: timeq, fire_age, age_hr, dt1,dt2,dtm ! For BB emis. diurnal cycle calculation + ! For Gaussian diurnal cycle + REAL, PARAMETER :: sc_factor=1. ! to scale up the wildfire emissions, TBD later + REAL, PARAMETER :: rinti=2.1813936e-8, ax2=3400., const2=130., & + coef2=10.6712963e-4, cx2=7200., timeq_max=3600.*24. +!>-- Fire parameters + real(kind=kind_phys), dimension(1:5), parameter :: avg_fire_dur = (/8.9, 4.2, 3.3, 3.0, 1.4/) + real(kind=kind_phys), dimension(1:5), parameter :: sigma_fire_dur = (/8.7, 6.0, 5.5, 5.2, 2.4/) timeq= gmt*3600. + real(time_int,4) timeq= mod(timeq,timeq_max) -! Main loops to add BB emissions - do j=jts,jte - do i=its,ite - !if( luf_igbp(i,17,j)>0.99 .OR. ebu(i,1,j,p_ebu_smoke) < 1.e-6) cycle ! no BB emissions or water pixels - if( (1.-vfrac (i,j))>0.99 .OR. ebu(i,1,j) < 1.e-6) cycle ! no BB emissions or water pixels - - ! RAR: the decrease in the BB emissions after >18 hrs of forecast, the decrease occurs at night. The decrease occurs at night. - IF (time_int>64800. .AND. swdown(i,j)<.1 .AND. fhist(i,j)>.75 ) THEN - fhist(i,j)= 0.75 - ENDIF - - IF (time_int>129600. .AND. swdown(i,j)<.1 .AND. fhist(i,j)>.5 ) THEN ! After 36 hr forecast - fhist(i,j)= 0.5 - ENDIF - IF ( (rainc(i,j) + rainnc(i,j))>=10. .AND. fhist(i,j)>.3 ) THEN ! If it rains more than 1cm, then the BB emissions are reduced - fhist(i,j)= 0.3 - ENDIF - -! RAR: Grasslands (29% of ther western HRRR CONUS domain) probably also need to be added below, check this later -! RAR: In the HRRR CONUS domain (western part) crop 11%, 2% cropland/natural vegetation and 0.4% urban of pixels -!.OR. lu_index(i,j)==14) then ! Croplands(12), Urban and Built-Up(13), cropland/natural vegetation (14) mosaic in MODI-RUC vegetation classes +! RAR: Grasslands (29% of ther western HRRR CONUS domain) probably also need to +! be added below, check this later +! RAR: In the HRRR CONUS domain (western part) crop 11%, 2% cropland/natural +! vegetation and 0.4% urban of pixels +!.OR. lu_index(i,j)==14) then ! Croplands(12), Urban and Built-Up(13), +!cropland/natural vegetation (14) mosaic in MODI-RUC vegetation classes ! Peak hours for the fire activity depending on the latitude -! if (xlong(i,j)<-130.) then max_ti= 24.041288* 3600. ! peak at 24 UTC, fires in Alaska -! elseif (xlong(i,j)<-100.) then max_ti= 22.041288* 3600. ! peak at 22 UTC, fires in the western US -! elseif (xlong(i,j)<-70.) then ! peak at 20 UTC, fires in the eastern US, max_ti= 20.041288* 3600. +! if (xlong(i,j)<-130.) then max_ti= 24.041288* 3600. ! +! peak at 24 UTC, fires in Alaska +! elseif (xlong(i,j)<-100.) then max_ti= 22.041288* 3600. +! ! peak at 22 UTC, fires in the western US +! elseif (xlong(i,j)<-70.) then ! peak at 20 UTC, fires in +! the eastern US, max_ti= 20.041288* 3600. ! else max_ti= 18.041288* 3600. ! endif - - !IF ( lu_fire1(i,j)>0.9 ) then !Ag, urban fires, bare land etc. - IF ( vegtype(i,j)==12 .or. vegtype(i,j)==13 ) then !Ag, urban fires, bare land etc. - ! these fires will have exponentially decreasing diurnal cycle, these fires decrease 55% in 2 hours, end in 5 hours - r_q(i,j) = rinti* ax1 * exp(- (time_int**2)/(cx1**2) ) - ELSE - ! RAR: Gaussian profile for wildfires - dt1= abs(timeq - peak_hr(i,j)) - dt2= timeq_max - peak_hr(i,j) + timeq ! peak hour is always <86400. - dtm= MIN(dt1,dt2) - r_q(i,j) = rinti*( ax2 * exp(- dtm**2/(2.*cx2**2) ) + const2 - coef2*timeq ) - ENDIF - - r_q(i,j) = fhist(i,j)* max(0.,r_q(i,j)*timeq_max) - - !IF (swdown(i,j)<.1) THEN - ! r_q(i,j)= MIN(0.5,r_q(i,j)) ! lower BB emissions at night - !ENDIF - - !IF (.NOT. config_flags%bb_dcycle) THEN - !IF (.NOT. bb_dcycle) THEN - ! r_q(i,j)= fhist(i,j) ! no diurnal cycle - !END IF - - !IF (smoke_forecast == 0) THEN - r_q(i,j)= 1. - !END IF - - do k=kts,kfire_max - conv= r_q(i,j)*dtstep/(rho_phy(i,k,j)* dz8w(i,k,j)) - - ! RAR: in this case tracer_1 is fire emitted CO - ! conv_rho=r_q*4.828e-4/rho_phy(i,k,j)*dtstep/(dz8w(i,k,j)*60.) - ! chem(i,k,j,p_tracer_1) = chem(i,k,j,p_tracer_1) + ebu(i,k,j,p_ebu_co)*conv_rho - -! dm_oc_bb = conv* ebu(i,k,j,p_ebu_oc) ! Assume that BB primary PM25 is mostly OC, 1.25 is OM/OC ratio -! dm_p25_bb= conv* ebu(i,k,j,p_ebu_pm25) -! dm_ec_bb = conv* ebu(i,k,j,p_ebu_bc) -! dm_smk = conv* ebu(i,k,j,p_ebu_smoke) - !IF (k==kts) THEN ! Partition takes place here to avoid double counting of smold. and flam. BB emiss. - ! C11= (1.-flam_frac(i,j))*r_q(i,j) - !ELSE - ! C11= flam_frac(i,j)*r_q(i,j) - !ENDIF - dm_smoke= conv*ebu(i,k,j) -! print*,'hli dm_smoke',dm_smoke,conv,ebu(i,k,j,p_ebu_smoke) - - chem(i,k,j,p_smoke) = chem(i,k,j,p_smoke) + dm_smoke - chem(i,k,j,p_smoke) = MIN(chem(i,k,j,p_smoke),5.e+3) - - ! if ( k==kts ) then - ! WRITE(6,*) 'add_emiss_burn: gmt,dtstep,time_int ',gmt,dtstep,time_int - ! WRITE(*,*) 'add_emiss_burn: i,j,xlat(i,j),xlong(i,j) ',i,j,xlat(i,j),xlong(i,j) - !WRITE(*,*) 'add_emiss_burn: luf_igbp(i,:,j) ',luf_igbp(i,:,j) - !WRITE(*,*) 'add_emiss_burn: lu_fire1(i,j) ',lu_fire1(i,j) - ! WRITE(6,*) 'add_emiss_burn: timeq,peak_hr(i,j),fhist(i,j),r_q(i,j) ',timeq,peak_hr(i,j),fhist(i,j),r_q(i,j) - ! WRITE(*,*) 'add_emiss_burn: rainc(i,j),rainnc(i,j) ', rainc(i,j),rainnc(i,j) - ! endif - if ( dbg_opt .and. (k==kts .OR. k==kfire_max) ) then - WRITE(6,*) 'add_emiss_burn: i,j,k ',i,j,k - WRITE(6,*) 'add_emiss_burn: rho_phy(i,k,j),dz8w(i,k,j),conv ',rho_phy(i,k,j),dz8w(i,k,j),conv - WRITE(6,*) 'add_emiss_burn: ebu(i,k,j),dm_smoke ', ebu(i,k,j),dm_smoke - endif - - enddo - enddo - enddo - - ext2= sc_me + ab_me - do j=jts,jte - do k=kts,kte - do i=its,ite - - ! Check for NaNs, negative and too large numbers - IF (.NOT. (chem(i,k,j,p_smoke)>=0. .AND. chem(i,k,j,p_smoke)<1.1e+4)) THEN - chem(i,k,j,p_smoke)=1.e-16 - END IF - - ext3d_smoke(i,k,j)= 1.e-6* ext2* chem(i,k,j,p_smoke )*rho_phy(i,k,j)*dz8w(i,k,j) - ext3d_dust (i,k,j)= 1.e-6* ext2* chem(i,k,j,p_dust_1)*rho_phy(i,k,j)*dz8w(i,k,j) - enddo - enddo - enddo - - IF ( dbg_opt ) then - WRITE(*,*) 'add_emis_burn: i,j,k,ext2 ',i,j,k,ext2 - WRITE(*,*) 'add_emis_burn: rel_hum(its,kts,jts),rel_hum(ite,kfire_max,jte) ',rel_hum(its,kts,jts),rel_hum(ite,kfire_max,jte) - WRITE(*,*) 'add_emis_burn: ext3d_smoke(its,kts,jts),ext3d_smoke(ite,kfire_max,jte) ',ext3d_smoke(its,kts,jts),ext3d_smoke(ite,kfire_max,jte) - WRITE(*,*) 'add_emis_burn: ext3d_dust(its,kts,jts),ext3d_dust(ite,kfire_max,jte) ',ext3d_dust(its,kts,jts),ext3d_dust(ite,kfire_max,jte) - END IF - -! CASE DEFAULT -! call wrf_debug(15,'nothing done with burn emissions for chem array') -! END SELECT emiss_select +! RAR: for option #1 ebb and frp are ingested for 24 hours. No modification is +! applied! + if (ebb_dcycle==1) then + do k=kts,kte + do i=its,ite + ebu(i,k,1)=ebu_in(i,1) ! RAR: + enddo + enddo + endif + + if (ebb_dcycle==2) then + + ! Constants for the fire diurnal cycle calculation + do j=jts,jte + do i=its,ite + fire_age= time_int + (fire_end_hr(i,j))*3600. + + SELECT CASE ( fire_type(i,j) ) !Ag, urban fires, bare land etc. + CASE (1) + ! these fires will have exponentially decreasing diurnal cycle, + ! these fires decrease 55% in 2 hours, end in 5 hours + ! r_q(i,j) = rinti* ax1 * exp(- (time_int**2)/(cx1**2) ) + ! We assume 1hr latency in ingesting the sat. data + coef_bb_dc(i,j) = 1./((2*pi)**0.5 * sigma_fire_dur(1) *fire_age) * & + exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2*sigma_fire_dur(1)**2 )) + CASE (3) + age_hr= fire_age/3600. + + IF (swdown(i,j)<.1 .AND. age_hr> 12. .AND. fhist(i,j)>0.75) THEN + fhist(i,j)= 0.75 + ENDIF + IF (swdown(i,j)<.1 .AND. age_hr> 24. .AND. fhist(i,j)>0.5) THEN + fhist(i,j)= 0.5 + ENDIF + IF (swdown(i,j)<.1 .AND. age_hr> 48. .AND. fhist(i,j)>0.25) THEN + fhist(i,j)= 0.25 + ENDIF + + ! this is based on hwp, hourly or instantenous TBD + dc_hwp= ebu_in(i,j)* hwp(i,j)/ MAX(1.,hwp_prevd(i,j)) + dc_hwp= MAX(0.,dc_hwp) + + !coef_bb_dc(i,j)= sc_factor* fhist(i,j)* rate_ebb2(i,j)* (1. + log( + !hwp_(i,j)/ hwp_day_avg(i,j))) + + ! RAR: Gaussian profile for wildfires + dt1= abs(timeq - peak_hr(i,j)) + dt2= timeq_max - peak_hr(i,j) + timeq ! peak hour is always <86400. + dtm= MIN(dt1,dt2) + dc_gp = rinti*( ax2 * exp(- dtm**2/(2.*cx2**2) ) + const2 - coef2*timeq ) + dc_gp = MAX(0.,dc_gp) + + dc_fn = MAX(dc_hwp/dc_gp,3.) + coef_bb_dc(i,j) = sc_factor* fhist(i,j)* dc_fn + + do k=kts,kfire_max + conv= coef_bb_dc(i,j)*dtstep/(rho_phy(i,k,j)* dz8w(i,k,j)) + + dm_smoke= conv*ebu(i,k,j) + ! print*,'hli dm_smoke',dm_smoke,conv,ebu(i,k,j,p_ebu_smoke) + + chem(i,k,j,p_smoke) = chem(i,k,j,p_smoke) + dm_smoke + chem(i,k,j,p_smoke) = MIN(chem(i,k,j,p_smoke),5.e+3) + + if ( dbg_opt .and. (k==kts .OR. k==kfire_max) ) then + WRITE(6,*) 'add_emiss_burn: i,j,k ',i,j,k + WRITE(6,*) 'add_emiss_burn: rho_phy(i,k,j),dz8w(i,k,j),conv ',rho_phy(i,k,j),dz8w(i,k,j),conv + WRITE(6,*) 'add_emiss_burn: ebu(i,k,j),dm_smoke ', ebu(i,k,j),dm_smoke + endif + enddo + CASE DEFAULT + END SELECT + enddo + enddo + endif END subroutine add_emis_burn END module module_add_emiss_burn + diff --git a/physics/smoke_dust/module_plumerise1.F90 b/physics/smoke_dust/module_plumerise1.F90 index 3c23faa6a..f98350130 100755 --- a/physics/smoke_dust/module_plumerise1.F90 +++ b/physics/smoke_dust/module_plumerise1.F90 @@ -34,11 +34,12 @@ module module_plumerise1 ! 'aggr' /) ! grassland CONTAINS -subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & +subroutine ebu_driver ( flam_frac,ebu_in,ebu,coef_bb_dc, & t_phy,q_vap, & ! RAR: moist is replaced with q_vap rho_phy,vvel,u_phy,v_phy,p_phy, & z_at_w,z,g,con_cp,con_rd, & ! scale_fire_emiss is part of config_flags - plume_frp, k_min, k_max, & ! RAR: + frp_hr, k_min, k_max, & ! RAR: + wind_eff_opt, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte, errmsg, errflg) @@ -51,7 +52,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & REAL(kind_phys), PARAMETER :: frp_threshold= 1.e+7 ! Minimum FRP (Watts) to have plume rise - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme, 2 ), INTENT(IN ) :: plume_frp ! RAR: FRP etc. array + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme), INTENT(IN ) :: frp_hr ! RAR: FRP array ! TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags character(*), intent(inout) :: errmsg @@ -59,13 +60,15 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte + INTEGER, INTENT(IN ) :: wind_eff_opt ! real(kind=kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), & ! INTENT(IN ) :: moist real(kind=kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: ebu - + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: coef_bb_dc ! RAR: real(kind=kind_phys), INTENT(IN ) :: g, con_cp, con_rd - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: ebb_smoke + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: ebu_in real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(OUT ) :: flam_frac + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ) :: frp_hr_coef_bb_dc ! real(kind=kind_phys), DIMENSION( ims:ime, 1, jms:jme ), & ! INTENT(IN ) :: ebu_in @@ -130,12 +133,19 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & enddo !enddo +! Apply the diurnal cycle coefficient + do j=jts,jte + do i=its,ite + frp_hr_coef_bb_dc(i,j) = frp_hr(i,j)*coef_bb_dc(i,j) + enddo + enddo + ! For now the flammable fraction is constant, based on the namelist. The next ! step to use LU index and meteorology to parameterize it do j=jts,jte do i=its,ite flam_frac(i,j)= 0. - if (plume_frp(i,j,1) > frp_threshold) then + if (frp_hr_coef_bb_dc(i,j) > frp_threshold) then flam_frac(i,j)= 0.9 end if enddo @@ -171,7 +181,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & IF (dbg_opt) then WRITE(*,*) 'module_plumerise1: i,j ',i,j - WRITE(*,*) 'module_plumerise1: plume_frp(i,j,:) ',plume_frp(i,j,:) + WRITE(*,*) 'module_plumerise1: frp_hr(i,j) ',frp_hr_coef_bb_dc(i,j) WRITE(*,*) 'module_plumerise1: ebu(i,kts,j) ',ebu(i,kts,j) WRITE(*,*) 'module_plumerise1: u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) ',u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) WRITE(*,*) 'module_plumerise1: zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) ',zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) @@ -179,12 +189,13 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & END IF ! RAR: the plume rise calculation step: - CALL plumerise(kte,1,1,1,1,1,1, & + CALL plumerise(kte,1,1,1,1,1,1, & !firesize,mean_fct, & !num_ebu, eburn_in, eburn_out, & u_in, v_in, w_in, theta_in ,pi_in, & rho_phyin, qv_in, zmid, z_lev, & - plume_frp(i,j,1), k_min(i,j), & + wind_eff_opt, & + frp_hr_coef_bb_dc(i,j), k_min(i,j), & k_max(i,j), dbg_opt, g, con_cp, & con_rd, cpor, errmsg, errflg ) !k_max(i,j), config_flags%debug_chem ) @@ -195,9 +206,9 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & dz_plume= z_at_w(i,kp2,j) - z_at_w(i,kp1,j) do k=kp1,kp2-1 - ebu(i,k,j)= flam_frac(i,j)* ebb_smoke(i,j)* (z_at_w(i,k+1,j)-z_at_w(i,k,j))/dz_plume + ebu(i,k,j)= flam_frac(i,j)* ebu_in(i,j)* (z_at_w(i,k+1,j)-z_at_w(i,k,j))/dz_plume enddo - ebu(i,kts,j)= (1.-flam_frac(i,j))* ebb_smoke(i,j) + ebu(i,kts,j)= (1.-flam_frac(i,j))* ebu_in(i,j) IF ( dbg_opt ) then WRITE(*,*) 'module_plumerise1: i,j ',i,j diff --git a/physics/smoke_dust/module_smoke_plumerise.F90 b/physics/smoke_dust/module_smoke_plumerise.F90 index 61be06181..d80eaeb62 100755 --- a/physics/smoke_dust/module_smoke_plumerise.F90 +++ b/physics/smoke_dust/module_smoke_plumerise.F90 @@ -14,9 +14,9 @@ module module_smoke_plumerise use machine , only : kind_phys - use plume_data_mod, only : num_frp_plume, p_frp_hr, p_frp_std, & + use plume_data_mod, only : num_frp_plume, p_frp_hr, p_frp_std !tropical_forest, boreal_forest, savannah, grassland, & - wind_eff + ! wind_eff USE module_zero_plumegen_coms !real(kind=kind_phys),parameter :: rgas=r_d @@ -24,16 +24,18 @@ module module_smoke_plumerise CONTAINS ! RAR: - subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & + subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & ! firesize,mean_fct, & ! nspecies,eburn_in,eburn_out, & up,vp,wp,theta,pp,dn0,rv,zt_rams,zm_rams, & + wind_eff_opt, & frp_inst,k1,k2, dbg_opt, g, cp, rgas, & cpor, errmsg, errflg ) implicit none LOGICAL, INTENT (IN) :: dbg_opt + INTEGER, INTENT (IN) :: wind_eff_opt ! INTEGER, PARAMETER :: ihr_frp=1, istd_frp=2!, imean_fsize=3, istd_fsize=4 ! RAR: @@ -43,6 +45,7 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & integer :: ng,m1,m2,m3,ia,iz,ja,jz,ibcon,mynum,i,j,k,imm,ixx,ispc !,nspecies + INTEGER, INTENT (OUT) :: k1,k2 character(*), intent(inout) :: errmsg integer, intent(inout) :: errflg @@ -68,10 +71,13 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & ! integer, parameter :: grassland = 4 ! real(kind=kind_phys), dimension(nveg_agreg) :: firesize,mean_fct - INTEGER, PARAMETER :: wind_eff = 1 + INTEGER :: wind_eff type(plumegen_coms), pointer :: coms +! Set wind effect from namelist + wind_eff = wind_eff_opt + ! integer:: iloop !REAL(kind=kind_phys), INTENT (IN) :: convert_smold_to_flam diff --git a/physics/smoke_dust/module_wetdep_ls.F90 b/physics/smoke_dust/module_wetdep_ls.F90 index 87212920b..b9d52cb49 100755 --- a/physics/smoke_dust/module_wetdep_ls.F90 +++ b/physics/smoke_dust/module_wetdep_ls.F90 @@ -3,17 +3,18 @@ module module_wetdep_ls use machine , only : kind_phys - use rrfs_smoke_config, only : p_qc, alpha => wetdep_ls_alpha + use rrfs_smoke_config, only : p_smoke, p_dust_1, p_coarse_pm, p_qc, alpha => wetdep_ls_alpha contains subroutine wetdep_ls(dt,var,rain,moist, & - rho,nchem,num_moist,dz8w,vvel, & + rho,nchem,num_moist,ndvel,dz8w,vvel, & + wetdpr_smoke, wetdpr_dust, wetdpr_coarsepm, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) implicit none - integer, intent(in) :: nchem, num_moist, & + integer, intent(in) :: nchem, num_moist, ndvel, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte @@ -21,6 +22,8 @@ subroutine wetdep_ls(dt,var,rain,moist, real(kind_phys), dimension( ims:ime, kms:kme, jms:jme, num_moist),intent(in) :: moist real(kind_phys), dimension( ims:ime, kms:kme, jms:jme),intent(in) :: rho,dz8w,vvel real(kind_phys), dimension( ims:ime, kms:kme, jms:jme,1:nchem),intent(inout) :: var + real(kind_phys), dimension( ims:ime, jms:jme ), intent(out) :: & + wetdpr_smoke, wetdpr_dust, wetdpr_coarsepm real(kind_phys), dimension( ims:ime, jms:jme),intent(in) :: rain real(kind_phys), dimension( its:ite, jts:jte) :: var_sum,var_rmv real(kind_phys), dimension( its:ite, kts:kte, jts:jte) :: var_rmvl @@ -68,6 +71,14 @@ subroutine wetdep_ls(dt,var,rain,moist, if(var(i,k,j,nv).gt.1.e-16 .and. moist(i,k,j,p_qc).gt.0.)then factor = max(0.,frc(i,j)*rho(i,k,j)*dz8w(i,k,j)*vvel(i,k,j)) dvar=alpha*factor/(1+factor)*var(i,k,j,nv) +! Accumulate diags + if (nv .eq. p_smoke ) then + wetdpr_smoke(i,j) = wetdpr_smoke(i,j) + dvar * rho(i,k,j) * dt * 1.E-6 + elseif (nv .eq. p_dust_1 ) then + wetdpr_dust(i,j) = wetdpr_dust(i,j) + dvar * rho(i,k,j) * dt * 1.E-6 + elseif (nv .eq. p_coarse_pm ) then + wetdpr_coarsepm(i,j) = wetdpr_coarsepm(i,j) + dvar * rho(i,k,j) * dt * 1.E-6 + endif var(i,k,j,nv)=max(1.e-16,var(i,k,j,nv)-dvar) endif enddo diff --git a/physics/smoke_dust/plume_data_mod.F90 b/physics/smoke_dust/plume_data_mod.F90 index 3d4b21c37..2bf91dbfa 100755 --- a/physics/smoke_dust/plume_data_mod.F90 +++ b/physics/smoke_dust/plume_data_mod.F90 @@ -45,7 +45,7 @@ module plume_data_mod integer, parameter :: savannah = 3 integer, parameter :: grassland = 4 integer, parameter :: nveg_agreg = 4 - integer, parameter :: wind_eff = 1 +! integer, parameter :: wind_eff = 1 public diff --git a/physics/smoke_dust/rrfs_smoke_config.F90 b/physics/smoke_dust/rrfs_smoke_config.F90 index 58d4c5846..5f8f02e7b 100755 --- a/physics/smoke_dust/rrfs_smoke_config.F90 +++ b/physics/smoke_dust/rrfs_smoke_config.F90 @@ -15,28 +15,30 @@ module rrfs_smoke_config !-- constant paramters real(kind=kind_phys), parameter :: epsilc = 1.e-12 - !-- aerosol module configurations - integer :: chem_opt = 1 + integer :: chem_opt = 1 integer :: kemit = 1 integer :: dust_opt = 5 - integer :: seas_opt = 2 + integer :: seas_opt = 0 ! turn off by default logical :: do_plumerise = .true. integer :: addsmoke_flag = 1 + integer :: smoke_forecast = 1 integer :: plumerisefire_frq=60 integer :: wetdep_ls_opt = 1 integer :: drydep_opt = 1 - integer :: coarsepm_settling = 1 - logical :: bb_dcycle = .false. - logical :: aero_ind_fdb = .false. + integer :: pm_settling = 1 + integer :: nfire_types = 5 + integer :: ebb_dcycle = 2 ! 1: read in ebb_smoke(i,24), 2: daily logical :: dbg_opt = .true. - integer :: smoke_forecast = 0 ! 0 read in ebb_smoke(i,24) + logical :: aero_ind_fdb = .false. + logical :: do_rrfs_sd = .true. +! integer :: wind_eff_opt = 1 + logical :: extended_sd_diags = .false. real(kind_phys) :: wetdep_ls_alpha = .5 ! scavenging factor ! -- integer, parameter :: CHEM_OPT_GOCART= 1 - integer, parameter :: call_chemistry = 1 - integer, parameter :: num_moist=3, num_chem=20, num_emis_seas=5, num_emis_dust=5 + integer, parameter :: num_moist=2, num_chem=20, num_emis_seas=5, num_emis_dust=5 integer, parameter :: DUST_OPT_FENGSHA = 5 @@ -52,41 +54,19 @@ module rrfs_smoke_config integer :: numgas = 0 !-- tracers - integer, parameter :: p_so2=1 - integer, parameter :: p_sulf=2 - integer, parameter :: p_dms=3 - integer, parameter :: p_msa=4 - integer, parameter :: p_p25=5, p_smoke=5 - integer, parameter :: p_bc1=6 - integer, parameter :: p_bc2=7 - integer, parameter :: p_oc1=8 - integer, parameter :: p_oc2=9 - integer, parameter :: p_dust_1=10 - integer, parameter :: p_dust_2=11 - integer, parameter :: p_dust_3=12 - integer, parameter :: p_dust_4=13 - integer, parameter :: p_dust_5=14, p_coarse_pm=14 - integer, parameter :: p_seas_1=15 - integer, parameter :: p_seas_2=16 - integer, parameter :: p_seas_3=17 - integer, parameter :: p_seas_4=18 - integer, parameter :: p_seas_5=19 - integer, parameter :: p_p10 =20 - - integer, parameter :: p_edust1=1,p_edust2=2,p_edust3=3,p_edust4=4,p_edust5=5 - integer, parameter :: p_eseas1=1,p_eseas2=2,p_eseas3=3,p_eseas4=4,p_eseas5=5 - - integer :: p_ho=0,p_h2o2=0,p_no3=0 + integer, parameter :: p_smoke=5 + integer, parameter :: p_dust_1=10 + integer, parameter :: p_dust_2=11 + integer, parameter :: p_dust_3=12 + integer, parameter :: p_dust_4=13 + integer, parameter :: p_dust_5=14, p_coarse_pm=14 + integer, parameter :: p_seas_1=15 + integer, parameter :: p_seas_2=16 + integer, parameter :: p_seas_3=17 + integer, parameter :: p_seas_4=18 + integer, parameter :: p_seas_5=19 - ! constants - real(kind=kind_phys), PARAMETER :: airmw = 28.97 - real(kind=kind_phys), PARAMETER :: mw_so2_aer = 64.066 - real(kind=kind_phys), PARAMETER :: mw_so4_aer = 96.066 - real(kind=kind_phys), parameter :: smw = 32.00 - real(kind=kind_phys), parameter :: mwdry = 28. -! d is the molecular weight of dry air (28.966), w/d = 0.62197, and -! (d - w)/d = 0.37803 -! http://atmos.nmsu.edu/education_and_outreach/encyclopedia/humidity.htm + integer, parameter :: p_edust1=1,p_edust2=2,p_edust3=3,p_edust4=4,p_edust5=5 ! -- fire options ! integer, parameter :: num_plume_data = 1 diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.meta b/physics/smoke_dust/rrfs_smoke_postpbl.meta index 50f7afae7..5f8ca2a8e 100755 --- a/physics/smoke_dust/rrfs_smoke_postpbl.meta +++ b/physics/smoke_dust/rrfs_smoke_postpbl.meta @@ -1,8 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_postpbl type = scheme - dependencies = dep_dry_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90 - + dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,dep_dry_mod_emerson.F90,dep_data_mod.F90 ######################################################################## [ccpp-arg-table] name = rrfs_smoke_postpbl_run diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index c9a6344b8..f4e28be3a 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -7,17 +7,18 @@ module rrfs_smoke_wrapper use machine , only : kind_phys use rrfs_smoke_config, only : kemit, dust_opt, seas_opt, do_plumerise, & addsmoke_flag, plumerisefire_frq, wetdep_ls_opt, & - drydep_opt, coarsepm_settling, aero_ind_fdb, & - dbg_opt, smoke_forecast, wetdep_ls_alpha, & + drydep_opt, pm_settling, aero_ind_fdb, ebb_dcycle, & + dbg_opt,smoke_forecast,wetdep_ls_alpha,do_rrfs_sd, & + ebb_dcycle, extended_sd_diags, & num_moist, num_chem, num_emis_seas, num_emis_dust, & DUST_OPT_FENGSHA, p_qv, p_atm_shum, p_atm_cldq, & p_smoke, p_dust_1, p_coarse_pm, epsilc - use dust_data_mod, only : dust_alpha, dust_gamma, dust_moist_opt, & + use dust_data_mod, only : dust_alpha, dust_gamma, dust_moist_opt, & dust_moist_correction, dust_drylimit_factor - use plume_data_mod, only : p_frp_std, p_frp_hr, num_frp_plume use seas_mod, only : gocart_seasalt_driver use dust_fengsha_mod, only : gocart_dust_fengsha_driver - use dep_dry_mod, only : dry_dep_driver + use dep_dry_simple_mod, only : dry_dep_driver_simple + use dep_dry_emerson_mod, only : dry_dep_driver_emerson use module_wetdep_ls, only : wetdep_ls use module_plumerise1, only : ebu_driver use module_add_emiss_burn, only : add_emis_burn @@ -27,13 +28,80 @@ module rrfs_smoke_wrapper private - public :: rrfs_smoke_wrapper_run + public :: rrfs_smoke_wrapper_run, rrfs_smoke_wrapper_init + + integer :: wind_eff_opt contains !>\defgroup rrfs_smoke_wrapper rrfs-sd emission driver Module !> \ingroup gsd_chem_group !! This is the rrfs-sd emission driver Module + +!> \section arg_table_rrfs_smoke_wrapper_init Argument Table +!! \htmlinclude rrfs_smoke_wrapper_init.html +!! + subroutine rrfs_smoke_wrapper_init( seas_opt_in, & ! sea salt namelist + drydep_opt_in, pm_settling_in, & ! Dry Dep namelist + wetdep_ls_opt_in,wetdep_ls_alpha_in, & ! Wet dep namelist + rrfs_sd, do_plumerise_in, plumerisefire_frq_in, & ! smoke namelist + wind_eff_opt_in, & ! smoke namelist + addsmoke_flag_in, ebb_dcycle_in, smoke_forecast_in, & ! Smoke namelist + dust_opt_in, dust_alpha_in, dust_gamma_in, & ! Dust namelist + dust_moist_opt_in, & ! Dust namelist + dust_moist_correction_in, dust_drylimit_factor_in, & ! Dust namelist + aero_ind_fdb_in, & ! Feedback namelist + extended_sd_diags_in,dbg_opt_in, & ! Other namelist + errmsg, errflg ) + + +!>-- Namelist + real(kind_phys), intent(in) :: dust_alpha_in, dust_gamma_in, wetdep_ls_alpha_in + real(kind_phys), intent(in) :: dust_moist_correction_in + real(kind_phys), intent(in) :: dust_drylimit_factor_in + integer, intent(in) :: dust_opt_in,dust_moist_opt_in, wetdep_ls_opt_in, pm_settling_in, seas_opt_in + integer, intent(in) :: drydep_opt_in + logical, intent(in) :: aero_ind_fdb_in,dbg_opt_in, extended_sd_diags_in + integer, intent(in) :: smoke_forecast_in, wind_eff_opt_in, plumerisefire_frq_in + integer, intent(in) :: addsmoke_flag_in, ebb_dcycle_in + logical, intent(in) :: do_plumerise_in, rrfs_sd + character(len=*),intent(out):: errmsg + integer, intent(out) :: errflg + + errmsg = '' + errflg = 0 + +!>-- Assign namelist values + !>-Dust + dust_alpha = dust_alpha_in + dust_gamma = dust_gamma_in + dust_moist_opt = dust_moist_opt_in + dust_moist_correction = dust_moist_correction_in + dust_drylimit_factor = dust_drylimit_factor_in + dust_opt = dust_opt_in + !>-Sea Salt + seas_opt = seas_opt_in + !>-Dry and wet deposition + drydep_opt = drydep_opt_in + pm_settling = pm_settling_in + wetdep_ls_opt = wetdep_ls_opt_in + wetdep_ls_alpha = wetdep_ls_alpha_in + !>-Smoke + do_rrfs_sd = rrfs_sd + ebb_dcycle = ebb_dcycle_in + do_plumerise = do_plumerise_in + plumerisefire_frq = plumerisefire_frq_in + addsmoke_flag = addsmoke_flag_in + smoke_forecast = smoke_forecast_in + wind_eff_opt = wind_eff_opt_in + !>-Feedback + aero_ind_fdb = aero_ind_fdb_in + !>-Other + extended_sd_diags = extended_sd_diags_in + dbg_opt = dbg_opt_in + + end subroutine rrfs_smoke_wrapper_init + !! \section arg_table_rrfs_smoke_wrapper_run Argument Table !! \htmlinclude rrfs_smoke_wrapper_run.html !! @@ -42,126 +110,108 @@ module rrfs_smoke_wrapper subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, & u10m, v10m, ustar, rlat, rlon, tskin, pb2d, t2m, dpt2m, & pr3d, ph3d,phl3d, prl3d, tk3d, us3d, vs3d, spechum, w, & - nsoil, smc, vegtype, soiltyp, sigmaf, dswsfc, zorl, snow, julian, & - idat, rain_cpl, rainc_cpl, exch, hf2d, g, pi, con_cp, con_rd, con_fv, & - dust12m_in, emi_in, smoke_RRFS, ntrac, qgrs, gq0, chem3d, tile_num, & + nsoil, smc, vegtype_dom, vegtype_frac,soiltyp,nlcat, & + dswsfc, zorl, snow, julian,recmol, & + idat, rain_cpl, rainc_cpl, hf2d, g, pi, con_cp, con_rd, con_fv, & + dust12m_in, emi_ant_in, smoke_RRFS, smoke2d_RRFS, & + ntrac, qgrs, gq0, chem3d, tile_num, & ntsmoke, ntdust, ntcoarsepm, imp_physics, imp_physics_thompson, & - nwfa, nifa, emanoc, emdust, emseas, & - ebb_smoke_hr, frp_hr, frp_std_hr, & - coef_bb, ebu_smoke,fhist, min_fplume, max_fplume, hwp, wetness, & - smoke_ext, dust_ext, ndvel, ddvel_inout,rrfs_sd, & - dust_moist_opt_in, dust_moist_correction_in, dust_drylimit_factor_in, & - dust_alpha_in, dust_gamma_in, fire_in, & - seas_opt_in, dust_opt_in, drydep_opt_in, coarsepm_settling_in, & - do_plumerise_in, plumerisefire_frq_in, addsmoke_flag_in, & - wetdep_ls_opt_in,wetdep_ls_alpha_in, fire_heat_flux_out, & - frac_grid_burned_out, & - smoke_forecast_in, aero_ind_fdb_in,dbg_opt_in,errmsg,errflg) - + nwfa, nifa, emanoc, emdust, emseas, drydep_flux_out, wetdpr, & + ebb_smoke_in, frp_input, coef_bb, ebu_smoke,fhist,min_fplume, & + max_fplume, hwp, hwp_ave, wetness, ndvel, ddvel_inout,fire_in, & + fire_heat_flux_out, frac_grid_burned_out, kpbl,oro, & + errmsg,errflg ) + implicit none integer, intent(in) :: im,kte,kme,ktau,nsoil,tile_num,jdate(8),idat(8) - integer, intent(in) :: ntrac, ntsmoke, ntdust, ntcoarsepm, ndvel + integer, intent(in) :: ntrac, ntsmoke, ntdust, ntcoarsepm, ndvel, nlcat real(kind_phys),intent(in) :: dt, julian, g, pi, con_cp, con_rd, con_fv - logical, intent(in) :: aero_ind_fdb_in,dbg_opt_in - integer, intent(in) :: smoke_forecast_in integer, parameter :: ids=1,jds=1,jde=1, kds=1 integer, parameter :: ims=1,jms=1,jme=1, kms=1 integer, parameter :: its=1,jts=1,jte=1, kts=1 - integer, dimension(:), intent(in) :: land, vegtype, soiltyp - real(kind_phys), dimension(:,:), intent(in) :: smc - real(kind_phys), dimension(:,:,:), intent(in) :: dust12m_in - real(kind_phys), dimension(:,:,:), intent(in) :: smoke_RRFS - real(kind_phys), dimension(:,:), intent(in) :: emi_in - real(kind_phys), dimension(:), intent(in) :: u10m, v10m, ustar, dswsfc, & - garea, rlat,rlon, tskin, pb2d, sigmaf, zorl, snow, & - rain_cpl, rainc_cpl, hf2d, t2m, dpt2m - real(kind_phys), dimension(:,:), intent(in) :: ph3d, pr3d - real(kind_phys), dimension(:,:), intent(in) :: phl3d, prl3d, tk3d, & - us3d, vs3d, spechum, exch, w + integer, dimension(:), intent(in) :: land, vegtype_dom, soiltyp + real(kind_phys), dimension(:,:), intent(in) :: smc + 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) :: u10m, v10m, ustar, dswsfc, & + recmol, garea, rlat,rlon, tskin, pb2d, zorl, snow, & + rain_cpl, rainc_cpl, hf2d, t2m, dpt2m + real(kind_phys), dimension(:,:), intent(in) :: vegtype_frac + 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_hr, frp_hr, frp_std_hr - real(kind_phys), dimension(:), intent(inout) :: coef_bb, fhist - real(kind_phys), dimension(:,:), intent(inout) :: ebu_smoke - real(kind_phys), dimension(:,:), intent(inout) :: fire_in - real(kind_phys), dimension(:), intent(out) :: fire_heat_flux_out - real(kind_phys), dimension(:), intent(out) :: frac_grid_burned_out - real(kind_phys), dimension(:), intent(inout) :: max_fplume, min_fplume - real(kind_phys), dimension(:), intent( out) :: hwp - real(kind_phys), dimension(:,:), intent(out) :: smoke_ext, dust_ext - real(kind_phys), dimension(:,:), intent(inout) :: nwfa, nifa - real(kind_phys), dimension(:,:), intent(inout) :: ddvel_inout - real(kind_phys), dimension(:), intent(in) :: wetness - real(kind_phys), intent(in) :: dust_alpha_in, dust_gamma_in, wetdep_ls_alpha_in - real(kind_phys), intent(in) :: dust_moist_correction_in - real(kind_phys), intent(in) :: dust_drylimit_factor_in - integer, intent(in) :: dust_moist_opt_in - integer, intent(in) :: imp_physics, imp_physics_thompson - integer, intent(in) :: seas_opt_in, dust_opt_in, drydep_opt_in, & - coarsepm_settling_in, plumerisefire_frq_in, & - addsmoke_flag_in, wetdep_ls_opt_in - logical, intent(in ) :: do_plumerise_in, rrfs_sd - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - + real(kind_phys), dimension(:), intent(inout) :: emdust, emseas, emanoc + real(kind_phys), dimension(:), intent(inout) :: ebb_smoke_in,coef_bb, frp_input, fhist + real(kind_phys), dimension(:,:), intent(inout) :: ebu_smoke + real(kind_phys), dimension(:,:), intent(inout) :: fire_in + real(kind_phys), dimension(:), intent(out) :: fire_heat_flux_out, frac_grid_burned_out + real(kind_phys), dimension(:), intent(inout) :: max_fplume, min_fplume + real(kind_phys), dimension(:), intent( out) :: hwp + 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 + integer, intent(in) :: imp_physics, imp_physics_thompson + integer, dimension(:), intent(in) :: kpbl + real(kind_phys), dimension(:), intent(in) :: oro + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + +!>-- Local Variables real(kind_phys), dimension(ims:im, kms:kme, jms:jme) :: ebu real(kind_phys), dimension(1:im, 1:kme,jms:jme) :: rri, t_phy, u_phy, v_phy, & - p_phy, z_at_w, dz8w, p8w, t8w, rho_phy, vvel, zmid, exch_h - + p_phy, z_at_w, dz8w, p8w, t8w, rho_phy, vvel, zmid real(kind_phys), dimension(ims:im, jms:jme) :: u10, v10, ust, tsk, & - xland, xlat, xlong, dxy, pbl, hfx, rcav, rnav - + xland, xlat, xlong, dxy, pbl, hfx, rnav, hwp_local, & + wetdpr_smoke_local, wetdpr_dust_local, wetdpr_coarsepm_local !>- sea salt & chemistry variables real(kind_phys), dimension(ims:im, kms:kme, jms:jme, 1:num_moist) :: moist real(kind_phys), dimension(ims:im, kms:kme, jms:jme, 1:num_chem ) :: chem real(kind_phys), dimension(ims:im, 1, jms:jme, 1:num_emis_seas ) :: emis_seas real(kind_phys), dimension(ims:im, jms:jme) :: seashelp - +!>-- indexes, time integer :: ide, ime, ite, kde, julday - + real(kind_phys) :: gmt !>- dust & chemistry variables real(kind_phys), dimension(ims:im, jms:jme) :: ssm, rdrag, uthr, snowh ! fengsha dust - real(kind_phys), dimension(ims:im, jms:jme) :: vegfrac, rmol, swdown, znt, clayf, sandf + real(kind_phys), dimension(ims:im, nlcat, jms:jme) :: vegfrac + real(kind_phys), dimension(ims:im, jms:jme) :: rmol, swdown, znt, clayf, sandf real(kind_phys), dimension(ims:im, nsoil, jms:jme) :: smois real(kind_phys), dimension(ims:im, 1:1, jms:jme, 1:num_emis_dust) :: emis_dust integer, dimension(ims:im, jms:jme) :: isltyp, ivgtyp - !>- plume variables ! -- buffers - real(kind_phys), dimension(ims:im, jms:jme) :: ebu_in - real(kind_phys), dimension(ims:im, jms:jme, num_frp_plume ) :: plume_frp - real(kind_phys), dimension(ims:im, jms:jme ) :: coef_bb_dc, flam_frac, & - fire_hist, peak_hr - real(kind_phys), dimension(ims:im,kms:kme,jms:jme ) :: ext3d_smoke, ext3d_dust - integer, dimension(ims:im, jms:jme ) :: min_fplume2, max_fplume2 - logical :: call_fire + real(kind_phys), dimension(ims:im, jms:jme ) :: coef_bb_dc, flam_frac, frp_in, & + fire_hist, peak_hr, lu_nofire, lu_qfire, ebu_in, & + fire_end_hr, hwp_day_avg + integer, dimension(ims:im, jms:jme ) :: min_fplume2, max_fplume2, fire_type + logical :: call_fire, reset_hwp_ave !>- optical variables - real(kind_phys), dimension(ims:im, kms:kme, jms:jme) :: rel_hum - real(kind_phys), dimension(ims:im, jms:jme, ndvel) :: ddvel - + real(kind_phys), dimension(ims:im, jms:jme, ndvel) :: ddvel, settling_flux, drydep_flux_local + real(kind_phys), dimension(ims:im, kms:kme, jms:jme, ndvel) :: vgrav !>-- anthropogentic variables real(kind_phys), dimension(ims:im) :: emis_anoc real(kind_phys), dimension(ims:im, jms:jme, 1) :: sedim - - real(kind_phys) :: gmt - !> -- parameter to caluclate wfa&ifa (m) real(kind_phys), parameter :: mean_diameter1= 4.E-8, sigma1=1.8 real(kind_phys), parameter :: mean_diameter2= 1.E-6, sigma2=1.8 - real(kind_phys), parameter :: kappa_oc = 0.2 - real(kind_phys), parameter :: kappa_dust = 0.04 + ! real(kind_phys), parameter :: kappa_oc = 0.2 + ! real(kind_phys), parameter :: kappa_dust = 0.04 real(kind_phys) :: fact_wfa, fact_ifa !> -- aerosol density (kg/m3) real(kind_phys), parameter :: density_dust= 2.6e+3, density_sulfate=1.8e+3 real(kind_phys), parameter :: density_oc = 1.4e+3, density_seasalt=2.2e+3 - real(kind_phys), dimension(im) :: daero_emis_wfa, daero_emis_ifa -!>-- local variables +!> -- other real(kind_phys), dimension(im) :: wdgust, snoweq integer :: current_month, current_hour, hour_int real(kind_phys) :: curr_secs @@ -172,21 +222,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, errmsg = '' errflg = 0 - if (.not. rrfs_sd) return - -!>-- options to turn on/off sea-salt, dust, plume-rising - seas_opt = seas_opt_in - dust_opt = dust_opt_in - drydep_opt = drydep_opt_in - do_plumerise = do_plumerise_in - plumerisefire_frq = plumerisefire_frq_in - addsmoke_flag = addsmoke_flag_in - smoke_forecast = smoke_forecast_in - aero_ind_fdb = aero_ind_fdb_in - dbg_opt = dbg_opt_in - wetdep_ls_opt = wetdep_ls_opt_in - wetdep_ls_alpha = wetdep_ls_alpha_in - coarsepm_settling = coarsepm_settling_in + if (.not. do_rrfs_sd) return ! -- set domain ide=im @@ -199,19 +235,19 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, emis_seas = 0. emis_dust = 0. peak_hr = 0. + fire_type = 0 + lu_qfire = 0. + lu_nofire = 0. flam_frac = 0. - ext3d_smoke = 0. - ext3d_dust = 0. daero_emis_wfa = 0. daero_emis_ifa = 0. - rcav = 0. rnav = 0. curr_secs = ktau * dt current_month=jdate(2) ! needed for the dust input data current_hour =jdate(5)+1 ! =1 at 00Z - hour_int=ktau*dt/3600. ! hours since the simulation start + hour_int=ktau*dt/3600. ! hours since the simulation start gmt = real(mod(idat(5)+hour_int,24)) julday = int(julian) @@ -223,12 +259,13 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ! -- compute incremental convective and large-scale rainfall do i=its,ite - rcav(i,1)=max(rainc_cpl(i)*1000. , 0.) ! meter to mm rnav(i,1)=max((rain_cpl(i)-rainc_cpl(i))*1000., 0.) ! meter to mm coef_bb_dc(i,1) = coef_bb(i) fire_hist (i,1) = fhist (i) enddo + ! Is this a reset timestep (00:00 + dt)? + reset_hwp_ave = mod(int(curr_secs-dt),3600) == 0 ! plumerise frequency in minutes set up by the namelist input call_fire = (do_plumerise .and. (plumerisefire_frq > 0)) @@ -236,57 +273,35 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !>- get ready for chemistry run call rrfs_smoke_prep( & - current_month, current_hour, gmt, con_rd, con_fv, & + ktau,current_month, current_hour, gmt, con_rd, con_fv, & u10m,v10m,ustar,land,garea,rlat,rlon,tskin, & - pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,exch,w, & - nsoil,smc,vegtype,soiltyp,sigmaf,dswsfc,zorl, & - snow,dust12m_in,emi_in,smoke_RRFS, & - hf2d, pb2d, g, pi, hour_int, & + pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,w, & + nsoil,smc,vegtype_dom,soiltyp,nlcat,vegtype_frac,dswsfc,zorl, & + snow,dust12m_in,emi_ant_in,smoke_RRFS,smoke2d_RRFS,coef_bb_dc, & + hf2d, pb2d, g, pi, hour_int, peak_hr, & u10,v10,ust,tsk,xland,xlat,xlong,dxy, & rri,t_phy,u_phy,v_phy,p_phy,rho_phy,dz8w,p8w, & - t8w,exch_h, & + t8w,recmol, & z_at_w,vvel,zmid, & ntrac,gq0, & num_chem,num_moist, & ntsmoke, ntdust,ntcoarsepm, & - moist,chem,plume_frp,ebu_in, & - ebb_smoke_hr, frp_hr, frp_std_hr, emis_anoc, & - smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & - snowh,clayf,rdrag,sandf,ssm,uthr,rel_hum, & + moist,chem,ebu_in,ebb_smoke_in, & + fhist,frp_in, hwp_day_avg, fire_end_hr, & + emis_anoc,smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & + snowh,clayf,rdrag,sandf,ssm,uthr,oro, hwp_local, & + t2m,dpt2m,wetness,kpbl, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte) - -! Make this global, calculate at 1st time step only -!>-- for plumerise -- + its,ite, jts,jte, kts,kte ) - do j=jts,jte - do i=its,ite - peak_hr(i,j)= fire_in(i,10) - enddo - enddo - - IF (ktau==1) THEN - do j=jts,jte - do i=its,ite - if (xlong(i,j)<230.) then - peak_hr(i,j)= 0.0* 3600. ! peak at 24 UTC, fires in Alaska - elseif(xlong(i,j)<245.) then - peak_hr(i,j)= 23.0* 3600. - elseif (xlong(i,j)<260.) then - peak_hr(i,j)= 22.0* 3600. ! peak at 22 UTC, fires in the western US - elseif (xlong(i,j)<275.) then - peak_hr(i,j)= 21.0* 3600. - elseif (xlong(i,j)<290.) then ! peak at 20 UTC, fires in the eastern US - peak_hr(i,j)= 20.0* 3600. - else - peak_hr(i,j)= 19.0* 3600. - endif - enddo - enddo - ENDIF + do j=jts,jte + do i=its,ite + peak_hr(i,j)= fire_in(i,1) + enddo + enddo - IF (ktau==1) THEN + IF (ktau==1) THEN ebu = 0. do j=jts,jte do i=its,ite @@ -296,18 +311,33 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, enddo enddo enddo - ELSE - do k=kts,kte - do i=its,ite - ebu(i,k,1)=ebu_smoke(i,k) - enddo - enddo - ENDIF + ENDIF +!RAR: change this to the fractional LU type; fire_type: 0- no fires, 1- Ag +! or urban fires, 2- prescribed fires in wooded area, 3- wildfires + do j=jts,jte + do i=its,ite + if (ebu_in(i,j)<0.01) then + fire_type(i,j) = 0 + else + ! Permanent wetlands, snow/ice, water, barren tundra + lu_nofire(i,j) = vegfrac(i,11,j) + vegfrac(i,15,j) + vegfrac(i,17,j) + vegfrac(i,20,j) + ! cropland, urban, cropland/natural mosaic, barren and sparsely vegetated + lu_qfire(i,j) = vegfrac(i,12,j) + vegfrac(i,13,j) + vegfrac(i,14,j) + vegfrac(i,16,j) + if (lu_nofire(i,j)>0.95) then + fire_type(i,j) = 0 + else if (lu_qfire(i,j)>0.95) then + fire_type(i,j) = 1 + else + fire_type(i,j) = 3 ! RAR: need to add another criteria for fire_type=2, i.e. prescribed fires + end if + end if + end do + end do !>- compute sea-salt - ! -- compute sea salt (opt=2) - if (seas_opt == 2) then + ! -- compute sea salt (opt=1) + if (seas_opt == 1) then call gocart_seasalt_driver(dt,rri,t_phy, & u_phy,v_phy,chem,rho_phy,dz8w,u10,v10,ust,p8w,tsk, & xland,xlat,xlong,dxy,g,emis_seas,pi, & @@ -319,14 +349,8 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !-- compute dust (opt=5) if (dust_opt==DUST_OPT_FENGSHA) then - ! Set at compile time in dust_data_mod: - dust_alpha = dust_alpha_in - dust_gamma = dust_gamma_in - dust_moist_opt = dust_moist_opt_in - dust_moist_correction = dust_moist_correction_in - dust_drylimit_factor = dust_drylimit_factor_in call gocart_dust_fengsha_driver(dt,chem,rho_phy,smois,p8w,ssm, & - isltyp,vegfrac,snowh,xland,dxy,g,emis_dust,ust,znt, & + isltyp,snowh,xland,dxy,g,emis_dust,ust,znt, & clayf,sandf,rdrag,uthr, & num_emis_dust,num_chem,nsoil, & ids,ide, jds,jde, kds,kde, & @@ -340,43 +364,50 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !-- /scratch2/BMC/ap-fc/Ravan/rapid-refresh/WRFV3.9/smoke ! Every hour (per namelist) the ebu_driver is called to calculate ebu, but ! the plumerise is controlled by the namelist option of plumerise_flag + !if (add_fire_heat_flux) then + do i = its,ite + if ( frp_in(i,1) .ge. 1.E7 ) then + fire_heat_flux_out(i) = min(max(0.,0.88*coef_bb_dc(i,1)*frp_in(i,1) / & + 0.55/dxy(i,1)) ,5000.) ! JLS - W m-2 [0 - 10,000] + frac_grid_burned_out(i) = min(max(0., 1.3*0.0006*coef_bb_dc(i,1)*frp_in(i,1)/dxy(i,1) ),1.) + else + fire_heat_flux_out(i) = 0.0 + frac_grid_burned_out(i) = 0.0 + endif + enddo + !endif if (call_fire) then call ebu_driver ( & flam_frac,ebu_in,ebu, & + coef_bb_dc, & t_phy,moist(:,:,:,p_qv), & rho_phy,vvel,u_phy,v_phy,p_phy, & z_at_w,zmid,g,con_cp,con_rd, & - plume_frp, min_fplume2, max_fplume2, & ! new approach + frp_in, min_fplume2, max_fplume2, & ! new approach + wind_eff_opt, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte, errmsg, errflg ) if(errflg/=0) return - do i = its,ite - if ( plume_frp(i,1,p_frp_hr) .ge. 1.E7 ) then - fire_heat_flux_out(i) = min(max(0.,0.88*plume_frp(i,1,p_frp_hr)/0.55/dxy(i,1)) ,50000.) ! JLS - W m-2 [0 - 10,000] - frac_grid_burned_out(i) = min(max(0., 1.3*0.0006*plume_frp(i,1,p_frp_hr)/dxy(i,1) ),1.) - else - fire_heat_flux_out(i) = 0.0 - frac_grid_burned_out(i) = 0.0 - endif - enddo end if + ! -- add biomass burning emissions at every timestep if (addsmoke_flag == 1) then - call add_emis_burn(dt,dz8w,rho_phy,rel_hum,chem, & - julday,gmt,xlat,xlong, & - ivgtyp, vegfrac, peak_hr, & ! RAR - curr_secs,ebu, & - coef_bb_dc,fire_hist,ext3d_smoke,ext3d_dust, & - rcav, rnav,swdown,smoke_forecast, & + call add_emis_burn(dt,dz8w,rho_phy,pi, & + chem,julday,gmt,xlat,xlong, & + fire_end_hr, peak_hr,curr_secs, & + coef_bb_dc,fire_hist,hwp_local,hwp_day_avg, & + swdown,ebb_dcycle,ebu_in,ebu,fire_type, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) endif - !>-- compute coarsepm setting - if (coarsepm_settling == 1) then - call coarsepm_settling_driver(dt,t_phy,rel_hum, & + !>-- compute coarsepm setting if using simple dry dep option and + ! pm_settling is on. This is necessary becasue the simple scheme + ! does not have an explicty settling routine, Emersion (opt=1) does. + if (drydep_opt == 2 .and. pm_settling == 1) then + call coarsepm_settling_driver(dt,t_phy, & chem(:,:,:,p_coarse_pm), & rho_phy,dz8w,p8w,p_phy,sedim, & dxy,g,1, & @@ -384,18 +415,29 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) endif - !>-- compute dry deposition + !>-- compute dry deposition, based on Emerson et al., (2020) if (drydep_opt == 1) then - - call dry_dep_driver(rmol,ust,ndvel,ddvel,rel_hum, & + call dry_dep_driver_emerson(rmol,ust,znt,ndvel,ddvel, & + vgrav,chem,dz8w,snowh,t_phy,p_phy,rho_phy,ivgtyp,g,dt, & + pm_settling,drydep_flux_local,settling_flux, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte) - + its,ite, jts,jte, kts,kte ) do nv=1,ndvel - do i=its,ite - ddvel_inout(i,nv)=ddvel(i,1,nv) + do i=its,ite + ddvel_inout(i,nv)=ddvel(i,1,nv) + enddo enddo + !>-- compute dry deposition based on simple parameterization (HRRR-Smoke) + elseif (drydep_opt == 2) then + call dry_dep_driver_simple(rmol,ust,ndvel,ddvel, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte ) + do nv=1,ndvel + do i=its,ite + ddvel_inout(i,nv)=ddvel(i,1,nv) + enddo enddo else ddvel_inout(:,:)=0. @@ -403,35 +445,49 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !>- large-scale wet deposition if (wetdep_ls_opt == 1) then - call wetdep_ls(dt,chem,rnav,moist, & - rho_phy,num_chem,num_moist,dz8w,vvel, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte) + call wetdep_ls(dt,chem,rnav,moist, & + rho_phy,num_chem,num_moist,ndvel, dz8w,vvel,& + wetdpr_smoke_local, wetdpr_dust_local, & + wetdpr_coarsepm_local, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte ) + if ( extended_sd_diags ) then + do i = its, ite + wetdpr(i,1) = wetdpr(i,1) + wetdpr_smoke_local (i,1) + wetdpr(i,2) = wetdpr(i,2) + wetdpr_dust_local (i,1) + wetdpr(i,3) = wetdpr(i,3) + wetdpr_coarsepm_local(i,1) + enddo + endif endif +! Smoke emisisons diagnostic do k=kts,kte do i=its,ite ebu_smoke(i,k)=ebu(i,k,1) enddo enddo - !---- diagnostic output of hourly wildfire potential (07/2021) + if (ktau == 1 .or. reset_hwp_ave) then + hwp_ave = 0. + endif hwp = 0. do i=its,ite - wdgust(i)=max(1.68*sqrt(us3d(i,1)**2+vs3d(i,1)**2),3.) - snoweq(i)=max((25.-snow(i))/25.,0.) - hwp(i)=0.237*wdgust(i)**1.11*max(t2m(i)-dpt2m(i),15.)**0.92*((1.-wetness(i))**6.95)*snoweq(i) ! Eric 08/2022 - enddo - -!---- diagnostic output of smoke & dust optical extinction (12/2021) - do k=kts,kte - do i=its,ite - smoke_ext(i,k) = ext3d_smoke(i,k,1) - dust_ext (i,k) = ext3d_dust (i,k,1) - enddo + hwp(i)=hwp_local(i,1) + hwp_ave(i) = hwp_ave(i) + hwp(i)*dt enddo + +!---- diagnostic output of dry deposition & gravitational settling fluxes + if ( drydep_opt == 1 .and. extended_sd_diags ) then + do nv = 1, ndvel + do i=its,ite + drydep_flux_out(i,nv) = drydep_flux_out(i,nv) + & + drydep_flux_local(i,1,nv) + & + settling_flux(i,1,nv) + enddo + enddo + endif !------------------------------------- !---- put smoke stuff back into tracer array do k=kts,kte @@ -455,20 +511,19 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !------------------------------------- !-- to output for diagnostics do i = 1, im - emseas (i) = emis_seas(i,1,1,1)*1.e+9 ! size bin 1 sea salt emission: ug/m2/s + !emseas (i) = emis_seas(i,1,1,1)*1.e+9 ! size bin 1 sea salt emission: ug/m2/s + !emanoc (i) = emis_anoc (i) ! anthropogenic organic carbon: ug/m2/s emdust (i) = emis_dust(i,1,1,1) + emis_dust(i,1,1,2) + & emis_dust(i,1,1,3) + emis_dust(i,1,1,4) ! dust emission: ug/m2/s - emanoc (i) = emis_anoc (i) ! anthropogenic organic carbon: ug/m2/s coef_bb (i) = coef_bb_dc(i,1) + frp_input (i) = coef_bb_dc(i,1)*frp_in(i,1) fhist (i) = fire_hist (i,1) min_fplume (i) = real(min_fplume2(i,1)) max_fplume (i) = real(max_fplume2(i,1)) - emseas (i) = sandf(i,1) ! sand for dust - emanoc (i) = uthr (i,1) ! u threshold for dust enddo do i = 1, im - fire_in(i,10) = peak_hr(i,1) + fire_in(i,1) = peak_hr(i,1) enddo !-- to provide real aerosol emission for Thompson MP @@ -500,46 +555,51 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, end subroutine rrfs_smoke_wrapper_run - subroutine rrfs_smoke_prep( & - current_month,current_hour,gmt,con_rd,con_fv, & - u10m,v10m,ustar,land,garea,rlat,rlon,ts2d, & - pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,exch,w, & - nsoil,smc,vegtype,soiltyp,sigmaf,dswsfc,zorl, & - snow_cpl,dust12m_in,emi_in,smoke_RRFS, & - hf2d, pb2d, g, pi, hour_int, & - u10,v10,ust,tsk,xland,xlat,xlong,dxy, & - rri,t_phy,u_phy,v_phy,p_phy,rho_phy,dz8w,p8w, & - t8w,exch_h, & - z_at_w,vvel,zmid, & - ntrac,gq0, & - num_chem, num_moist, & - ntsmoke, ntdust, ntcoarsepm, & - moist,chem,plume_frp,ebu_in, & - ebb_smoke_hr, frp_hr, frp_std_hr, emis_anoc, & - smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & - snowh,clayf,rdrag,sandf,ssm,uthr,rel_hum, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & + subroutine rrfs_smoke_prep( & + ktau,current_month,current_hour,gmt,con_rd,con_fv, & + u10m,v10m,ustar,land,garea,rlat,rlon,ts2d, & + pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,w, & + nsoil,smc,vegtype_dom,soiltyp,nlcat,vegtype_frac,dswsfc,zorl, & + snow_cpl,dust12m_in,emi_ant_in,smoke_RRFS,smoke2d_RRFS,coef_bb_dc, & + hf2d, pb2d, g, pi, hour_int, peak_hr, & + u10,v10,ust,tsk,xland,xlat,xlong,dxy, & + rri,t_phy,u_phy,v_phy,p_phy,rho_phy,dz8w,p8w, & + t8w,recmol, & + z_at_w,vvel,zmid, & + ntrac,gq0, & + num_chem, num_moist, & + ntsmoke, ntdust, ntcoarsepm, & + moist,chem,ebu_in,ebb_smoke_in, & + fhist,frp_in, hwp_day_avg, fire_end_hr, & + emis_anoc,smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & + snowh,clayf,rdrag,sandf,ssm,uthr,oro,hwp_local, & + t2m,dpt2m,wetness,kpbl, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte) !Chem input configuration - integer, intent(in) :: current_month, current_hour, hour_int + integer, intent(in) :: current_month, current_hour, hour_int, nlcat !FV3 input variables - integer, intent(in) :: nsoil - integer, dimension(ims:ime), intent(in) :: land, vegtype, soiltyp + integer, intent(in) :: nsoil, ktau + integer, dimension(ims:ime), intent(in) :: land, vegtype_dom, soiltyp, kpbl integer, intent(in) :: ntrac real(kind=kind_phys), intent(in) :: g, pi, gmt, con_rd, con_fv real(kind=kind_phys), dimension(ims:ime), intent(in) :: & - u10m, v10m, ustar, garea, rlat, rlon, ts2d, sigmaf, dswsfc, & - zorl, snow_cpl, pb2d, hf2d + u10m, v10m, ustar, garea, rlat, rlon, ts2d, dswsfc, & + zorl, snow_cpl, pb2d, hf2d, oro, t2m, dpt2m, wetness, recmol + real(kind=kind_phys), dimension(ims:ime, nlcat), intent(in) :: vegtype_frac real(kind=kind_phys), dimension(ims:ime, nsoil), intent(in) :: smc real(kind=kind_phys), dimension(ims:ime, 12, 5), intent(in) :: dust12m_in - real(kind=kind_phys), dimension(ims:ime, 24, 3), intent(in) :: smoke_RRFS - real(kind=kind_phys), dimension(ims:ime, 1), intent(in) :: emi_in + real(kind=kind_phys), dimension(ims:ime, 24, 2), intent(in) :: smoke_RRFS +! This is a place holder for ebb_dcycle == 2, currently set to hold a single +! value, which is the previous day's average of hwp, frp, ebb, fire_end + real(kind=kind_phys), dimension(ims:ime, 4), intent(in) :: smoke2d_RRFS + real(kind=kind_phys), dimension(ims:ime, 4), intent(in) :: emi_ant_in real(kind=kind_phys), dimension(ims:ime, kms:kme), intent(in) :: pr3d,ph3d real(kind=kind_phys), dimension(ims:ime, kts:kte), intent(in) :: & - phl3d,tk3d,prl3d,us3d,vs3d,spechum,exch,w + phl3d,tk3d,prl3d,us3d,vs3d,spechum,w real(kind=kind_phys), dimension(ims:ime, kts:kte,ntrac), intent(in) :: gq0 @@ -551,37 +611,42 @@ subroutine rrfs_smoke_prep( & real(kind_phys), dimension(ims:ime, jms:jme),intent(out) :: ebu_in - real(kind_phys), dimension(ims:ime, jms:jme, num_frp_plume), intent(out) :: plume_frp + ! real(kind_phys), dimension(ims:ime, jms:jme, num_frp_plume), intent(out) :: plume_frp integer,dimension(ims:ime, jms:jme), intent(out) :: isltyp, ivgtyp real(kind_phys), dimension(ims:ime, kms:kme, jms:jme), intent(out) :: & rri, t_phy, u_phy, v_phy, p_phy, rho_phy, dz8w, p8w, t8w, vvel, & - zmid, exch_h, rel_hum + zmid real(kind_phys), dimension(ims:ime, jms:jme), intent(out) :: & - u10, v10, ust, tsk, xland, xlat, xlong, dxy, vegfrac, rmol, swdown, znt, & - pbl, hfx, snowh, clayf, rdrag, sandf, ssm, uthr + u10, v10, ust, tsk, xland, xlat, xlong, dxy, rmol, swdown, znt, & + pbl, hfx, snowh, clayf, rdrag, sandf, ssm, uthr, hwp_local + real(kind_phys), dimension(ims:ime, nlcat, jms:jme), intent(out) :: vegfrac real(kind_phys), dimension(ims:ime, kms:kme, jms:jme, num_moist), intent(out) :: moist real(kind_phys), dimension(ims:ime, kms:kme, jms:jme, num_chem), intent(out) :: chem real(kind_phys), dimension(ims:ime, kms:kme, jms:jme), intent(out) :: z_at_w real(kind_phys), dimension(ims:ime, nsoil, jms:jme), intent(out) :: smois - real(kind_phys), dimension(ims:ime), intent(inout) :: ebb_smoke_hr, frp_hr, frp_std_hr - real(kind_phys), dimension(ims:ime), intent(inout) :: emis_anoc - !real(kind_phys), dimension(ims:ime, jms:jme, num_plume_data) :: plume + real(kind_phys), dimension(ims:ime,jms:jme), intent(inout) :: frp_in, fire_end_hr, fhist, coef_bb_dc + real(kind_phys), dimension(ims:ime,jms:jme), intent(inout) :: hwp_day_avg, peak_hr + real(kind_phys), dimension(ims:ime), intent(inout) :: emis_anoc,ebb_smoke_in + ! real(kind_phys), dimension(ims:ime, jms:jme, num_plume_data) :: plume real(kind_phys), parameter :: conv_frp = 1.e+06_kind_phys ! FRP conversion factor, MW to W real(kind_phys), parameter :: frpc = 1._kind_phys ! FRP conversion factor (Regional) ! -- local variables - integer i,ip,j,k,kp,kk,kkp,nv,l,ll,n + integer i,ip,j,k,k1,kp,kk,kkp,nv,l,ll,n,nl + real(kind_phys) :: SFCWIND,WIND,DELWIND,DZ,wdgust,snoweq,THETA,ZSF + real(kind_phys), dimension(ims:ime, kms:kme, jms:jme) :: THETAV + real(kind_phys), dimension(ims:ime, jms:jme) :: windgustpot,kpbl_thetav + real(kind_phys), parameter :: delta_theta4gust = 0.5 ! -- initialize fire emissions - !plume = 0._kind_phys - plume_frp = 0._kind_phys ebu_in = 0._kind_phys - ebb_smoke_hr = 0._kind_phys + ebb_smoke_in = 0._kind_phys emis_anoc = 0._kind_phys - frp_hr = 0._kind_phys - frp_std_hr = 0._kind_phys + frp_in = 0._kind_phys + hwp_day_avg = 0._kind_phys + fire_end_hr = 0._kind_phys ! -- initialize output arrays isltyp = 0._kind_phys @@ -597,7 +662,6 @@ subroutine rrfs_smoke_prep( & t8w = 0._kind_phys vvel = 0._kind_phys zmid = 0._kind_phys - exch_h = 0._kind_phys u10 = 0._kind_phys v10 = 0._kind_phys ust = 0._kind_phys @@ -621,7 +685,6 @@ subroutine rrfs_smoke_prep( & moist = 0._kind_phys chem = 0._kind_phys z_at_w = 0._kind_phys - rel_hum = 0._kind_phys do i=its,ite u10 (i,1)=u10m (i) @@ -642,12 +705,14 @@ subroutine rrfs_smoke_prep( & sandf(i,1)=dust12m_in(i,current_month,3) ssm (i,1)=dust12m_in(i,current_month,4) uthr (i,1)=dust12m_in(i,current_month,5) - ivgtyp (i,1)=vegtype(i) + ivgtyp (i,1)=vegtype_dom (i) isltyp (i,1)=soiltyp(i) - vegfrac(i,1)=sigmaf (i) + do nl = 1,nlcat + vegfrac(i,nl,1)=vegtype_frac (i,nl) + enddo + rmol (i,1)=recmol (i) enddo - rmol=0. do k=1,nsoil do j=jts,jte @@ -690,38 +755,30 @@ subroutine rrfs_smoke_prep( & p_phy(i,k,j)=prl3d(i,kkp) u_phy(i,k,j)=us3d(i,kkp) v_phy(i,k,j)=vs3d(i,kkp) - rho_phy(i,k,j)=p_phy(i,k,j)/(con_rd*t_phy(i,k,j)*(1.+con_fv*spechum(i,kkp))) + ! from mp_thompson.F90 ; rho = con_eps*prsl/(con_rd*tgrs*(qv+con_eps)) + ! from mynnd + rho_phy(i,k,j)=p_phy(i,k,j)/(con_rd*t_phy(i,k,j)) !*(1.+con_fv*spechum(i,kkp))) rri(i,k,j)=1./rho_phy(i,k,j) vvel(i,k,j)=-w(i,kkp)*rri(i,k,j)/g moist(i,k,j,:)=0. moist(i,k,j,1)=gq0(i,kkp,p_atm_shum) if (t_phy(i,k,j) > 265.) then moist(i,k,j,2)=gq0(i,kkp,p_atm_cldq) - moist(i,k,j,3)=0. + !moist(i,k,j,3)=0. + ! TODO -- should we keep these limits? if (moist(i,k,j,2) < 1.e-8) moist(i,k,j,2)=0. else moist(i,k,j,2)=0. - moist(i,k,j,3)=gq0(i,kkp,p_atm_cldq) - if(moist(i,k,j,3) < 1.e-8)moist(i,k,j,3)=0. + ! moist(i,k,j,3)=gq0(i,kkp,p_atm_cldq) + ! TODO -- should we keep these limits? + ! if(moist(i,k,j,3) < 1.e-8)moist(i,k,j,3)=0. endif - !rel_hum(i,k,j) = min(0.95,spechum(i,kkp)) - rel_hum(i,k,j) = min(0.95, moist(i,k,j,1) / & - (3.80*exp(17.27*(t_phy(i,k,j)-273.)/ & - (t_phy(i,k,j)-36.))/(.01*p_phy(i,k,j)))) - rel_hum(i,k,j) = max(0.1,rel_hum(i,k,j)) !-- zmid(i,k,j)=phl3d(i,kkp)/g enddo enddo enddo - ! -- the imported atmospheric heat diffusivity is only available up to kte-1 - do k=kts,kte-1 - do i=its,ite - exch_h(i,k,1)=exch(i,k) - enddo - enddo - do j=jts,jte do k=2,kte do i=its,ite @@ -739,24 +796,124 @@ subroutine rrfs_smoke_prep( & ! -- anthropogenic organic carbon do i=its,ite - emis_anoc(i) = emi_in(i,1) + emis_anoc(i) = emi_ant_in(i,1) enddo - if (hour_int<24) then - do j=jts,jte - do i=its,ite - ebb_smoke_hr(i) = smoke_RRFS(i,hour_int+1,1) ! smoke - frp_hr (i) = smoke_RRFS(i,hour_int+1,2) ! frp - frp_std_hr (i) = smoke_RRFS(i,hour_int+1,3) ! std frp - ebu_in (i,j) = ebb_smoke_hr(i) - plume_frp(i,j,p_frp_hr ) = conv_frp* frp_hr (i) - plume_frp(i,j,p_frp_std) = conv_frp* frp_std_hr (i) - enddo - enddo +!---- Calculate PBLH and K-PBL based on virtual potential temperature profile +!---- First calculate THETAV + do j = jts,jte + do i = its,ite + do k = kts,kte + THETA = t_phy(i,k,j) * (1.E5/p_phy(i,k,j))**0.286 + THETAV(i,k,j) = THETA * (1. + 0.61 * (moist(i,k,j,p_qv))) + enddo + enddo + enddo +!---- Now use the UPP code to deterimine the height and level + do i = its, ite + do j = jts, jte + if ( THETAV(i,kts+1,j) .lt. ( THETAV(i,kts,j) + delta_theta4gust) ) then + ZSF = oro(i) + do k = kts+1, kte + k1 = k +!--- give theta-v at the sfc a 0.5K boost in the PBLH definition + if ( THETAV(i,kts+k-1,j) .gt. ( THETAV(i,kts,j) + delta_theta4gust) ) then + exit + endif + enddo + kpbl_thetav(i,j) = k1 + !pblh_thetav(i,j) = zmid(i,k+k1-1,j) * & + ! ((THETAV(i,kts,j)+delta_theta4gust) - THETAV(i,kts+k1-1,j)) & + ! * (zmid(i,kts+k1-1,j) - zmid(i,kts+k1-2,j)) & + ! / (THETAV(i,kts+k1-1,j) - THETAV(i,kts+k1-2,j)) - ZSF + else + !pblh_thetav(i,j) = 0.0 + kpbl_thetav(i,j) = kts + 1 + endif + enddo + enddo + +!---- Calculate wind gust potential and HWP + do i = its,ite + SFCWIND = sqrt(u10m(i)**2+v10m(i)**2) + windgustpot(i,1) = SFCWIND + if (kpbl_thetav(i,1)+1 .ge. kts+1 ) then + do k=kts+1,kpbl_thetav(i,1)+1 + WIND = sqrt(us3d(i,k)**2+vs3d(i,k)**2) + DELWIND = WIND - SFCWIND + DZ = zmid(i,k,1) - oro(i) + DELWIND = DELWIND*(1.0-MIN(0.5,DZ/2000.)) + windgustpot(i,1) = max(windgustpot(i,1),SFCWIND+DELWIND) + enddo + endif + enddo + hwp_local = 0. + do i=its,ite + wdgust=max(windgustpot(i,1),3.) + snoweq=max((25.-snow_cpl(i))/25.,0.) + ! hwp_local(i,1)=0.237*wdgust**1.11*max(t2m(i)-dpt2m(i),15.)**0.92*((1.-wetness(i))**6.95)*snoweq ! Eric original 08/2022 + hwp_local(i,1)=0.177*wdgust**0.97*max(t2m(i)-dpt2m(i),15.)**1.03*((1.-wetness(i))**0.4)*snoweq ! Eric update 11/2023 + enddo +! Set paramters for ebb_dcycle option + if (ebb_dcycle == 1 ) then + if (hour_int .le. 24) then + do j=jts,jte + do i=its,ite + + ebu_in (i,j) = smoke_RRFS(i,hour_int+1,1) ! smoke + frp_in (i,j) = smoke_RRFS(i,hour_int+1,2)*conv_frp ! frp + fire_end_hr(i,j) = 0.0 + hwp_day_avg(i,j) = 0.0 + ebb_smoke_in (i) = ebu_in(i,j) + if (ktau == 1) then + fhist (i,j) = 1. + coef_bb_dc (i,j) = 1. + endif + enddo + enddo + endif endif + ! RAR: here we need to initialize various arrays in order to apply HWP to + ! diurnal cycle + ! if ebb_dcycle/=2 then those arrays=0, we need to read in temporal + if (ebb_dcycle == 2) then + do i=its, ite + do j=jts, jte + ebu_in (i,j) = smoke2d_RRFS(i,1)!/86400. + frp_in (i,j) = smoke2d_RRFS(i,2)*conv_frp + fire_end_hr (i,j) = smoke2d_RRFS(i,3) + hwp_day_avg (i,j) = smoke2d_RRFS(i,4) + ebb_smoke_in(i ) = ebu_in(i,j) + ! Initialize to 1 on first time step, modified by add_emiss_burn thereafter + if (ktau == 1) then + fhist (i,j) = 1. + coef_bb_dc (i,j) = 1. + endif + enddo + enddo + end if - ! We will add a namelist variable, real :: flam_frac_global + if (ktau==1) then + do j=jts,jte + do i=its,ite + if (xlong(i,j)<230.) then + peak_hr(i,j)= 0.0* 3600. ! peak at 24 UTC, fires in Alaska + elseif(xlong(i,j)<245.) then + peak_hr(i,j)= 23.0* 3600. + elseif (xlong(i,j)<260.) then + peak_hr(i,j)= 22.0* 3600. ! peak at 22 UTC, fires in the western US + elseif (xlong(i,j)<275.) then + peak_hr(i,j)= 21.0* 3600. + elseif (xlong(i,j)<290.) then ! peak at 20 UTC, fires in the eastern US + peak_hr(i,j)= 20.0* 3600. + else + peak_hr(i,j)= 19.0* 3600. + endif + enddo + enddo + endif + ! We will add a namelist variable, real :: flam_frac_global do k=kms,kte do i=ims,ime chem(i,k,jts,p_smoke )=max(epsilc,gq0(i,k,ntsmoke )) @@ -765,9 +922,8 @@ subroutine rrfs_smoke_prep( & enddo enddo - - end subroutine rrfs_smoke_prep + !> @} end module rrfs_smoke_wrapper diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index 7b22b9799..fe664d31d 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -1,9 +1,184 @@ [ccpp-table-properties] name = rrfs_smoke_wrapper type = scheme - dependencies = dep_dry_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90 + dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90, dep_dry_mod_emerson.F90,dep_data_mod.F90 ######################################################################## +[ccpp-arg-table] + name = rrfs_smoke_wrapper_init + type = scheme +[seas_opt_in] + standard_name = control_for_smoke_sea_salt + long_name = rrfs smoke sea salt emission option + units = index + dimensions = () + type = integer + intent = in +[drydep_opt_in] + standard_name = control_for_smoke_dry_deposition + long_name = rrfs smoke dry deposition option + units = index + dimensions = () + type = integer + intent = in +[pm_settling_in] + standard_name = control_for_smoke_pm_settling + long_name = rrfs smoke pm settling option + units = index + dimensions = () + type = integer + intent = in +[wetdep_ls_opt_in] + standard_name = control_for_smoke_wet_deposition + long_name = rrfs smoke large scale wet deposition option + units = index + dimensions = () + type = integer + intent = in +[wetdep_ls_alpha_in] + standard_name = alpha_for_ls_wet_depoistion + long_name = alpha paramter for ls wet deposition + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[rrfs_sd] + standard_name = do_smoke_coupling + long_name = flag controlling rrfs_sd collection (default off) + units = flag + dimensions = () + type = logical + intent = in +[do_plumerise_in] + standard_name = do_smoke_plumerise + long_name = rrfs smoke plumerise option + units = index + dimensions = () + type = logical + intent = in +[plumerisefire_frq_in] + standard_name = smoke_plumerise_frequency + long_name = rrfs smoke add smoke option + units = min + dimensions = () + type = integer + intent = in +[wind_eff_opt_in] + standard_name = option_for_wind_effects_on_smoke_plumerise + long_name = wind effect plumerise option + units = index + dimensions = () + type = integer + intent = in +[addsmoke_flag_in] + standard_name = control_for_smoke_biomass_burning_emissions + long_name = rrfs smoke add smoke option + units = index + dimensions = () + type = integer + intent = in +[ebb_dcycle_in] + standard_name = control_for_diurnal_cycle_of_biomass_burning_emissions + long_name = rrfs smoke diurnal cycle option + units = index + dimensions = () + type = integer + intent = in +[smoke_forecast_in] + standard_name = do_smoke_forecast + long_name = index for rrfs smoke forecast + units = index + dimensions = () + type = integer + intent = in +[dust_opt_in] + standard_name = control_for_smoke_dust + long_name = rrfs smoke dust chem option + units = index + dimensions = () + type = integer + intent = in +[dust_alpha_in] + standard_name = alpha_fengsha_dust_scheme + long_name = alpha paramter for fengsha dust scheme + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[dust_gamma_in] + standard_name = gamma_fengsha_dust_scheme + long_name = gamma paramter for fengsha dust scheme + units = none + dimensions = () + type = real + kind = kind_phys + intent = in +[dust_moist_opt_in] + standard_name = control_for_dust_soil_moisture_option + long_name = smoke dust moisture parameterization 1 - fecan 2 - shao + units = index + dimensions = () + type = integer + active = (do_smoke_coupling) + intent = in +[dust_moist_correction_in] + standard_name = dust_moist_correction_fengsha_dust_scheme + long_name = moisture correction term for fengsha dust emission + units = none + dimensions = () + type = real + kind = kind_phys + active = (do_smoke_coupling) + intent = in +[dust_drylimit_factor_in] + standard_name = dust_drylimit_factor_fengsha_dust_scheme + long_name = moisture correction term for drylimit in fengsha dust emission + units = none + dimensions = () + type = real + kind = kind_phys + active = (do_smoke_coupling) + intent = in +[aero_ind_fdb_in] + standard_name = do_smoke_aerosol_indirect_feedback + long_name = flag for rrfs wfa ifa emission + units = flag + dimensions = () + type = logical + intent = in +[extended_sd_diags_in] + standard_name = flag_for_extended_smoke_dust_diagnostics + long_name = flag for extended smoke dust diagnostics + units = flag + dimensions = () + type = logical + intent = in +[dbg_opt_in] + standard_name = do_smoke_debug + long_name = flag for rrfs smoke plumerise debug + units = flag + dimensions = () + type = logical + intent = in +[errmsg] + standard_name = ccpp_error_message + long_name = error message for error handling in CCPP + units = none + dimensions = () + type = character + kind = len=* + intent = out +[errflg] + standard_name = ccpp_error_code + long_name = error code for error handling in CCPP + units = 1 + dimensions = () + type = integer + intent = out + +##################################################################### [ccpp-arg-table] name = rrfs_smoke_wrapper_run type = scheme @@ -224,7 +399,7 @@ type = real kind = kind_phys intent = inout -[vegtype] +[vegtype_dom] standard_name = vegetation_type_classification long_name = vegetation type at each grid cell units = index @@ -238,11 +413,18 @@ dimensions = (horizontal_loop_extent) type = integer intent = in -[sigmaf] - standard_name = bounded_vegetation_area_fraction - long_name = areal fractional cover of green vegetation bounded on the bottom +[nlcat] + standard_name = number_of_vegetation_categories + long_name = number of vegetation categories + units = count + dimensions = () + type = integer + intent = in +[vegtype_frac] + standard_name = fraction_of_vegetation_category + long_name = fraction of horizontal grid area occupied by given vegetation category units = frac - dimensions = (horizontal_loop_extent) + dimensions = (horizontal_loop_extent,number_of_vegetation_categories) type = real kind = kind_phys intent = in @@ -278,6 +460,14 @@ type = real kind = kind_phys intent = in +[recmol] + standard_name = reciprocal_of_obukhov_length + long_name = one over obukhov length + units = m-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [idat] standard_name = date_and_time_at_model_initialization_in_iso_order long_name = initialization date and time @@ -301,14 +491,6 @@ type = real kind = kind_phys intent = in -[exch] - standard_name = atmosphere_heat_diffusivity - long_name = diffusivity for heat - units = m2 s-1 - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in [hf2d] standard_name = instantaneous_surface_upward_sensible_heat_flux long_name = surface upward sensible heat flux valid for current call @@ -365,11 +547,11 @@ type = real kind = kind_phys intent = in -[emi_in] +[emi_ant_in] standard_name = anthropogenic_background_input long_name = anthropogenic background input units = various - dimensions = (horizontal_loop_extent,1) + dimensions = (horizontal_loop_extent,4) type = real kind = kind_phys intent = in @@ -377,7 +559,15 @@ standard_name = emission_smoke_RRFS long_name = emission fire RRFS units = various - dimensions = (horizontal_loop_extent,24,3) + dimensions = (horizontal_loop_extent,24,2) + type = real + kind = kind_phys + intent = in +[smoke2d_RRFS] + standard_name = emission_smoke_prvd_RRFS + long_name = emission fire RRFS daily + units = various + dimensions = (horizontal_dimension,4) type = real kind = kind_phys intent = in @@ -494,7 +684,7 @@ type = real kind = kind_phys intent = inout -[ebb_smoke_hr] +[ebb_smoke_in] standard_name = surface_smoke_emission long_name = emission of surface smoke units = ug m-2 s-1 @@ -502,7 +692,7 @@ type = real kind = kind_phys intent = inout -[frp_hr] +[frp_input] standard_name = frp_hourly long_name = hourly fire radiative power units = MW @@ -510,14 +700,6 @@ type = real kind = kind_phys intent = inout -[frp_std_hr] - standard_name = frp_std_hourly - long_name = hourly stdandard deviation of fire radiative power - units = MW - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = inout [coef_bb] standard_name = coef_bb_dc long_name = coef to estimate the fire emission @@ -558,6 +740,22 @@ type = real kind = kind_phys intent = inout +[drydep_flux_out] + standard_name = dry_deposition_flux + long_name = rrfs dry deposition flux + units = ug m-2 + dimensions = (horizontal_loop_extent,number_of_chemical_species_deposited) + type = real + kind = kind_phys + intent = inout +[wetdpr] + standard_name = mp_wet_deposition_smoke_dust + long_name = large scale wet deposition of smoke and dust + units = kg kg-1 + dimensions = (horizontal_loop_extent,number_of_chemical_species_vertically_mixed) + type = real + kind = kind_phys + intent = inout [hwp] standard_name = hourly_wildfire_potential long_name = rrfs hourly fire weather potential @@ -566,6 +764,14 @@ type = real kind = kind_phys intent = out +[hwp_ave] + standard_name = hourly_wildfire_potential_average + long_name = rrfs hourly fire weather potential average + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout [wetness] standard_name = normalized_soil_wetness_for_land_surface_model long_name = normalized soil wetness @@ -574,22 +780,6 @@ type = real kind = kind_phys intent = in -[smoke_ext] - standard_name = extinction_coefficient_in_air_due_to_smoke - long_name = extinction coefficient in air due to smoke - units = various - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = out -[dust_ext] - standard_name = extinction_coefficient_in_air_due_to_dust - long_name = extinction coefficient in air due to dust - units = various - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = out [ndvel] standard_name = number_of_chemical_species_deposited long_name = number of chemical pbl deposited @@ -605,55 +795,6 @@ type = real kind = kind_phys intent = inout -[rrfs_sd] - standard_name = do_smoke_coupling - long_name = flag controlling rrfs_sd collection (default off) - units = flag - dimensions = () - type = logical - intent = in -[dust_moist_opt_in] - standard_name = control_for_dust_soil_moisture_option - long_name = smoke dust moisture parameterization 1 - fecan 2 - shao - units = index - dimensions = () - type = integer - active = (do_smoke_coupling) - intent = in -[dust_moist_correction_in] - standard_name = dust_moist_correction_fengsha_dust_scheme - long_name = moisture correction term for fengsha dust emission - units = none - dimensions = () - type = real - kind = kind_phys - active = (do_smoke_coupling) - intent = in -[dust_drylimit_factor_in] - standard_name = dust_drylimit_factor_fengsha_dust_scheme - long_name = moisture correction term for drylimit in fengsha dust emission - units = none - dimensions = () - type = real - kind = kind_phys - active = (do_smoke_coupling) - intent = in -[dust_alpha_in] - standard_name = alpha_fengsha_dust_scheme - long_name = alpha paramter for fengsha dust scheme - units = none - dimensions = () - type = real - kind = kind_phys - intent = in -[dust_gamma_in] - standard_name = gamma_fengsha_dust_scheme - long_name = gamma paramter for fengsha dust scheme - units = none - dimensions = () - type = real - kind = kind_phys - intent = in [fire_in] standard_name = smoke_fire_auxiliary_input long_name = smoke fire auxiliary input variables @@ -662,84 +803,6 @@ type = real kind = kind_phys intent = inout -[seas_opt_in] - standard_name = control_for_smoke_sea_salt - long_name = rrfs smoke sea salt emission option - units = index - dimensions = () - type = integer - intent = in -[dust_opt_in] - standard_name = control_for_smoke_dust - long_name = rrfs smoke dust chem option - units = index - dimensions = () - type = integer - intent = in -[drydep_opt_in] - standard_name = control_for_smoke_dry_deposition - long_name = rrfs smoke dry deposition option - units = index - dimensions = () - type = integer - intent = in -[coarsepm_settling_in] - standard_name = control_for_smoke_coarsepm_settling - long_name = rrfs smoke coarsepm settling option - units = index - dimensions = () - type = integer - intent = in -[wetdep_ls_opt_in] - standard_name = control_for_smoke_wet_deposition - long_name = rrfs smoke large scale wet deposition option - units = index - dimensions = () - type = integer - intent = in -[wetdep_ls_alpha_in] - standard_name = alpha_for_ls_wet_depoistion - long_name = alpha paramter for ls wet deposition - units = none - dimensions = () - type = real - kind = kind_phys - intent = in -[do_plumerise_in] - standard_name = do_smoke_plumerise - long_name = rrfs smoke plumerise option - units = index - dimensions = () - type = logical - intent = in -[plumerisefire_frq_in] - standard_name = smoke_plumerise_frequency - long_name = rrfs smoke add smoke option - units = min - dimensions = () - type = integer - intent = in -[addsmoke_flag_in] - standard_name = control_for_smoke_biomass_burning_emissions - long_name = rrfs smoke add smoke option - units = index - dimensions = () - type = integer - intent = in -[smoke_forecast_in] - standard_name = do_smoke_forecast - long_name = index for rrfs smoke forecast - units = index - dimensions = () - type = integer - intent = in -[aero_ind_fdb_in] - standard_name = do_smoke_aerosol_indirect_feedback - long_name = flag for rrfs wfa ifa emission - units = flag - dimensions = () - type = logical - intent = in [fire_heat_flux_out] standard_name = surface_fire_heat_flux long_name = heat flux of fire at the surface @@ -756,12 +819,20 @@ type = real kind = kind_phys intent = out -[dbg_opt_in] - standard_name = do_smoke_debug - long_name = flag for rrfs smoke plumerise debug - units = flag - dimensions = () - type = logical +[kpbl] + standard_name = vertical_index_at_top_of_atmosphere_boundary_layer + long_name = PBL top model level index + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent = in +[oro] + standard_name = height_above_mean_sea_level + long_name = height_above_mean_sea_level + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys intent = in [errmsg] standard_name = ccpp_error_message From 9fb9c05dfc63c90333dafcf038a325c9e6ffe856 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Wed, 6 Dec 2023 18:44:17 +0000 Subject: [PATCH 106/249] Add a namelist option for including surface ocean current in the computation of air-sea fluxes. --- physics/satmedmfvdifq.F | 30 +++++++++++++++----------- physics/satmedmfvdifq.meta | 7 +++++++ physics/sfc_diag.f | 17 ++++++++++----- physics/sfc_diag.meta | 7 +++++++ physics/sfc_diff.f | 32 +++++++++++++++++----------- physics/sfc_diff.meta | 7 +++++++ physics/sfc_nst.f | 43 ++++++++++++++++++++++++-------------- physics/sfc_nst.meta | 7 +++++++ physics/sfc_ocean.F | 42 ++++++++++++++++++++++++------------- physics/sfc_ocean.meta | 7 +++++++ physics/zzz | 12 +++++++++++ 11 files changed, 151 insertions(+), 60 deletions(-) create mode 100755 physics/zzz diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 8a200eb92..9a2214704 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -75,8 +75,8 @@ end subroutine satmedmfvdifq_init !! \section detail_satmedmfvidfq GFS satmedmfvdifq Detailed Algorithm subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & & ntiw,ntke,grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, & - & dv,du,tdt,rtg,u1,v1,t1,q1,ssu,ssv,swh,hlw,xmu, & - & garea,zvfun,sigmaf, & + & dv,du,tdt,rtg,u1,v1,t1,q1,ssu,ssv,iopt_flx_over_ocn, & + & swh,hlw,xmu,garea,zvfun,sigmaf, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,heat,evap,stress,spd1,kpbl, & & prsi,del,prsl,prslk,phii,phil,delt, & @@ -127,6 +127,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_x_wind, index_of_y_wind, index_of_process_pbl + integer, intent(in) :: iopt_flx_over_ocn real(kind=kind_phys), intent(out) :: & & dusfc(:), dvsfc(:), & & dtsfc(:), dqsfc(:), & @@ -143,6 +144,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & !---------------------------------------------------------------------- !*** !*** local variables + real(kind=kind_phys) spd1_m(im) !*** integer i,is,k,n,ndt,km1,kmpbl,kmscu,ntrac1,idtend integer kps,kbx,kmx @@ -280,20 +282,20 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(cs0=0.4,csmf=0.5) parameter(rchck=1.5,ndt=20) - integer ii real(kind=kind_phys) :: ssumax, ssvmax logical :: check_ssu_ssv check_ssu_ssv=.false. - if(check_ssu_ssv) then + if(check_ssu_ssv .and. iopt_flx_over_ocn == 1) then ssumax=0.0 ssvmax=0.0 - do ii=1,im - if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) - if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + do i=1,im + if(ssu(i) .gt. ssumax) ssumax=ssu(i) + if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) enddo write(*,*)'in_satmedmfvdifq,u1 v1',u1(1,1),v1(1,1) - print*, 'in satmedmfvdifq.F ssumax,ssvmax =',ssumax,ssvmax + print*, 'in satmedmfvdifq.F ssumax,ssvmax',ssumax,ssvmax + print*,'in satmedmfvdifq.F iopt_flx_over_ocn',iopt_flx_over_ocn endif if (tc_pbl == 0) then @@ -2393,10 +2395,14 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & enddo enddo do i = 1,im -! dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i) -! dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i) - dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1(i) - dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1(i) + if(iopt_flx_over_ocn == 1) then + spd1_m(i)=sqrt( (u1(i,1)-ssu(i))**2+(v1(i,1)-ssv(i))**2 ) + dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1_m(i) + dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1_m(i) + else + dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i) + dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i) + endif enddo ! if(ldiag3d .and. .not. gen_tend) then diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index b21e5d4f2..4b84d6c65 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -233,6 +233,13 @@ type = real kind = kind_phys intent = in +[iopt_flx_over_ocn] + standard_name = flag_for_air_sea_flux_computation_over_water + long_name = air-sea flux option + units = flag + dimensions = () + type = integer + intent = in [t1] standard_name = air_temperature long_name = layer mean air temperature diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index acfad7b27..5acda6181 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -17,7 +17,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & & lsm,lsm_ruc,grav,cp,eps,epsm1,con_rocp, & & con_karman, & & shflx,cdq,wind, & - & ssu,ssv, & + & ssu,ssv,iopt_flx_over_ocn, & & zf,ps,u1,v1,t1,q1,prslki,evap,fm,fh,fm10,fh2, & & ust,tskin,qsurf,thsfc_loc,diag_flux,diag_log, & & use_lake_model,iopt_lake,iopt_lake_clm, & @@ -31,6 +31,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & implicit none ! integer, intent(in) :: im, lsm, lsm_ruc, iopt_lake, iopt_lake_clm + integer, intent(in) :: iopt_flx_over_ocn logical, intent(in) :: use_lake2m logical, intent(in) :: thsfc_loc ! Flag for reference pot. temp. logical, intent(in) :: diag_flux ! Flag for flux method in 2-m diagnostics @@ -78,14 +79,15 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & errflg = 0 check_ssu_ssv=.false. - if(check_ssu_ssv) then + if(check_ssu_ssv .and. iopt_flx_over_ocn ==1) then ssumax=0.0 ssvmax=0.0 do ii=1,im if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) enddo - print*, 'in sfc_diag ssumax,ssvmax =',ssumax,ssvmax + print*, 'in sfc_diag ssumax ssvmax=', ssumax, ssvmax + print*, 'in sfc_diag iopt_flx_over_ocn=', iopt_flx_over_ocn endif !-- @@ -105,8 +107,13 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & do i = 1, im f10m(i) = fm10(i) / fm(i) - u10m(i) = ssu(i) + f10m(i) * (u1(i)-ssu(i)) - v10m(i) = ssv(i) + f10m(i) * (v1(i)-ssv(i)) + if(iopt_flx_over_ocn ==1) then + u10m(i) = ssu(i) + f10m(i) * (u1(i)-ssu(i)) + v10m(i) = ssv(i) + f10m(i) * (v1(i)-ssv(i)) + else + u10m(i) = f10m(i) * u1(i) + v10m(i) = f10m(i) * v1(i) + endif have_2m = use_lake_model(i)>0 .and. use_lake2m .and. & & iopt_lake==iopt_lake_clm if(have_2m) then diff --git a/physics/sfc_diag.meta b/physics/sfc_diag.meta index 9a8a5517e..834ad5871 100644 --- a/physics/sfc_diag.meta +++ b/physics/sfc_diag.meta @@ -139,6 +139,13 @@ type = real kind = kind_phys intent = in +[iopt_flx_over_ocn] + standard_name = flag_for_air_sea_flux_computation_over_water + long_name = air-sea flux option + units = flag + dimensions = () + type = integer + intent = in [t1] standard_name = air_temperature_at_surface_adjacent_layer long_name = 1st model layer air temperature diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 58614c452..62102151a 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -61,7 +61,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) - & u1,v1,ssu,ssv, & + & u1,v1,ssu,ssv,iopt_flx_over_ocn, & & wet,dry,icy, & !intent(in) & thsfc_loc, & !intent(in) & tskin_wat, tskin_lnd, tskin_ice, & !intent(in) @@ -86,6 +86,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) integer, parameter :: kp = kind_phys integer, intent(in) :: im, ivegsrc integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean + integer, intent(in) :: iopt_flx_over_ocn ! option for including ocean current in the computation of flux integer, dimension(:), intent(in) :: vegtype @@ -129,10 +130,10 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) integer i integer ii real(kind=kind_phys) :: ssumax, ssvmax - real(kind=kind_phys), dimension(im) :: windrel + real(kind=kind_phys), dimension(im) :: windrel, wind10m logical :: check_ssu_ssv ! - real(kind=kind_phys) :: rat, tv1, thv1, restar, wind10m, + real(kind=kind_phys) :: rat, tv1, thv1, restar, & czilc, tem1, tem2, virtfac ! @@ -176,7 +177,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) check_ssu_ssv=.false. - if(check_ssu_ssv) then + if(check_ssu_ssv .and. iopt_flx_over_ocn == 1) then ssumax=0.0 ssvmax=0.0 do ii=1,im @@ -184,11 +185,18 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) enddo print*, 'in sfc_diff ssumax,ssvmax =',ssumax,ssvmax + print*, 'in sfc_diff iopt_flx_over_ocn =',iopt_flx_over_ocn print*, 'in sfc_diff wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) + do i=1,im + windrel(i)=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + wind10m(i)= sqrt( (u10m(i)-ssu(i))**2 + (v10m(i)-ssv(i))**2 ) + enddo + else + do i=1,im + wind10m(i)= sqrt( u10m(i)**2 + v10m(i)**2 ) + windrel(i)=wind(i) + enddo endif - do i=1,im - windrel(i)=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) - enddo do i=1,im if(flag_iter(i)) then @@ -375,7 +383,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0 = 0.01_kp * z0rl_wat(i) z0max = max(zmin, min(z0,z1(i))) ! ustar_wat(i) = sqrt(grav * z0 / charnock) - wind10m = sqrt(u10m(i)*u10m(i)+v10m(i)*v10m(i)) +! wind10m = sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) !** test xubin's new z0 @@ -394,9 +402,9 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ztmax_wat(i) = max(z0max * exp(-rat), zmin) ! if (sfc_z0_type == 6) then - call znot_t_v6(wind10m, ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) + call znot_t_v6(wind10m(i), ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) else if (sfc_z0_type == 7) then - call znot_t_v7(wind10m, ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) + call znot_t_v7(wind10m(i), ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) else if (sfc_z0_type > 0) then write(0,*)'no option for sfc_z0_type=',sfc_z0_type errflg = 1 @@ -437,10 +445,10 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) endif elseif (sfc_z0_type == 6) then ! wang - call znot_m_v6(wind10m, z0) ! wind, m/s, z0, m + call znot_m_v6(wind10m(i), z0) ! wind, m/s, z0, m z0rl_wat(i) = 100.0_kp * z0 ! cm elseif (sfc_z0_type == 7) then ! wang - call znot_m_v7(wind10m, z0) ! wind, m/s, z0, m + call znot_m_v7(wind10m(i), z0) ! wind, m/s, z0, m z0rl_wat(i) = 100.0_kp * z0 ! cm else z0rl_wat(i) = 1.0e-4_kp diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index 80a89fc1b..360c2a0c8 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -249,6 +249,13 @@ dimensions = () type = integer intent = in +[iopt_flx_over_ocn] + standard_name = flag_for_air_sea_flux_computation_over_water + long_name = air-sea flux option + units = flag + dimensions = () + type = integer + intent = in [wet] standard_name = flag_nonzero_wet_surface_fraction long_name = flag indicating presence of some ocean or lake surface area fraction diff --git a/physics/sfc_nst.f b/physics/sfc_nst.f index 526271aa3..92d7b9c63 100644 --- a/physics/sfc_nst.f +++ b/physics/sfc_nst.f @@ -16,8 +16,8 @@ module sfc_nst !> \section NSST_general_algorithm GFS Near-Surface Sea Temperature Scheme General Algorithm subroutine sfc_nst_run & & ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs: - & pi, tgice, sbc, ps, u1, v1, ssu, ssv, t1, q1, tref, cm, ch,& - & lseaspray, fm, fm10, & + & pi, tgice, sbc, ps, u1, v1, ssu, ssv, iopt_flx_over_ocn, & + & t1, q1, tref, cm, ch, lseaspray, fm, fm10, & & prsl1, prslki, prsik1, prslk1, wet, use_lake_model, xlon, & & sinlat, stress, & & sfcemis, dlwflx, sfcnsw, rain, timestep, kdt, solhr,xcosz, & @@ -36,8 +36,8 @@ subroutine sfc_nst_run & ! ! ! call sfc_nst ! ! inputs: ! -! ( im, ps, u1, v1, ssu,ssv, t1, q1, tref, cm, ch, ! -! lseaspray, fm, fm10, ! +! ( im, ps, u1, v1, ssu,ssv, iopt_flx_over_ocn, ! +! t1, q1, tref, cm, ch, lseaspray, fm, fm10, ! ! prsl1, prslki, wet, use_lake_model, xlon, sinlat, stress, ! ! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, ! ! wind, flag_iter, flag_guess, nstf_name1, nstf_name4, ! @@ -76,6 +76,8 @@ subroutine sfc_nst_run & ! ps - real, surface pressure (pa) im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! ! ssu, ssv - real, u/v component of surface current (m/s) im ! +! iopt_flx_over_ocn - integer, option to include 1 ! +! ocean current in the computation of flux ! ! t1 - real, surface layer mean temperature ( k ) im ! ! q1 - real, surface layer mean specific humidity im ! ! tref - real, reference/foundation temperature ( k ) im ! @@ -182,7 +184,7 @@ subroutine sfc_nst_run & ! --- inputs: integer, intent(in) :: im, kdt, ipr, nstf_name1, nstf_name4, & - & nstf_name5 + & nstf_name5, iopt_flx_over_ocn 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, & @@ -260,26 +262,35 @@ subroutine sfc_nst_run & & ws10cr=30., conlf=7.2e-9, consf=6.4e-8 ! - integer ii real(kind=kind_phys) :: ssumax, ssvmax - real(kind=kind_phys) :: windrel - logical :: check_ssu_ssv + real(kind=kind_phys) :: windrel(im) + logical :: check_ssu_ssv !====================================================================================================== cc ! Initialize CCPP error handling variables errmsg = '' errflg = 0 check_ssu_ssv=.false. - if(check_ssu_ssv) then + if(check_ssu_ssv .and. iopt_flx_over_ocn ==1) then ssumax=0.0 ssvmax=0.0 - do ii=1,im - if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) - if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + do i=1,im + if(ssu(i) .gt. ssumax) ssumax=ssu(i) + if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) enddo print*, 'in sfc_nst ssumax,ssvmax =',ssumax,ssvmax + print*, 'in sfc_nst iopt_flx_over_ocn =',iopt_flx_over_ocn print*, 'in sfc_nst wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) endif + if(iopt_flx_over_ocn ==1) then + do i=1,im + windrel(i) = sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + enddo + else + do i=1,im + windrel(i) = wind(i) + enddo + endif if (nstf_name1 == 0) return ! No NSST model used @@ -351,10 +362,10 @@ subroutine sfc_nst_run & ! --- ... rcp = rho cp ch v - windrel = sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) - rch(i) = rho_a(i) * cp * ch(i) * windrel - cmm(i) = cm (i) * windrel - chh(i) = rho_a(i) * ch(i) * windrel + !windrel = sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + rch(i) = rho_a(i) * cp * ch(i) * windrel(i) + cmm(i) = cm (i) * windrel(i) + chh(i) = rho_a(i) * ch(i) * windrel(i) !> - Calculate latent and sensible heat flux over open water with tskin. ! at previous time step diff --git a/physics/sfc_nst.meta b/physics/sfc_nst.meta index 10330fbb3..eb5a2d379 100644 --- a/physics/sfc_nst.meta +++ b/physics/sfc_nst.meta @@ -150,6 +150,13 @@ type = real kind = kind_phys intent = in +[iopt_flx_over_ocn] + standard_name = flag_for_air_sea_flux_computation_over_water + long_name = air-sea flux option + units = flag + dimensions = () + type = integer + intent = in [t1] standard_name = air_temperature_at_surface_adjacent_layer long_name = surface layer mean temperature diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index 7e3c7c46a..27e309eca 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -24,7 +24,8 @@ subroutine sfc_ocean_run & !................................... ! --- inputs: & ( im, hvap, cp, rd, eps, epsm1, rvrdm1, ps, u1, v1, t1, q1, & - & tskin, cm, ch, lseaspray, fm, fm10, ssu, ssv, & + & tskin, cm, ch, lseaspray, fm, fm10, & + & ssu, ssv, iopt_flx_over_ocn, & & prsl1, prslki, wet, use_lake_model, wind, &, ! --- inputs & flag_iter, use_med_flux, dqsfc_med, dtsfc_med, & & qsurf, cmm, chh, gflux, evap, hflx, ep, & ! --- outputs @@ -39,6 +40,7 @@ subroutine sfc_ocean_run & ! call sfc_ocean ! ! inputs: ! ! ( im, ps, u1, v1, t1, q1, tskin, cm, ch, lseaspray, fm, fm10, ! +! ssu, ssv, iopt_flx_over_ocn, ! ! prsl1, prslki, wet, use_lake_model, wind, flag_iter, ! ! use_med_flux, ! ! outputs: ! @@ -67,6 +69,8 @@ subroutine sfc_ocean_run & ! ps - real, surface pressure im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! ! ssu,ssv - real, u/v component of surface ocean current (m/s) im ! +! iopt_flx_over_ocn - integer, option for including 1 ! +! ocean current in the computation of flux ! ! t1 - real, surface layer mean temperature ( k ) im ! ! q1 - real, surface layer mean specific humidity im ! ! tskin - real, ground surface skin temperature ( k ) im ! @@ -106,6 +110,7 @@ subroutine sfc_ocean_run & & zero = 0.0_kind_phys, qmin = 1.0e-8_kind_phys ! --- inputs: integer, intent(in) :: im + integer, intent(in) :: iopt_flx_over_ocn real (kind=kind_phys), intent(in) :: hvap, cp, rd, & & eps, epsm1, rvrdm1 @@ -135,11 +140,10 @@ subroutine sfc_ocean_run & ! --- locals: real (kind=kind_phys) :: qss, rch, tem, - & elocp, cpinv, hvapi, windrel + & elocp, cpinv, hvapi, windrel(im) real (kind=kind_phys), dimension(im) :: rho, q0 integer :: i - integer :: ii real (kind=kind_phys) :: ssumax,ssvmax !logical,save :: check_ssu_ssv=.true. logical :: check_ssu_ssv @@ -164,15 +168,25 @@ subroutine sfc_ocean_run & errmsg = '' errflg = 0 check_ssu_ssv=.false. - if(check_ssu_ssv) then + if(check_ssu_ssv .and. iopt_flx_over_ocn == 1) then ssumax=0.0 ssvmax=0.0 - do ii=1,im - if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) - if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) + do i=1,im + if(ssu(i) .gt. ssumax) ssumax=ssu(i) + if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) enddo - print *, 'in sfc_ocean ssumax ssvmax',ssumax, ssvmax + print *, 'in sfc_ocean ssumax,ssvmax',ssumax,ssvmax + print *, 'in sfc_ocean iopt_flx_over_ocn',iopt_flx_over_ocn endif + if(iopt_flx_over_ocn == 1) then + do i=1,im + windrel(i) = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) + enddo + else + do i=1,im + windrel(i) = wind(i) + enddo + endif cpinv = one/cp hvapi = one/hvap @@ -187,12 +201,11 @@ subroutine sfc_ocean_run & if ( flag(i) ) then if (use_med_flux) then - windrel = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) q0(i) = max( q1(i), qmin ) rho(i) = prsl1(i) / (rd*t1(i)*(one + rvrdm1*q0(i))) - tem = ch(i) * windrel - cmm(i) = cm(i) * windrel + tem = ch(i) * windrel(i) + cmm(i) = cm(i) * windrel(i) chh(i) = rho(i) * tem hflx(i) = dtsfc_med(i) @@ -209,10 +222,9 @@ subroutine sfc_ocean_run & ! --- ... rcp = rho cp ch v - windrel = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) - rch = rho(i) * cp * ch(i) * windrel - tem = ch(i) * windrel - cmm(i) = cm(i) * windrel + rch = rho(i) * cp * ch(i) * windrel(i) + tem = ch(i) * windrel(i) + cmm(i) = cm(i) * windrel(i) chh(i) = rho(i) * tem !> - Calcualte sensible and latent heat flux over open water diff --git a/physics/sfc_ocean.meta b/physics/sfc_ocean.meta index 7d2e55e27..f99d74773 100644 --- a/physics/sfc_ocean.meta +++ b/physics/sfc_ocean.meta @@ -102,6 +102,13 @@ type = real kind = kind_phys intent = in +[iopt_flx_over_ocn] + standard_name = flag_for_air_sea_flux_computation_over_water + long_name = air-sea flux option + units = flag + dimensions = () + type = integer + intent = in [t1] standard_name = air_temperature_at_surface_adjacent_layer long_name = surface layer mean temperature diff --git a/physics/zzz b/physics/zzz new file mode 100755 index 000000000..e9bd2da01 --- /dev/null +++ b/physics/zzz @@ -0,0 +1,12 @@ +#!/bin/sh +export src1=/scratch1/NCEPDEV/stmp4/Bin.Li/20231201/ufs-weather-model/FV3/ccpp/physics/physics +cp $src1/satmedmfvdifq.F . +cp $src1/satmedmfvdifq.meta . +cp $src1/sfc_diff.f . +cp $src1/sfc_diff.meta . +cp $src1/sfc_diag.f . +cp $src1/sfc_diag.meta . +cp $src1/sfc_nst.f . +cp $src1/sfc_nst.meta . +cp $src1/sfc_ocean.F . +cp $src1/sfc_ocean.meta . From 8180a05c4c44af50767d3cd32c724a9de6f2d21e Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 7 Dec 2023 16:59:57 +0000 Subject: [PATCH 107/249] Omission from previous merge --- physics/SFC_Layer/UFS/sfc_nst.f | 696 ------------------- physics/{ => SFC_Layer/UFS}/sfc_nst.f90 | 0 physics/SFC_Layer/UFS/sfc_nst_post.f | 93 --- physics/{ => SFC_Layer/UFS}/sfc_nst_post.f90 | 0 physics/SFC_Layer/UFS/sfc_nst_pre.f | 96 --- physics/{ => SFC_Layer/UFS}/sfc_nst_pre.f90 | 0 6 files changed, 885 deletions(-) delete mode 100644 physics/SFC_Layer/UFS/sfc_nst.f rename physics/{ => SFC_Layer/UFS}/sfc_nst.f90 (100%) delete mode 100644 physics/SFC_Layer/UFS/sfc_nst_post.f rename physics/{ => SFC_Layer/UFS}/sfc_nst_post.f90 (100%) delete mode 100644 physics/SFC_Layer/UFS/sfc_nst_pre.f rename physics/{ => SFC_Layer/UFS}/sfc_nst_pre.f90 (100%) diff --git a/physics/SFC_Layer/UFS/sfc_nst.f b/physics/SFC_Layer/UFS/sfc_nst.f deleted file mode 100644 index 2ca70666d..000000000 --- a/physics/SFC_Layer/UFS/sfc_nst.f +++ /dev/null @@ -1,696 +0,0 @@ -!>\file sfc_nst.f -!! This file contains the GFS NSST model. - -!> This module contains the CCPP-compliant GFS near-surface sea temperature scheme. - module sfc_nst - - contains - -!>\defgroup gfs_nst_main_mod GFS Near-Surface Sea Temperature Module -!! This module contains the CCPP-compliant GFS near-surface sea temperature scheme. -!> @{ -!! This subroutine calls the Thermal Skin-layer and Diurnal Thermocline models to update the NSST profile. -!! \section arg_table_sfc_nst_run Argument Table -!! \htmlinclude sfc_nst_run.html -!! -!> \section NSST_general_algorithm GFS Near-Surface Sea Temperature Scheme General Algorithm - subroutine sfc_nst_run & - & ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs: - & pi, tgice, sbc, ps, u1, v1, t1, q1, tref, cm, ch, & - & lseaspray, fm, fm10, & - & prsl1, prslki, prsik1, prslk1, wet, use_lake_model, xlon, & - & sinlat, stress, & - & sfcemis, dlwflx, sfcnsw, rain, timestep, kdt, solhr,xcosz, & - & wind, flag_iter, flag_guess, nstf_name1, nstf_name4, & - & nstf_name5, lprnt, ipr, thsfc_loc, & - & tskin, tsurf, xt, xs, xu, xv, xz, zm, xtts, xzts, dt_cool, & ! --- input/output: - & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain, & - & qsurf, gflux, cmm, chh, evap, hflx, ep, errmsg, errflg & ! --- outputs: - & ) -! -! ===================================================================== ! -! description: ! -! ! -! ! -! usage: ! -! ! -! call sfc_nst ! -! inputs: ! -! ( im, ps, u1, v1, t1, q1, tref, cm, ch, ! -! lseaspray, fm, fm10, ! -! prsl1, prslki, wet, use_lake_model, xlon, sinlat, stress, ! -! sfcemis, dlwflx, sfcnsw, rain, timestep, kdt,solhr,xcosz, ! -! wind, flag_iter, flag_guess, nstf_name1, nstf_name4, ! -! nstf_name5, lprnt, ipr, thsfc_loc, ! -! input/outputs: ! -! tskin, tsurf, 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: -! qsurf, gflux, cmm, chh, evap, hflx, ep ! -! ) -! ! -! ! -! subprogram/functions called: w3movdat, iw3jdn, fpvs, density, ! -! rhocoef, cool_skin, warm_layer, jacobi_temp. ! -! ! -! program history log: ! -! 2007 -- xu li createad original code ! -! 2008 -- s. moorthi adapted to the parallel version ! -! may 2009 -- y.-t. hou modified to include input lw surface ! -! emissivity from radiation. also replaced the ! -! often comfusing combined sw and lw suface ! -! flux with separate sfc net sw flux (defined ! -! as dn-up) and lw flux. added a program doc block. ! -! sep 2009 -- s. moorthi removed rcl and additional reformatting ! -! and optimization + made pa as input pressure unit.! -! 2009 -- xu li recreatead the code ! -! feb 2010 -- s. moorthi added some changes made to the previous ! -! version ! -! Jul 2016 -- X. Li, modify the diurnal warming event reset ! -! ! -! ! -! ==================== definition of variables ==================== ! -! ! -! inputs: size ! -! im - integer, horiz dimension 1 ! -! ps - real, surface pressure (pa) im ! -! u1, v1 - real, u/v component of surface layer wind (m/s) im ! -! t1 - real, surface layer mean temperature ( k ) im ! -! q1 - real, surface layer mean specific humidity im ! -! tref - real, reference/foundation temperature ( k ) im ! -! cm - real, surface exchange coeff for momentum (m/s) im ! -! ch - real, surface exchange coeff heat & moisture(m/s) im ! -! lseaspray- logical, .t. for parameterization for sea spray 1 ! -! fm - real, a stability profile function for momentum im ! -! fm10 - real, a stability profile function for momentum im ! -! at 10m ! -! prsl1 - real, surface layer mean pressure (pa) im ! -! prslki - real, im ! -! prsik1 - real, im ! -! prslk1 - real, im ! -! wet - logical, =T if any ocn/lake water (F otherwise) im ! -! use_lake_model- logical, =T if flake model is used for lake im ! -! icy - logical, =T if any ice im ! -! xlon - real, longitude (radians) im ! -! sinlat - real, sin of latitude im ! -! stress - real, wind stress (n/m**2) im ! -! sfcemis - real, sfc lw emissivity (fraction) im ! -! dlwflx - real, total sky sfc downward lw flux (w/m**2) im ! -! sfcnsw - real, total sky sfc netsw flx into ocean (w/m**2) im ! -! rain - real, rainfall rate (kg/m**2/s) im ! -! timestep - real, timestep interval (second) 1 ! -! kdt - integer, time step counter 1 ! -! solhr - real, fcst hour at the end of prev time step 1 ! -! xcosz - real, consine of solar zenith angle 1 ! -! wind - real, wind speed (m/s) im ! -! flag_iter- logical, execution or not im ! -! when iter = 1, flag_iter = .true. for all grids im ! -! when iter = 2, flag_iter = .true. when wind < 2 im ! -! for both land and ocean (when nstf_name1 > 0) im ! -! flag_guess-logical, .true.= guess step to get CD et al im ! -! when iter = 1, flag_guess = .true. when wind < 2 im ! -! when iter = 2, flag_guess = .false. for all grids im ! -! nstf_name - integers , NSST related flag parameters 1 ! -! nstf_name1 : 0 = NSSTM off 1 ! -! 1 = NSSTM on but uncoupled 1 ! -! 2 = NSSTM on and coupled 1 ! -! nstf_name4 : zsea1 in mm 1 ! -! nstf_name5 : zsea2 in mm 1 ! -! lprnt - logical, control flag for check print out 1 ! -! ipr - integer, grid index for check print out 1 ! -! thsfc_loc- logical, flag for reference pressure in theta 1 ! -! ! -! input/outputs: -! li added for oceanic components -! tskin - real, ocean surface skin temperature ( k ) im ! -! tsurf - real, the same as tskin ( k ) but for guess run im ! -! xt - real, heat content in dtl im ! -! xs - real, salinity content in dtl im ! -! xu - real, u-current content in dtl im ! -! xv - real, v-current content in dtl im ! -! xz - real, dtl thickness im ! -! zm - real, mxl thickness im ! -! xtts - real, d(xt)/d(ts) im ! -! xzts - real, d(xz)/d(ts) im ! -! dt_cool - real, sub-layer cooling amount im ! -! d_conv - real, thickness of free convection layer (fcl) im ! -! z_c - sub-layer cooling thickness im ! -! c_0 - coefficient1 to calculate d(tz)/d(ts) im ! -! c_d - coefficient2 to calculate d(tz)/d(ts) im ! -! w_0 - coefficient3 to calculate d(tz)/d(ts) im ! -! w_d - coefficient4 to calculate d(tz)/d(ts) im ! -! ifd - real, index to start dtlm run or not im ! -! qrain - real, sensible heat flux due to rainfall (watts) im ! - -! outputs: ! - -! qsurf - real, surface air saturation specific humidity im ! -! gflux - real, soil heat flux (w/m**2) im ! -! cmm - real, im ! -! chh - real, im ! -! evap - real, evaperation from latent heat flux im ! -! hflx - real, sensible heat flux im ! -! ep - real, potential evaporation im ! -! ! -! ===================================================================== ! - use machine , only : kind_phys - use funcphys, only : fpvs - use date_def, only : idate - use module_nst_water_prop, only: get_dtzm_point - use module_nst_parameters, only : t0k,cp_w,omg_m,omg_sh, & - & sigma_r,solar_time_6am,ri_c,z_w_max,delz,wd_max, & - & rad2deg,const_rot,tau_min,tw_max,sst_max - use module_nst_water_prop, only: solar_time_from_julian, & - & density,rhocoef,compjd,grv & - &, sw_ps_9b - use nst_module, only : cool_skin,dtm_1p,cal_w,cal_ttop, & - & convdepth,dtm_1p_fca,dtm_1p_tla, & - & dtm_1p_mwa,dtm_1p_mda,dtm_1p_mta, & - & dtl_reset -! - implicit none - - integer, parameter :: kp = kind_phys -! -! --- constant parameters: - real (kind=kind_phys), parameter :: f24 = 24.0_kp ! hours/day - real (kind=kind_phys), parameter :: f1440 = 1440.0_kp ! minutes/day - real (kind=kind_phys), parameter :: czmin = 0.0001_kp ! cos(89.994) - real (kind=kind_phys), parameter :: zero = 0.0_kp, one = 1.0_kp - - -! --- inputs: - integer, intent(in) :: im, kdt, ipr, nstf_name1, nstf_name4, & - & nstf_name5 - 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, & - & t1, q1, tref, cm, ch, fm, fm10, & - & prsl1, prslki, prsik1, prslk1, xlon, xcosz, & - & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind - real (kind=kind_phys), intent(in) :: timestep - real (kind=kind_phys), intent(in) :: solhr - -! For sea spray effect - logical, intent(in) :: lseaspray -! - logical, dimension(:), intent(in) :: flag_iter, flag_guess, wet - integer, dimension(:), intent(in) :: use_lake_model -! &, icy - logical, intent(in) :: lprnt - logical, intent(in) :: thsfc_loc - -! --- 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, & - & z_c, c_0, c_d, w_0, w_d, d_conv, ifd, qrain - -! --- outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: & - & qsurf, gflux, cmm, chh, evap, hflx, ep - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! -! locals -! - integer :: k,i -! - real (kind=kind_phys), dimension(im) :: q0, qss, rch, - & rho_a, theta1, tv1, wndmag - - real(kind=kind_phys) elocp,tem,cpinv,hvapi -! -! nstm related prognostic fields -! - logical flag(im) - real (kind=kind_phys), dimension(im) :: - & xt_old, xs_old, xu_old, xv_old, xz_old,zm_old,xtts_old, - & xzts_old, ifd_old, tref_old, tskin_old, dt_cool_old,z_c_old - - real(kind=kind_phys) ulwflx(im), nswsfc(im) -! real(kind=kind_phys) rig(im), -! & ulwflx(im),dlwflx(im), -! & slrad(im),nswsfc(im) - real(kind=kind_phys) alpha,beta,rho_w,f_nsol,sss,sep, - & cosa,sina,taux,tauy,grav,dz,t0,ttop0,ttop - - real(kind=kind_phys) le,fc,dwat,dtmp,wetc,alfac,ustar_a,rich - real(kind=kind_phys) rnl_ts,hs_ts,hl_ts,rf_ts,q_ts - real(kind=kind_phys) fw,q_warm - real(kind=kind_phys) t12,alon,tsea,sstc,dta,dtz - real(kind=kind_phys) zsea1,zsea2,soltim - logical do_nst - -! external functions called: iw3jdn - integer :: iw3jdn -! -! parameters for sea spray effect -! - real (kind=kind_phys) :: f10m, u10m, v10m, ws10, ru10, qss1, - & bb1, hflxs, evaps, ptem -! -! real (kind=kind_phys), parameter :: alps=0.5, bets=0.5, gams=0.1, -! real (kind=kind_phys), parameter :: alps=0.5, bets=0.5, gams=0.0, -! real (kind=kind_phys), parameter :: alps=1.0, bets=1.0, gams=0.2, - real (kind=kind_phys), parameter :: alps=0.75,bets=0.75,gams=0.15, - & ws10cr=30., conlf=7.2e-9, consf=6.4e-8 -! -!====================================================================================================== -cc - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - if (nstf_name1 == 0) return ! No NSST model used - - cpinv = one/cp - hvapi = one/hvap - elocp = hvap/cp - - sss = 34.0_kp ! temporarily, when sea surface salinity data is not ready -! -! flag for open water and where the iteration is on -! - do_nst = .false. - do i = 1, im -! flag(i) = wet(i) .and. .not.icy(i) .and. flag_iter(i) - flag(i) = wet(i) .and. flag_iter(i) .and. use_lake_model(i)/=1 - do_nst = do_nst .or. flag(i) - enddo - if (.not. do_nst) return -! -! save nst-related prognostic fields for guess run -! - do i=1, im -! if(wet(i) .and. .not.icy(i) .and. flag_guess(i)) then - if(wet(i) .and. flag_guess(i) .and. use_lake_model(i)/=1) then - xt_old(i) = xt(i) - xs_old(i) = xs(i) - xu_old(i) = xu(i) - xv_old(i) = xv(i) - xz_old(i) = xz(i) - zm_old(i) = zm(i) - xtts_old(i) = xtts(i) - xzts_old(i) = xzts(i) - ifd_old(i) = ifd(i) - tskin_old(i) = tskin(i) - dt_cool_old(i) = dt_cool(i) - z_c_old(i) = z_c(i) - endif - enddo - - -! --- ... initialize variables. all units are m.k.s. unless specified. -! ps is in pascals, wind is wind speed, theta1 is surface air -! estimated from level 1 temperature, rho_a is air density and -! qss is saturation specific humidity at the water surface -!! - do i = 1, im - if ( flag(i) ) then - - nswsfc(i) = sfcnsw(i) ! net solar radiation at the air-sea surface (positive downward) - wndmag(i) = sqrt(u1(i)*u1(i) + v1(i)*v1(i)) - - q0(i) = max(q1(i), 1.0e-8_kp) - - if(thsfc_loc) then ! Use local potential temperature - theta1(i) = t1(i) * prslki(i) - else ! Use potential temperature referenced to 1000 hPa - theta1(i) = t1(i) / prslk1(i) ! potential temperature at the middle of lowest model layer - endif - - tv1(i) = t1(i) * (one + rvrdm1*q0(i)) - rho_a(i) = prsl1(i) / (rd*tv1(i)) - qss(i) = fpvs(tsurf(i)) ! pa - qss(i) = eps*qss(i) / (ps(i) + epsm1*qss(i)) ! pa -! - evap(i) = zero - hflx(i) = zero - gflux(i) = zero - ep(i) = zero - -! --- ... rcp = rho cp ch v - - rch(i) = rho_a(i) * cp * ch(i) * wind(i) - cmm(i) = cm (i) * wind(i) - chh(i) = rho_a(i) * ch(i) * wind(i) - -!> - Calculate latent and sensible heat flux over open water with tskin. -! at previous time step - evap(i) = elocp * rch(i) * (qss(i) - q0(i)) - qsurf(i) = qss(i) - - if(thsfc_loc) then ! Use local potential temperature - hflx(i) = rch(i) * (tsurf(i) - theta1(i)) - else ! Use potential temperature referenced to 1000 hPa - hflx(i) = rch(i) * (tsurf(i)/prsik1(i) - theta1(i)) - endif - -! if (lprnt .and. i == ipr) print *,' tskin=',tskin(i),' theta1=', -! & theta1(i),' hflx=',hflx(i),' t1=',t1(i),'prslki=',prslki(i) -! &,' tsurf=',tsurf(i) - endif - enddo - -! run nst model: dtm + slm -! - zsea1 = 0.001_kp*real(nstf_name4) - zsea2 = 0.001_kp*real(nstf_name5) - -!> - Call module_nst_water_prop::density() to compute sea water density. -!> - Call module_nst_water_prop::rhocoef() to compute thermal expansion -!! coefficient (\a alpha) and saline contraction coefficient (\a beta). - do i = 1, im - if ( flag(i) ) then - tsea = tsurf(i) - t12 = tsea*tsea - ulwflx(i) = sfcemis(i) * sbc * t12 * t12 - alon = xlon(i)*rad2deg - grav = grv(sinlat(i)) - soltim = mod(alon/15.0_kp + solhr, 24.0_kp)*3600.0_kp - call density(tsea,sss,rho_w) ! sea water density - call rhocoef(tsea,sss,rho_w,alpha,beta) ! alpha & beta -! -!> - Calculate sensible heat flux (\a qrain) due to rainfall. -! - le = (2.501_kp-0.00237_kp*tsea)*1e6_kp - dwat = 2.11e-5_kp*(t1(i)/t0k)**1.94_kp ! water vapor diffusivity - dtmp = (one+3.309e-3_kp*(t1(i)-t0k)-1.44e-6_kp*(t1(i)-t0k) - & * (t1(i)-t0k))*0.02411_kp/(rho_a(i)*cp) ! heat diffusivity - wetc = 622.0_kp*le*qss(i)/(rd*t1(i)*t1(i)) - alfac = one / (one + (wetc*le*dwat)/(cp*dtmp)) ! wet bulb factor - tem = (1.0e3_kp * rain(i) / rho_w) * alfac * cp_w - qrain(i) = tem * (tsea-t1(i)+1.0e3_kp*(qss(i)-q0(i))*le/cp) - -!> - Calculate input non solar heat flux as upward = positive to models here - - f_nsol = hflx(i) + evap(i) + ulwflx(i) - dlwflx(i) - & + omg_sh*qrain(i) - -! if (lprnt .and. i == ipr) print *,' f_nsol=',f_nsol,' hflx=', -! &hflx(i),' evap=',evap(i),' ulwflx=',ulwflx(i),' dlwflx=',dlwflx(i) -! &,' omg_sh=',omg_sh,' qrain=',qrain(i) - - sep = sss*(evap(i)/le-rain(i))/rho_w - ustar_a = sqrt(stress(i)/rho_a(i)) ! air friction velocity -! -! sensitivities of heat flux components to ts -! - rnl_ts = 4.0_kp*sfcemis(i)*sbc*tsea*tsea*tsea ! d(rnl)/d(ts) - hs_ts = rch(i) - hl_ts = rch(i)*elocp*eps*hvap*qss(i)/(rd*t12) - rf_ts = tem * (one+rch(i)*hl_ts) - q_ts = rnl_ts + hs_ts + hl_ts + omg_sh*rf_ts -! -!> - Call cool_skin(), which is the sub-layer cooling parameterization -!! (Fairfall et al. (1996) \cite fairall_et_al_1996). -! & calculate c_0, c_d -! - call cool_skin(ustar_a,f_nsol,nswsfc(i),evap(i),sss,alpha,beta - &, rho_w,rho_a(i),tsea,q_ts,hl_ts,grav,le - &, dt_cool(i),z_c(i),c_0(i),c_d(i)) - - tem = one / wndmag(i) - cosa = u1(i)*tem - sina = v1(i)*tem - taux = max(stress(i),tau_min)*cosa - tauy = max(stress(i),tau_min)*sina - fc = const_rot*sinlat(i) -! -! Run DTM-1p system. -! - if ( (soltim > solar_time_6am .and. ifd(i) == zero) ) then - else - ifd(i) = one -! -! calculate fcl thickness with current forcing and previous time's profile -! -! if (lprnt .and. i == ipr) print *,' beg xz=',xz(i) - -!> - Call convdepth() to calculate depth for convective adjustments. - if ( f_nsol > zero .and. xt(i) > zero ) then - call convdepth(kdt,timestep,nswsfc(i),f_nsol,sss,sep,rho_w - &, alpha,beta,xt(i),xs(i),xz(i),d_conv(i)) - else - d_conv(i) = zero - endif - -! if (lprnt .and. i == ipr) print *,' beg xz1=',xz(i) -! -! determine rich: wind speed dependent (right now) -! -! if ( wind(i) < 1.0 ) then -! rich = 0.25 + 0.03*wind(i) -! elseif ( wind(i) >= 1.0 .and. wind(i) < 1.5 ) then -! rich = 0.25 + 0.1*wind(i) -! elseif ( wind(i) >= 1.5 .and. wind(i) < 6.0 ) then -! rich = 0.25 + 0.6*wind(i) -! elseif ( wind(i) >= 6.0 ) then -! rich = 0.25 + min(0.8*wind(i),0.50) -! endif - - rich = ri_c - -!> - Call the diurnal thermocline layer model dtm_1p(). - call dtm_1p(kdt,timestep,rich,taux,tauy,nswsfc(i), - & f_nsol,sss,sep,q_ts,hl_ts,rho_w,alpha,beta,alon, - & sinlat(i),soltim,grav,le,d_conv(i), - & xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - -! if (lprnt .and. i == ipr) print *,' beg xz2=',xz(i) - -! apply mda - if ( xt(i) > zero ) then -!> - If \a dtl heat content \a xt > 0.0, call dtm_1p_mda() to apply -!! minimum depth adjustment (mda). - call dtm_1p_mda(xt(i),xtts(i),xz(i),xzts(i)) - if ( xz(i) >= z_w_max ) then -!> - If \a dtl thickness >= module_nst_parameters::z_w_max, call dtl_reset() -!! to reset xt/xs/x/xv to zero, and xz to module_nst_parameters::z_w_max. - call dtl_reset(xt(i),xs(i),xu(i),xv(i),xz(i),xtts(i), - & xzts(i)) - -! if (lprnt .and. i == ipr) print *,' beg xz3=',xz(i),' z_w_max=' -! &,z_w_max - endif - -! apply fca - if ( d_conv(i) > zero ) then -!> - If thickness of free convection layer > 0.0, call dtm_1p_fca() -!! to apply free convection adjustment. -!> - If \a dtl thickness >= module_nst_parameters::z_w_max(), call dtl_reset() -!! to reset xt/xs/x/xv to zero, and xz to module_nst_parameters::z_w_max(). - call dtm_1p_fca(d_conv(i),xt(i),xtts(i),xz(i),xzts(i)) - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif - -! if (lprnt .and. i == ipr) print *,' beg xz4=',xz(i) - -! apply tla - dz = min(xz(i),max(d_conv(i),delz)) -! -!> - Call sw_ps_9b() to compute the fraction of the solar radiation -!! absorbed by the depth \a delz (Paulson and Simpson (1981) \cite paulson_and_simpson_1981). -!! And calculate the total heat absorbed in warm layer. - call sw_ps_9b(delz,fw) - q_warm = fw*nswsfc(i)-f_nsol !total heat absorbed in warm layer - -!> - Call cal_ttop() to calculate the diurnal warming amount at the top layer with -!! thickness of \a dz. - if ( q_warm > zero ) then - call cal_ttop(kdt,timestep,q_warm,rho_w,dz, - & xt(i),xz(i),ttop0) - -! if (lprnt .and. i == ipr) print *,' d_conv=',d_conv(i),' delz=', -! &delz,' kdt=',kdt,' timestep=',timestep,' nswsfc=',nswsfc(i), -! &' f_nsol=',f_nsol,' rho_w=',rho_w,' dz=',dz,' xt=',xt(i), -! &' xz=',xz(i),' qrain=',qrain(i) - - ttop = ((xt(i)+xt(i))/xz(i))*(one-dz/((xz(i)+xz(i)))) - -! if (lprnt .and. i == ipr) print *,' beg xz4a=',xz(i) -! &,' ttop=',ttop,' ttop0=',ttop0,' xt=',xt(i),' dz=',dz -! &,' xznew=',(xt(i)+sqrt(xt(i)*(xt(i)-dz*ttop0)))/ttop0 - -!> - Call dtm_1p_tla() to apply top layer adjustment. - if ( ttop > ttop0 ) then - call dtm_1p_tla(dz,ttop0,xt(i),xtts(i),xz(i),xzts(i)) - -! if (lprnt .and. i == ipr) print *,' beg xz4b=',xz(i),'z_w_max=', -! &z_w_max - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif - endif ! if ( q_warm > 0.0 ) then - -! if (lprnt .and. i == ipr) print *,' beg xz5=',xz(i) - -! apply mwa -!> - Call dt_1p_mwa() to apply maximum warming adjustment. - t0 = (xt(i)+xt(i))/xz(i) - if ( t0 > tw_max ) then - call dtm_1p_mwa(xt(i),xtts(i),xz(i),xzts(i)) - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif - -! if (lprnt .and. i == ipr) print *,' beg xz6=',xz(i) - -! apply mta -!> - Call dtm_1p_mta() to apply maximum temperature adjustment. - sstc = tref(i) + (xt(i)+xt(i))/xz(i) - dt_cool(i) - - if ( sstc > sst_max ) then - dta = sstc - sst_max - call dtm_1p_mta(dta,xt(i),xtts(i),xz(i),xzts(i)) -! write(*,'(a,f3.0,7f8.3)') 'mta, sstc,dta :',islimsk(i), -! & sstc,dta,tref(i),xt(i),xz(i),2.0*xt(i)/xz(i),dt_cool(i) - if ( xz(i) >= z_w_max ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - endif -! - endif ! if ( xt(i) > 0.0 ) then -! reset dtl at midnight and when solar zenith angle > 89.994 degree - if ( abs(soltim) < 2.0_kp*timestep ) then - call dtl_reset - & (xt(i),xs(i),xu(i),xv(i),xz(i),xzts(i),xtts(i)) - endif - - endif ! if (solar_time > solar_time_6am .and. ifd(i) == 0.0 ) then: too late to start the first day - -! if (lprnt .and. i == ipr) print *,' beg xz7=',xz(i) - -! update tsurf (when flag(i) .eqv. .true. ) -!> - Call get_dtzm_point() to computes \a dtz and \a tsurf. - call get_dtzm_point(xt(i),xz(i),dt_cool(i),z_c(i), - & zsea1,zsea2,dtz) - tsurf(i) = max(tgice, tref(i) + dtz ) - -! if (lprnt .and. i == ipr) print *,' tsurf=',tsurf(i),' tref=', -! &tref(i),' xz=',xz(i),' dt_cool=',dt_cool(i) - -!> - Call cal_w() to calculate \a w_0 and \a w_d. - if ( xt(i) > zero ) then - call cal_w(kdt,xz(i),xt(i),xzts(i),xtts(i),w_0(i),w_d(i)) - else - w_0(i) = zero - w_d(i) = zero - endif - -! if ( xt(i) > 0.0 ) then -! rig(i) = grav*xz(i)*xz(i)*(alpha*xt(i)-beta*xs(i)) -! & /(2.0*(xu(i)*xu(i)+xv(i)*xv(i))) -! else -! rig(i) = 0.25 -! endif - -! qrain(i) = rig(i) - zm(i) = wind(i) - - endif - enddo - -! restore nst-related prognostic fields for guess run - do i=1, im -! if (wet(i) .and. .not.icy(i)) then - if (wet(i) .and. use_lake_model(i)/=1) then - if (flag_guess(i)) then ! when it is guess of - xt(i) = xt_old(i) - xs(i) = xs_old(i) - xu(i) = xu_old(i) - xv(i) = xv_old(i) - xz(i) = xz_old(i) - zm(i) = zm_old(i) - xtts(i) = xtts_old(i) - xzts(i) = xzts_old(i) - ifd(i) = ifd_old(i) - tskin(i) = tskin_old(i) - dt_cool(i) = dt_cool_old(i) - z_c(i) = z_c_old(i) - else -! -! update tskin when coupled and not guess run -! (all other NSST variables have been updated in this case) -! - if ( nstf_name1 > 1 ) then - tskin(i) = tsurf(i) - endif ! if nstf_name1 > 1 then - endif ! if flag_guess(i) then - endif ! if wet(i) .and. .not.icy(i) then - enddo - -! if (lprnt .and. i == ipr) print *,' beg xz8=',xz(i) - - if ( nstf_name1 > 1 ) then -!> - Calculate latent and sensible heat flux over open water with updated tskin -!! for the grids of open water and the iteration is on. - do i = 1, im - if ( flag(i) ) then - qss(i) = fpvs( tskin(i) ) - qss(i) = eps*qss(i) / (ps(i) + epsm1*qss(i)) - qsurf(i) = qss(i) - evap(i) = elocp*rch(i) * (qss(i) - q0(i)) - - if(thsfc_loc) then ! Use local potential temperature - hflx(i) = rch(i) * (tskin(i) - theta1(i)) - else ! Use potential temperature referenced to 1000 hPa - hflx(i) = rch(i) * (tskin(i)/prsik1(i) - theta1(i)) - endif - - endif - enddo - endif ! if ( nstf_name1 > 1 ) then -! -!> - Include sea spray effects -! - do i=1,im - if(lseaspray .and. flag(i)) then - f10m = fm10(i) / fm(i) - u10m = f10m * u1(i) - v10m = f10m * v1(i) - ws10 = sqrt(u10m*u10m + v10m*v10m) - ws10 = max(ws10,1.) - ws10 = min(ws10,ws10cr) - tem = .015 * ws10 * ws10 - ru10 = 1. - .087 * log(10./tem) - qss1 = fpvs(t1(i)) - qss1 = eps * qss1 / (prsl1(i) + epsm1 * qss1) - tem = rd * cp * t1(i) * t1(i) - tem = 1. + eps * hvap * hvap * qss1 / tem - bb1 = 1. / tem - evaps = conlf * (ws10**5.4) * ru10 * bb1 - evaps = evaps * rho_a(i) * hvap * (qss1 - q0(i)) - evap(i) = evap(i) + alps * evaps - hflxs = consf * (ws10**3.4) * ru10 - hflxs = hflxs * rho_a(i) * cp * (tskin(i) - t1(i)) - ptem = alps - gams - hflx(i) = hflx(i) + bets * hflxs - ptem * evaps - endif - enddo -! - do i=1,im - if ( flag(i) ) then - tem = one / rho_a(i) - hflx(i) = hflx(i) * tem * cpinv - evap(i) = evap(i) * tem * hvapi - endif - enddo -! -! if (lprnt) print *,' tskin=',tskin(ipr) - - return - end subroutine sfc_nst_run -!> @} - end module sfc_nst diff --git a/physics/sfc_nst.f90 b/physics/SFC_Layer/UFS/sfc_nst.f90 similarity index 100% rename from physics/sfc_nst.f90 rename to physics/SFC_Layer/UFS/sfc_nst.f90 diff --git a/physics/SFC_Layer/UFS/sfc_nst_post.f b/physics/SFC_Layer/UFS/sfc_nst_post.f deleted file mode 100644 index 83bc2f273..000000000 --- a/physics/SFC_Layer/UFS/sfc_nst_post.f +++ /dev/null @@ -1,93 +0,0 @@ -!> \file sfc_nst_post.f -!! This file contains code to be executed after the GFS NSST model. - - module sfc_nst_post - - contains - -! \defgroup GFS_NSST_POST GFS Near-Surface Sea Temperature Post - -!> \section arg_table_sfc_nst_post_run Argument Table -!! \htmlinclude sfc_nst_post_run.html -!! -! \section NSST_general_post_algorithm General Algorithm -! -! \section NSST_detailed_post_algorithm Detailed Algorithm -! @{ - subroutine sfc_nst_post_run & - & ( im, kdt, rlapse, tgice, wet, use_lake_model, icy, oro, & - & oro_uf, nstf_name1, & - & nstf_name4, nstf_name5, xt, xz, dt_cool, z_c, tref, xlon, & - & tsurf_wat, tsfc_wat, nthreads, dtzm, errmsg, errflg & - & ) - - use machine , only : kind_phys - use module_nst_water_prop, only: get_dtzm_2d - - implicit none - - integer, parameter :: kp = kind_phys - -! --- inputs: - integer, intent(in) :: im, kdt, nthreads - logical, dimension(:), intent(in) :: wet, icy - integer, dimension(:), intent(in) :: use_lake_model - 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 - -! --- input/outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: tsurf_wat, & - & tsfc_wat - -! --- outputs: - real (kind=kind_phys), dimension(:), intent(out) :: dtzm - - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! --- locals - integer :: i - real(kind=kind_phys) :: zsea1, zsea2 - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - -! if (lprnt) print *,' tseaz2=',tseal(ipr),' tref=',tref(ipr), -! & ' dt_cool=',dt_cool(ipr),' dt_warm=',2.0*xt(ipr)/xz(ipr), -! & ' kdt=',kdt - -! do i = 1, im -! if (wet(i) .and. .not. icy(i)) then -! tsurf_wat(i) = tsurf_wat(i) - (oro(i)-oro_uf(i)) * rlapse -! endif -! enddo - -! --- ... run nsst model ... --- - - if (nstf_name1 > 1) then - zsea1 = 0.001_kp*real(nstf_name4) - zsea2 = 0.001_kp*real(nstf_name5) - call get_dtzm_2d (xt, xz, dt_cool, z_c, wet, zsea1, zsea2, & - & im, 1, nthreads, dtzm) - do i = 1, im -! if (wet(i) .and. .not.icy(i)) then -! if (wet(i) .and. (frac_grid .or. .not. icy(i))) then - if (wet(i) .and. use_lake_model(i) /=1) then - tsfc_wat(i) = max(tgice, tref(i) + dtzm(i)) -! tsfc_wat(i) = max(271.2, tref(i) + dtzm(i)) - & -! (oro(i)-oro_uf(i))*rlapse - endif - enddo - endif - -! if (lprnt) print *,' tseaz2=',tsea(ipr),' tref=',tref(ipr), & -! & ' dt_cool=',dt_cool(ipr),' dt_warm=',dt_warm(ipr),' kdt=',kdt - - return - end subroutine sfc_nst_post_run - - end module sfc_nst_post diff --git a/physics/sfc_nst_post.f90 b/physics/SFC_Layer/UFS/sfc_nst_post.f90 similarity index 100% rename from physics/sfc_nst_post.f90 rename to physics/SFC_Layer/UFS/sfc_nst_post.f90 diff --git a/physics/SFC_Layer/UFS/sfc_nst_pre.f b/physics/SFC_Layer/UFS/sfc_nst_pre.f deleted file mode 100644 index 77ff61f00..000000000 --- a/physics/SFC_Layer/UFS/sfc_nst_pre.f +++ /dev/null @@ -1,96 +0,0 @@ -!> \file sfc_nst_pre.f -!! This file contains preparation for the GFS NSST model. - - module sfc_nst_pre - - contains - -!> \defgroup GFS_NSST_PRE GFS Near-Surface Sea Temperature Pre -!! -!! The NSST scheme is one of the three schemes used to represent the -!! surface in the GFS physics suite. The other two are the Noah land -!! surface model and the sice simplified ice model. -!! -!! \section arg_table_sfc_nst_pre_run Argument Table -!! \htmlinclude sfc_nst_pre_run.html -!! -!> \section NSST_general_pre_algorithm General Algorithm - subroutine sfc_nst_pre_run - & (im, wet, tgice, tsfco, tsurf_wat, - & tseal, xt, xz, dt_cool, z_c, tref, cplflx, - & oceanfrac, nthreads, errmsg, errflg) - - use machine , only : kind_phys - use module_nst_water_prop, only: get_dtzm_2d - - implicit none - - integer, parameter :: kp = kind_phys - -! --- inputs: - 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 - logical, intent(in) :: cplflx - -! --- input/outputs: - real (kind=kind_phys), dimension(:), intent(inout) :: - & tsurf_wat, tseal, tref - -! --- outputs: - character(len=*), intent(out) :: errmsg - integer, intent(out) :: errflg - -! --- locals - integer :: i - real(kind=kind_phys), parameter :: zero = 0.0_kp, - & one = 1.0_kp, - & half = 0.5_kp, - & omz1 = 2.0_kp - real(kind=kind_phys) :: tem1, tem2, dnsst - real(kind=kind_phys), dimension(im) :: dtzm, z_c_0 - - ! Initialize CCPP error handling variables - errmsg = '' - errflg = 0 - - do i=1,im - if (wet(i) .and. oceanfrac(i) > 0.0) then -! tem = (oro(i)-oro_uf(i)) * rlapse - ! DH* 20190927 simplyfing this code because tem is zero - !tem = zero - !tseal(i) = tsfco(i) + tem - tseal(i) = tsfco(i) - !tsurf_wat(i) = tsurf_wat(i) + tem - ! *DH - endif - enddo -! -! update tsfc & tref with T1 from OGCM & NSST Profile if coupled -! - if (cplflx) then - z_c_0 = zero - call get_dtzm_2d (xt, xz, dt_cool, & - & z_c_0, wet, zero, omz1, im, 1, nthreads, dtzm) - do i=1,im - if (wet(i) .and. oceanfrac(i) > zero ) then -! dnsst = tsfc_wat(i) - tref(i) ! retrive/get difference of Ts and Tf - tref(i) = max(tgice, tsfco(i) - dtzm(i)) ! update Tf with T1 and NSST T-Profile -! tsfc_wat(i) = max(271.2,tref(i) + dnsst) ! get Ts updated due to Tf update -! tseal(i) = tsfc_wat(i) - if (abs(xz(i)) > zero) then - tem2 = one / xz(i) - else - tem2 = zero - endif - tseal(i) = tref(i) + (xt(i)+xt(i)) * tem2 - dt_cool(i) - tsurf_wat(i) = tseal(i) - endif - enddo - endif - - return - end subroutine sfc_nst_pre_run - end module sfc_nst_pre diff --git a/physics/sfc_nst_pre.f90 b/physics/SFC_Layer/UFS/sfc_nst_pre.f90 similarity index 100% rename from physics/sfc_nst_pre.f90 rename to physics/SFC_Layer/UFS/sfc_nst_pre.f90 From 3c1e819f5f1042917fcc68810254362252621315 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 7 Dec 2023 18:18:07 +0000 Subject: [PATCH 108/249] More metadata fixes --- physics/MP/GFDL/fv_sat_adj.meta | 4 +++- physics/SFC_Models/Land/Noah/lsm_noah.meta | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/physics/MP/GFDL/fv_sat_adj.meta b/physics/MP/GFDL/fv_sat_adj.meta index 8c3c9be42..c91e438b7 100644 --- a/physics/MP/GFDL/fv_sat_adj.meta +++ b/physics/MP/GFDL/fv_sat_adj.meta @@ -1,7 +1,9 @@ [ccpp-table-properties] name = fv_sat_adj type = scheme - dependencies = ../../hooks/machine.F,../../hooks/physcons.F90,module_gfdl_cloud_microphys.F90,multi_gases.F90 + dependencies = ../../hooks/machine.F,../../hooks/physcons.F90 + dependencies = module_gfdl_cloud_microphys.F90,multi_gases.F90 + dependencies = ../module_mp_radar.F90 ######################################################################## [ccpp-arg-table] diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.meta b/physics/SFC_Models/Land/Noah/lsm_noah.meta index 44cb6aa5b..f3ce1d19b 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.meta +++ b/physics/SFC_Models/Land/Noah/lsm_noah.meta @@ -2,7 +2,7 @@ name = lsm_noah type = scheme dependencies = ../../../tools/funcphys.f90,../../../hooks/machine.F - dependencies = set_soilveg.f,sflx.f,surface_perturbation.F90 + dependencies = set_soilveg.f,sflx.f,surface_perturbation.F90,namelist_soilveg.f ######################################################################## [ccpp-arg-table] From 06b0563ff7483b223102f960d4845c455a90843e Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Fri, 8 Dec 2023 16:12:26 +0000 Subject: [PATCH 109/249] Revise the namelist option to include sea surface current in the computation of air-sea fluxes. --- physics/satmedmfvdifq.F | 22 +++------------------- physics/satmedmfvdifq.meta | 2 +- physics/sfc_diag.f | 21 +++------------------ physics/sfc_diag.meta | 2 +- physics/sfc_diff.f | 19 +++---------------- physics/sfc_diff.meta | 2 +- physics/sfc_nst.meta | 2 +- physics/sfc_ocean.F | 25 ++++++------------------- physics/sfc_ocean.meta | 2 +- physics/zzz | 12 ------------ 10 files changed, 20 insertions(+), 89 deletions(-) delete mode 100755 physics/zzz diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 9a2214704..55667d515 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -75,7 +75,7 @@ end subroutine satmedmfvdifq_init !! \section detail_satmedmfvidfq GFS satmedmfvdifq Detailed Algorithm subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & & ntiw,ntke,grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, & - & dv,du,tdt,rtg,u1,v1,t1,q1,ssu,ssv,iopt_flx_over_ocn, & + & dv,du,tdt,rtg,u1,v1,t1,q1,ssu,ssv,icplocn2atm, & & swh,hlw,xmu,garea,zvfun,sigmaf, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,heat,evap,stress,spd1,kpbl, & @@ -127,7 +127,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & real(kind=kind_phys), intent(inout), dimension(:,:,:) :: dtend integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_x_wind, index_of_y_wind, index_of_process_pbl - integer, intent(in) :: iopt_flx_over_ocn + integer, intent(in) :: icplocn2atm real(kind=kind_phys), intent(out) :: & & dusfc(:), dvsfc(:), & & dtsfc(:), dqsfc(:), & @@ -282,22 +282,6 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(cs0=0.4,csmf=0.5) parameter(rchck=1.5,ndt=20) - real(kind=kind_phys) :: ssumax, ssvmax - logical :: check_ssu_ssv - - check_ssu_ssv=.false. - if(check_ssu_ssv .and. iopt_flx_over_ocn == 1) then - ssumax=0.0 - ssvmax=0.0 - do i=1,im - if(ssu(i) .gt. ssumax) ssumax=ssu(i) - if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) - enddo - write(*,*)'in_satmedmfvdifq,u1 v1',u1(1,1),v1(1,1) - print*, 'in satmedmfvdifq.F ssumax,ssvmax',ssumax,ssvmax - print*,'in satmedmfvdifq.F iopt_flx_over_ocn',iopt_flx_over_ocn - endif - if (tc_pbl == 0) then ck0 = 0.4 ch0 = 0.4 @@ -2395,7 +2379,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & enddo enddo do i = 1,im - if(iopt_flx_over_ocn == 1) then + if(icplocn2atm == 1) then spd1_m(i)=sqrt( (u1(i,1)-ssu(i))**2+(v1(i,1)-ssv(i))**2 ) dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1_m(i) dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1_m(i) diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index 4b84d6c65..c97126457 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -233,7 +233,7 @@ type = real kind = kind_phys intent = in -[iopt_flx_over_ocn] +[icplocn2atm] standard_name = flag_for_air_sea_flux_computation_over_water long_name = air-sea flux option units = flag diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 5acda6181..1fa7fa450 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -17,7 +17,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & & lsm,lsm_ruc,grav,cp,eps,epsm1,con_rocp, & & con_karman, & & shflx,cdq,wind, & - & ssu,ssv,iopt_flx_over_ocn, & + & ssu,ssv,icplocn2atm, & & zf,ps,u1,v1,t1,q1,prslki,evap,fm,fh,fm10,fh2, & & ust,tskin,qsurf,thsfc_loc,diag_flux,diag_log, & & use_lake_model,iopt_lake,iopt_lake_clm, & @@ -31,7 +31,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & implicit none ! integer, intent(in) :: im, lsm, lsm_ruc, iopt_lake, iopt_lake_clm - integer, intent(in) :: iopt_flx_over_ocn + integer, intent(in) :: icplocn2atm logical, intent(in) :: use_lake2m logical, intent(in) :: thsfc_loc ! Flag for reference pot. temp. logical, intent(in) :: diag_flux ! Flag for flux method in 2-m diagnostics @@ -70,26 +70,11 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & ! real(kind=kind_phys) sig2k, fhi, qss ! ! real, parameter :: g=grav - integer ii - real(kind=kind_phys) :: ssumax, ssvmax - logical :: check_ssu_ssv ! ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - check_ssu_ssv=.false. - if(check_ssu_ssv .and. iopt_flx_over_ocn ==1) then - ssumax=0.0 - ssvmax=0.0 - do ii=1,im - if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) - if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) - enddo - print*, 'in sfc_diag ssumax ssvmax=', ssumax, ssvmax - print*, 'in sfc_diag iopt_flx_over_ocn=', iopt_flx_over_ocn - endif - !-- testptlat = 35.3_kind_phys testptlon = 273.0_kind_phys @@ -107,7 +92,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & do i = 1, im f10m(i) = fm10(i) / fm(i) - if(iopt_flx_over_ocn ==1) then + if(icplocn2atm ==1) then u10m(i) = ssu(i) + f10m(i) * (u1(i)-ssu(i)) v10m(i) = ssv(i) + f10m(i) * (v1(i)-ssv(i)) else diff --git a/physics/sfc_diag.meta b/physics/sfc_diag.meta index 834ad5871..da300d053 100644 --- a/physics/sfc_diag.meta +++ b/physics/sfc_diag.meta @@ -139,7 +139,7 @@ type = real kind = kind_phys intent = in -[iopt_flx_over_ocn] +[icplocn2atm] standard_name = flag_for_air_sea_flux_computation_over_water long_name = air-sea flux option units = flag diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 62102151a..9c00b7040 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -61,7 +61,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) - & u1,v1,ssu,ssv,iopt_flx_over_ocn, & + & u1,v1,ssu,ssv,icplocn2atm, & & wet,dry,icy, & !intent(in) & thsfc_loc, & !intent(in) & tskin_wat, tskin_lnd, tskin_ice, & !intent(in) @@ -86,7 +86,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) integer, parameter :: kp = kind_phys integer, intent(in) :: im, ivegsrc integer, intent(in) :: sfc_z0_type ! option for calculating surface roughness length over ocean - integer, intent(in) :: iopt_flx_over_ocn ! option for including ocean current in the computation of flux + integer, intent(in) :: icplocn2atm ! option for including ocean current in the computation of flux integer, dimension(:), intent(in) :: vegtype @@ -128,10 +128,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! locals ! integer i - integer ii - real(kind=kind_phys) :: ssumax, ssvmax real(kind=kind_phys), dimension(im) :: windrel, wind10m - logical :: check_ssu_ssv ! real(kind=kind_phys) :: rat, tv1, thv1, restar, & czilc, tem1, tem2, virtfac @@ -176,17 +173,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type - check_ssu_ssv=.false. - if(check_ssu_ssv .and. iopt_flx_over_ocn == 1) then - ssumax=0.0 - ssvmax=0.0 - do ii=1,im - if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) - if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) - enddo - print*, 'in sfc_diff ssumax,ssvmax =',ssumax,ssvmax - print*, 'in sfc_diff iopt_flx_over_ocn =',iopt_flx_over_ocn - print*, 'in sfc_diff wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) + if(icplocn2atm == 1) then do i=1,im windrel(i)=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) wind10m(i)= sqrt( (u10m(i)-ssu(i))**2 + (v10m(i)-ssv(i))**2 ) diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index 360c2a0c8..1233e17af 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -249,7 +249,7 @@ dimensions = () type = integer intent = in -[iopt_flx_over_ocn] +[icplocn2atm] standard_name = flag_for_air_sea_flux_computation_over_water long_name = air-sea flux option units = flag diff --git a/physics/sfc_nst.meta b/physics/sfc_nst.meta index eb5a2d379..7504b9d49 100644 --- a/physics/sfc_nst.meta +++ b/physics/sfc_nst.meta @@ -150,7 +150,7 @@ type = real kind = kind_phys intent = in -[iopt_flx_over_ocn] +[icplocn2atm] standard_name = flag_for_air_sea_flux_computation_over_water long_name = air-sea flux option units = flag diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index 27e309eca..cde28072a 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -25,7 +25,7 @@ subroutine sfc_ocean_run & ! --- inputs: & ( im, hvap, cp, rd, eps, epsm1, rvrdm1, ps, u1, v1, t1, q1, & & tskin, cm, ch, lseaspray, fm, fm10, & - & ssu, ssv, iopt_flx_over_ocn, & + & ssu, ssv, icplocn2atm, & & prsl1, prslki, wet, use_lake_model, wind, &, ! --- inputs & flag_iter, use_med_flux, dqsfc_med, dtsfc_med, & & qsurf, cmm, chh, gflux, evap, hflx, ep, & ! --- outputs @@ -40,7 +40,7 @@ subroutine sfc_ocean_run & ! call sfc_ocean ! ! inputs: ! ! ( im, ps, u1, v1, t1, q1, tskin, cm, ch, lseaspray, fm, fm10, ! -! ssu, ssv, iopt_flx_over_ocn, ! +! ssu, ssv, icplocn2atm, ! ! prsl1, prslki, wet, use_lake_model, wind, flag_iter, ! ! use_med_flux, ! ! outputs: ! @@ -69,7 +69,7 @@ subroutine sfc_ocean_run & ! ps - real, surface pressure im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! ! ssu,ssv - real, u/v component of surface ocean current (m/s) im ! -! iopt_flx_over_ocn - integer, option for including 1 ! +! icplocn2atm - integer, option for including 1 ! ! ocean current in the computation of flux ! ! t1 - real, surface layer mean temperature ( k ) im ! ! q1 - real, surface layer mean specific humidity im ! @@ -110,7 +110,7 @@ subroutine sfc_ocean_run & & zero = 0.0_kind_phys, qmin = 1.0e-8_kind_phys ! --- inputs: integer, intent(in) :: im - integer, intent(in) :: iopt_flx_over_ocn + integer, intent(in) :: icplocn2atm real (kind=kind_phys), intent(in) :: hvap, cp, rd, & & eps, epsm1, rvrdm1 @@ -144,9 +144,6 @@ subroutine sfc_ocean_run & real (kind=kind_phys), dimension(im) :: rho, q0 integer :: i - real (kind=kind_phys) :: ssumax,ssvmax - !logical,save :: check_ssu_ssv=.true. - logical :: check_ssu_ssv logical :: flag(im) ! @@ -167,18 +164,8 @@ subroutine sfc_ocean_run & ! -- ... initialize CCPP error handling variables errmsg = '' errflg = 0 - check_ssu_ssv=.false. - if(check_ssu_ssv .and. iopt_flx_over_ocn == 1) then - ssumax=0.0 - ssvmax=0.0 - do i=1,im - if(ssu(i) .gt. ssumax) ssumax=ssu(i) - if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) - enddo - print *, 'in sfc_ocean ssumax,ssvmax',ssumax,ssvmax - print *, 'in sfc_ocean iopt_flx_over_ocn',iopt_flx_over_ocn - endif - if(iopt_flx_over_ocn == 1) then + + if(icplocn2atm == 1) then do i=1,im windrel(i) = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) enddo diff --git a/physics/sfc_ocean.meta b/physics/sfc_ocean.meta index f99d74773..dbb9c9131 100644 --- a/physics/sfc_ocean.meta +++ b/physics/sfc_ocean.meta @@ -102,7 +102,7 @@ type = real kind = kind_phys intent = in -[iopt_flx_over_ocn] +[icplocn2atm] standard_name = flag_for_air_sea_flux_computation_over_water long_name = air-sea flux option units = flag diff --git a/physics/zzz b/physics/zzz deleted file mode 100755 index e9bd2da01..000000000 --- a/physics/zzz +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh -export src1=/scratch1/NCEPDEV/stmp4/Bin.Li/20231201/ufs-weather-model/FV3/ccpp/physics/physics -cp $src1/satmedmfvdifq.F . -cp $src1/satmedmfvdifq.meta . -cp $src1/sfc_diff.f . -cp $src1/sfc_diff.meta . -cp $src1/sfc_diag.f . -cp $src1/sfc_diag.meta . -cp $src1/sfc_nst.f . -cp $src1/sfc_nst.meta . -cp $src1/sfc_ocean.F . -cp $src1/sfc_ocean.meta . From a7b8325bdf3f0a16f7354854276f40918b32549b Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 14 Dec 2023 00:46:00 +0000 Subject: [PATCH 110/249] Bug in CMake file --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bac0637a4..ee708d4c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,8 +108,8 @@ set(SCHEMES_OPENMP_OFF ${LOCAL_CURRENT_SOURCE_DIR}/physics/Radiation/RRTMGP/rte- # List of files that need to be compiled with different precision set(SCHEMES_DYNAMICS) -if(${LOCAL_CURRENT_SOURCE_DIR}/physics/MP/GFDL/fv_sat_adj.F90fv_sat_adj.F90 IN_LIST SCHEMES) - list(APPEND SCHEMES_DYNAMICS ${LOCAL_CURRENT_SOURCE_DIR}/physics/MP/GFDL/fv_sat_adj.F90/fv_sat_adj.F90) +if(${LOCAL_CURRENT_SOURCE_DIR}/physics/MP/GFDL/fv_sat_adj.F90 IN_LIST SCHEMES) + list(APPEND SCHEMES_DYNAMICS ${LOCAL_CURRENT_SOURCE_DIR}/physics/MP/GFDL/fv_sat_adj.F90) endif() # Remove files that need to be compiled with different precision From d65507afb07edc4a50ba246843284552b99e437d Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Thu, 14 Dec 2023 11:16:29 -0500 Subject: [PATCH 111/249] Fix CI 2 --- tools/check_encoding.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/tools/check_encoding.py b/tools/check_encoding.py index 1d24d4679..d964ebaab 100755 --- a/tools/check_encoding.py +++ b/tools/check_encoding.py @@ -15,11 +15,7 @@ if suffix in SUFFICES: with open(os.path.join(root, file)) as f: contents = f.read() - try: - contents.decode('ascii') - except UnicodeDecodeError: + if not contents.isascii(): for line in contents.split('\n'): - try: - line.decode('ascii') - except UnicodeDecodeError: + if not line.isascii(): raise Exception('Detected non-ascii characters in file {}, line: "{}"'.format(os.path.join(root, file), line)) From 3c3c91a57210a686f6c21bbe8cf614f37ac2b16b Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 14 Dec 2023 22:37:37 +0000 Subject: [PATCH 112/249] bug fix: no concurrent NetCDF calls in GFS_phys_time_vary_init --- physics/GFS_phys_time_vary.fv3.F90 | 37 ------------------------------ 1 file changed, 37 deletions(-) diff --git a/physics/GFS_phys_time_vary.fv3.F90 b/physics/GFS_phys_time_vary.fv3.F90 index 4b6909f74..f53ab3928 100644 --- a/physics/GFS_phys_time_vary.fv3.F90 +++ b/physics/GFS_phys_time_vary.fv3.F90 @@ -222,24 +222,6 @@ subroutine GFS_phys_time_vary_init ( jamin=999 jamax=-999 -!$OMP parallel num_threads(nthrds) default(none) & -!$OMP shared (me,master,ntoz,h2o_phys,im,nx,ny,levs,idate) & -!$OMP shared (xlat_d,xlon_d,imap,jmap,errmsg,errflg) & -!$OMP shared (levh2o,h2o_coeff,h2o_pres,h2opl) & -!$OMP shared (iamin, iamax, jamin, jamax, lsm_noahmp) & -!$OMP shared (iaerclm,iaermdl,ntrcaer,aer_nm,iflip,iccn) & -!$OMP shared (jindx1_o3,jindx2_o3,ddy_o3,jindx1_h,jindx2_h,ddy_h) & -!$OMP shared (jindx1_aer,jindx2_aer,ddy_aer,iindx1_aer,iindx2_aer,ddx_aer) & -!$OMP shared (jindx1_ci,jindx2_ci,ddy_ci,iindx1_ci,iindx2_ci,ddx_ci) & -!$OMP shared (do_ugwp_v1,jindx1_tau,jindx2_tau,ddy_j1tau,ddy_j2tau) & -!$OMP shared (isot,ivegsrc,nlunit,sncovr,sncovr_ice,lsm,lsm_ruc) & -!$OMP shared (min_seaice,fice,landfrac,vtype,weasd,snupx,salp_data) & -!$OMP shared (ozphys) & -!$OMP private (ix,i,j,rsnow,vegtyp,myerrmsg,myerrflg) - -!$OMP sections - -!$OMP section !> - Call read_h2odata() to read stratospheric water vapor data need_h2odata: if(h2o_phys) then call read_h2odata (h2o_phys, me, master) @@ -263,7 +245,6 @@ subroutine GFS_phys_time_vary_init ( end if endif need_h2odata -!$OMP section !> - Call read_aerdata() to read aerosol climatology, Anning added coupled !> added coupled gocart and radiation option to initializing aer_nm if (iaerclm) then @@ -285,7 +266,6 @@ subroutine GFS_phys_time_vary_init ( ntrcaer = 1 endif -!$OMP section !> - Call read_cidata() to read IN and CCN data if (iccn == 1) then call read_cidata (me,master) @@ -293,7 +273,6 @@ subroutine GFS_phys_time_vary_init ( ! hardcoded in module iccn_def.F and GFS_typedefs.F90 endif -!$OMP section !> - Call tau_amf dats for ugwp_v1 if (do_ugwp_v1) then myerrflg = 0 @@ -302,14 +281,12 @@ subroutine GFS_phys_time_vary_init ( call copy_error(myerrmsg, myerrflg, errmsg, errflg) endif -!$OMP section !> - Initialize soil vegetation (needed for sncovr calculation further down) myerrflg = 0 myerrmsg = 'set_soilveg failed without a message' call set_soilveg(me, isot, ivegsrc, nlunit, myerrmsg, myerrflg) call copy_error(myerrmsg, myerrflg, errmsg, errflg) -!$OMP section !> - read in NoahMP table (needed for NoahMP init) if(lsm == lsm_noahmp) then myerrflg = 0 @@ -318,25 +295,19 @@ subroutine GFS_phys_time_vary_init ( call copy_error(myerrmsg, myerrflg, errmsg, errflg) endif -!$OMP end sections ! Need an OpenMP barrier here (implicit in "end sections") -!$OMP sections - -!$OMP section !> - Setup spatial interpolation indices for ozone physics. if (ntoz > 0) then call ozphys%setup_o3prog(xlat_d, jindx1_o3, jindx2_o3, ddy_o3) endif -!$OMP section !> - Call setindxh2o() to initialize stratospheric water vapor data if (h2o_phys) then call setindxh2o (im, xlat_d, jindx1_h, jindx2_h, ddy_h) endif -!$OMP section !> - Call setindxaer() to initialize aerosols data if (iaerclm) then call setindxaer (im, xlat_d, jindx1_aer, & @@ -349,7 +320,6 @@ subroutine GFS_phys_time_vary_init ( jamax = max(maxval(jindx2_aer), jamax) endif -!$OMP section !> - Call setindxci() to initialize IN and CCN data if (iccn == 1) then call setindxci (im, xlat_d, jindx1_ci, & @@ -357,14 +327,12 @@ subroutine GFS_phys_time_vary_init ( iindx1_ci, iindx2_ci, ddx_ci) endif -!$OMP section !> - Call cires_indx_ugwp to read monthly-mean GW-tau diagnosed from FV3GFS-runs that can resolve GWs if (do_ugwp_v1) then call cires_indx_ugwp (im, me, master, xlat_d, jindx1_tau, jindx2_tau, & ddy_j1tau, ddy_j2tau) endif -!$OMP section !--- initial calculation of maps local ix -> global i and j ix = 0 do j = 1,ny @@ -375,7 +343,6 @@ subroutine GFS_phys_time_vary_init ( enddo enddo -!$OMP section !--- if sncovr does not exist in the restart, need to create it if (all(sncovr < zero)) then if (me == master ) write(*,'(a)') 'GFS_phys_time_vary_init: compute sncovr from weasd and soil vegetation parameters' @@ -404,10 +371,6 @@ subroutine GFS_phys_time_vary_init ( endif endif -!$OMP end sections - -!$OMP end parallel - if (errflg/=0) return if (iaerclm) then From 929b716834927b0b832335ef189dad6a4470042b Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 15 Dec 2023 16:55:14 +0000 Subject: [PATCH 113/249] pressure is not density --- physics/clm_lake.f90 | 20 +++++++++++--------- physics/clm_lake.meta | 32 ++++++++++++++++++++++++-------- 2 files changed, 35 insertions(+), 17 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 620f79a96..f9341c87b 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -238,7 +238,7 @@ subroutine calculate_z_dz_lake(i,input_lakedepth,clm_lakedepth,z_lake,dz_lake) real(kind_lake) :: dz_lake(nlevlake) ! layer thickness for lake (m) real(kind_lake) :: depthratio - if (input_lakedepth(i) == spval) then + if (input_lakedepth(i) == spval .or. input_lakedepth(i) < 0.1) then clm_lakedepth(i) = zlak(nlevlake) + 0.5_kind_lake*dzlak(nlevlake) z_lake(1:nlevlake) = zlak(1:nlevlake) dz_lake(1:nlevlake) = dzlak(1:nlevlake) @@ -267,7 +267,7 @@ SUBROUTINE clm_lake_run( & ! Atmospheric model state inputs: tg3, pgr, zlvl, gt0, prsi, phii, qvcurr, gu0, gv0, xlat_d, xlon_d, & - ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, rho0, tsfc, & + ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, tsfc, & flag_iter, ISLTYP, rainncprv, raincprv, & ! Feedback to atmosphere: @@ -283,7 +283,7 @@ SUBROUTINE clm_lake_run( & salty, savedtke12d, snowdp2d, h2osno2d, snl2d, t_grnd2d, t_lake3d, & lake_icefrac3d, t_soisno3d, h2osoi_ice3d, h2osoi_liq3d, h2osoi_vol3d, & - z3d, dz3d, zi3d, & + z3d, dz3d, zi3d, t1, qv1, prsl1, & input_lakedepth, clm_lakedepth, cannot_freeze, & ! Error reporting: @@ -321,8 +321,8 @@ 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, rho0, & - rainncprv, raincprv + dlwsfci, dswsfci, oro_lakedepth, wind, & + rainncprv, raincprv, t1, qv1, prsl1 REAL(KIND_PHYS), DIMENSION(:,:), INTENT(in) :: gu0, gv0, prsi, gt0, phii LOGICAL, DIMENSION(:), INTENT(IN) :: flag_iter INTEGER, DIMENSION(:), INTENT(IN) :: ISLTYP @@ -450,6 +450,7 @@ SUBROUTINE clm_lake_run( & logical, parameter :: feedback_to_atmosphere = .true. ! FIXME: REMOVE real(kind_lake) :: to_radians, lat_d, lon_d, qss, tkm, bd + real(kind_lake) :: rho0 ! lowest model level air density integer :: month,num1,num2,day_of_month,isl real(kind_lake) :: wght1,wght2,Tclim,depthratio @@ -693,12 +694,13 @@ SUBROUTINE clm_lake_run( & !-- The CLM output is combined for fractional ice and water if( t_grnd(c) >= tfrz ) then - qfx = eflx_lh_tot(c)*invhvap + qfx = eflx_lh_tot(c)*invhvap else - qfx = eflx_lh_tot(c)*invhsub ! heat flux (W/m^2)=>mass flux(kg/(sm^2)) + qfx = eflx_lh_tot(c)*invhsub ! heat flux (W/m^2)=>mass flux(kg/(sm^2)) endif - evap_wat(i) = qfx/rho0(i) ! kinematic_surface_upward_latent_heat_flux_over_water - hflx_wat(i)=eflx_sh_tot(c)/(rho0(i)*cpair) ! kinematic_surface_upward_sensible_heat_flux_over_water + rho0 = prsl1(i) / (rair*t1(i)*(1.0 + con_fvirt*qv1(i))) + evap_wat(i) = qfx/rho0 ! kinematic_surface_upward_latent_heat_flux_over_water + hflx_wat(i) = eflx_sh_tot(c)/(rho0*cpair) ! kinematic_surface_upward_sensible_heat_flux_over_water gflx_wat(I) = eflx_gnet(c) ![W/m/m] upward_heat_flux_in_soil_over_water ep1d_water(i) = eflx_lh_tot(c) ![W/m/m] surface_upward_potential_latent_heat_flux_over_water tsurf_water(I) = t_grnd(c) ![K] surface skin temperature after iteration over water diff --git a/physics/clm_lake.meta b/physics/clm_lake.meta index 11a44286a..345f535ee 100644 --- a/physics/clm_lake.meta +++ b/physics/clm_lake.meta @@ -305,14 +305,6 @@ type = real kind = kind_phys intent = in -[rho0] - standard_name = air_pressure_at_surface_adjacent_layer - long_name = mean pressure at lowest model layer - units = Pa - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in [tsfc] standard_name = surface_skin_temperature long_name = surface skin temperature @@ -732,6 +724,30 @@ type = real kind = kind_phys intent = in +[t1] + standard_name = air_temperature_at_surface_adjacent_layer + long_name = mean temperature at lowest model layer + units = K + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[qv1] + standard_name = specific_humidity_at_surface_adjacent_layer + long_name = water vapor specific humidity at lowest model layer + units = kg kg-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in +[prsl1] + standard_name = air_pressure_at_surface_adjacent_layer + long_name = mean pressure at lowest model layer + units = Pa + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 0889de1446e11f26a0570baa056ceb0bfb65512e Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 18 Dec 2023 15:12:33 +0000 Subject: [PATCH 114/249] revisions to slowfall accumulation from @tanyasmirnova --- physics/module_sf_ruclsm.F90 | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 52fbc8123..9ac4493f7 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -1703,7 +1703,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia IF (NEWSN > zero .and. snowfracnewsn > 0.99_kind_phys .and. rhosnfall < 450._kind_phys) THEN ! new snow KEEP_SNOW_ALBEDO = one - !snow_mosaic=0. ! ??? + snow_mosaic=0. ! ??? ENDIF IF (debug_print ) THEN @@ -2076,7 +2076,6 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia hfx = hfxs*(one-snowfrac) + hfx*snowfrac s = ss*(one-snowfrac) + s*snowfrac evapl = evapls*(one-snowfrac) - sublim = sublim*snowfrac prcpl = prcpls*(one-snowfrac) + prcpl*snowfrac fltot = fltots*(one-snowfrac) + fltot*snowfrac ALB = MAX(keep_snow_albedo*alb, & @@ -2088,10 +2087,6 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia runoff1 = runoff1s*(one-snowfrac) + runoff1*snowfrac runoff2 = runoff2s*(one-snowfrac) + runoff2*snowfrac - smelt = smelt * snowfrac - snoh = snoh * snowfrac - snflx = snflx * snowfrac - snom = snom * snowfrac mavail = mavails*(one-snowfrac) + one*snowfrac infiltr = infiltrs*(one-snowfrac) + infiltr*snowfrac @@ -2115,7 +2110,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia qvg = qvgs*(one-snowfrac) + qvg*snowfrac qsg = qsgs*(one-snowfrac) + qsg*snowfrac qcg = qcgs*(one-snowfrac) + qcg*snowfrac - sublim = eeta*snowfrac + sublim = eeta eeta = eetas*(one-snowfrac) + eeta*snowfrac qfx = qfxs*(one-snowfrac) + qfx*snowfrac hfx = hfxs*(one-snowfrac) + hfx*snowfrac @@ -2129,10 +2124,6 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia (emissn - emiss_snowfree) * snowfrac), emissn)) runoff1 = runoff1s*(one-snowfrac) + runoff1*snowfrac runoff2 = runoff2s*(one-snowfrac) + runoff2*snowfrac - smelt = smelt * snowfrac - snoh = snoh * snowfrac - snflx = snflx * snowfrac - snom = snom * snowfrac IF (debug_print ) THEN print *,'SOILT combined on ice', soilt ENDIF @@ -2215,15 +2206,13 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia IF (debug_print ) then !if (abs(xlat-testptlat).lt.0.2 .and. abs(xlon-testptlon).lt.0.2)then print *,'Snowfallac xlat, xlon',xlat,xlon - print *,'newsn,rhonewsn,newsnowratio=',newsn,rhonewsn,newsnowratio + print *,'newsn [m],rhonewsn,newsnowratio=',newsn,rhonewsn,newsnowratio print *,'Time-step newsn depth [m], swe [m]',newsn,newsn*rhonewsn print *,'Time-step smelt: swe [m]' ,smelt*delt print *,'Time-step sublim: swe,[kg m-2]',sublim*delt endif - snowfallac = snowfallac + max(zero,(newsn*rhonewsn - & ! source of snow (swe) [m] - (smelt+sublim*1.e-3_kind_phys)*delt*newsnowratio) & ! sink: melting and sublimation, (swe) [m] - /rhonewsn)*rhowater ! snow accumulation in snow depth [mm] + snowfallac = snowfallac + newsn * 1.e3_kind_phys ! accumulated snow depth [mm], using variable snow density IF (debug_print ) THEN !if (abs(xlat-testptlat).lt.0.2 .and. abs(xlon-testptlon).lt.0.2)then @@ -5596,7 +5585,7 @@ SUBROUTINE SNOWTEMP( debug_print,xlat,xlon, & nmelt = 1 soiltfrac=snowfrac*tfrz+(one-snowfrac)*SOILT QSG=min(QSG, QSN(soiltfrac,TBQ)/PP) - qvg=qsg + qvg=snowfrac*qsg+(one-snowfrac)*qvg T3 = STBOLT*TN*TN*TN UPFLUX = T3 * 0.5_kind_phys*(TN + SOILTfrac) XINET = EMISS*(GLW-UPFLUX) From 8f54257bb79106320d6d366fe62f67b4f0640f01 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Mon, 18 Dec 2023 15:48:05 +0000 Subject: [PATCH 115/249] add new flag to track new clm lake freezing grid and let gfs sfclay update stibility variables --- physics/GFS_surface_composites_pre.F90 | 4 +++- physics/clm_lake.f90 | 9 ++++++++- physics/clm_lake.meta | 7 +++++++ physics/sfc_diff.f | 4 +++- physics/sfc_diff.meta | 7 +++++++ 5 files changed, 28 insertions(+), 3 deletions(-) diff --git a/physics/GFS_surface_composites_pre.F90 b/physics/GFS_surface_composites_pre.F90 index 98b9fecd2..fd16dea59 100644 --- a/physics/GFS_surface_composites_pre.F90 +++ b/physics/GFS_surface_composites_pre.F90 @@ -241,8 +241,10 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, iopt_lake, iopt_l !mjz tsfcl(i) = huge endif + if (icy(i) .or. wet(i)) then ! init uustar_ice for all water/ice grids + uustar_ice(i) = uustar(i) + endif if (icy(i)) then ! Ice - uustar_ice(i) = uustar(i) is_clm = lkm>0 .and. iopt_lake==iopt_lake_clm .and. use_lake_model(i)>0 if(lsm /= lsm_ruc .and. .not.is_clm) then weasd_ice(i) = weasd(i) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 620f79a96..64c458a36 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -268,7 +268,7 @@ SUBROUTINE clm_lake_run( & ! Atmospheric model state inputs: tg3, pgr, zlvl, gt0, prsi, phii, qvcurr, gu0, gv0, xlat_d, xlon_d, & ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, rho0, tsfc, & - flag_iter, ISLTYP, rainncprv, raincprv, & + flag_iter, lake_freeze, ISLTYP, rainncprv, raincprv, & ! Feedback to atmosphere: evap_wat, evap_ice, hflx_wat, hflx_ice, gflx_wat, gflx_ice, & @@ -325,6 +325,8 @@ SUBROUTINE clm_lake_run( & rainncprv, raincprv REAL(KIND_PHYS), DIMENSION(:,:), INTENT(in) :: gu0, gv0, prsi, gt0, phii LOGICAL, DIMENSION(:), INTENT(IN) :: flag_iter + LOGICAL, DIMENSION(:), INTENT(INOUT) :: lake_freeze + INTEGER, DIMENSION(:), INTENT(IN) :: ISLTYP ! @@ -754,6 +756,11 @@ SUBROUTINE clm_lake_run( & weasd(i) = weasdi(i) snowd(i) = snodi(c) ! surface_snow_thickness_water_equivalent_over_ice + + if (icy(i) .eq. .false.) then + lake_freeze(i)=.true. + end if + ! Ice points are icy: icy(i)=.true. ! flag_nonzero_sea_ice_surface_fraction ice_points = ice_points+1 diff --git a/physics/clm_lake.meta b/physics/clm_lake.meta index 11a44286a..31d0bdb6e 100644 --- a/physics/clm_lake.meta +++ b/physics/clm_lake.meta @@ -328,6 +328,13 @@ dimensions = (horizontal_loop_extent) type = logical intent = in +[lake_freeze] + standard_name = flag_for_lake_water_freeze + long_name = flag for lake water freeze + units = flag + dimensions = (horizontal_loop_extent) + type = logical + intent = inout [isltyp] standard_name = soil_type_classification long_name = soil type at each grid cell diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 6e834537a..0607748b6 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -60,6 +60,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) + & lake_freeze, & !intent(in) & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) & wet,dry,icy, & !intent(in) & thsfc_loc, & !intent(in) @@ -90,6 +91,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) logical, dimension(:), intent(in) :: flag_iter, dry, icy + logical, dimension(:), intent(in) :: lake_freeze logical, dimension(:), intent(inout) :: wet logical, intent(in) :: thsfc_loc ! Flag for reference pressure in theta calculation @@ -168,7 +170,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type do i=1,im - if(flag_iter(i)) then + if(flag_iter(i) .or. lake_freeze(i) then ! Need to initialize ztmax arrays ztmax_lnd(i) = 1. ! log(1) = 0 diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index eb30b8c50..7abb703cd 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -194,6 +194,13 @@ dimensions = () type = logical intent = in +[lake_freeze] + standard_name = flag_for_lake_water_freeze + long_name = flag for lake water freeze + units = flag + dimensions = (horizontal_loop_extent) + type = logical + intent = inout [u10m] standard_name = x_wind_at_10m long_name = 10 meter u wind speed From b1bb75a8fca26ef8f790eb091c6f9db62809a94b Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 18 Dec 2023 16:50:27 +0000 Subject: [PATCH 116/249] explain lakedepth corruption safeguards --- physics/clm_lake.f90 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index f9341c87b..bc640e1e2 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -239,6 +239,9 @@ subroutine calculate_z_dz_lake(i,input_lakedepth,clm_lakedepth,z_lake,dz_lake) real(kind_lake) :: depthratio if (input_lakedepth(i) == spval .or. input_lakedepth(i) < 0.1) then + ! This is a safeguard against: + ! 1. missing in the lakedepth database (== spval) + ! 2. errors in model cycling or unexpected changes in the orography database (< 0.1) clm_lakedepth(i) = zlak(nlevlake) + 0.5_kind_lake*dzlak(nlevlake) z_lake(1:nlevlake) = zlak(1:nlevlake) dz_lake(1:nlevlake) = dzlak(1:nlevlake) From c6e09641f25767d0008c7c555c2f10b53cb2d0aa Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 18 Dec 2023 18:10:48 +0000 Subject: [PATCH 117/249] explain the snow_mosaic=0 line --- physics/module_sf_ruclsm.F90 | 1 + 1 file changed, 1 insertion(+) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 9ac4493f7..b15592052 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -1703,6 +1703,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia IF (NEWSN > zero .and. snowfracnewsn > 0.99_kind_phys .and. rhosnfall < 450._kind_phys) THEN ! new snow KEEP_SNOW_ALBEDO = one + ! turn off separate treatment of snow covered and snow-free portions of the grid cell snow_mosaic=0. ! ??? ENDIF From 99997c677be9f60768a467996fb99ff993f51b0f Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Mon, 18 Dec 2023 18:23:19 +0000 Subject: [PATCH 118/249] change lake_freeze intent to input only in sfc_diff meta --- physics/sfc_diff.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index 7abb703cd..d10a29d29 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -200,7 +200,7 @@ units = flag dimensions = (horizontal_loop_extent) type = logical - intent = inout + intent = in [u10m] standard_name = x_wind_at_10m long_name = 10 meter u wind speed From 2ceb88bb7c32f37e80c63deba174c8ebb1240a85 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Mon, 18 Dec 2023 18:49:05 +0000 Subject: [PATCH 119/249] add missing parentheses --- physics/sfc_diff.f | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 0607748b6..bf2e8cde0 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -170,7 +170,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type do i=1,im - if(flag_iter(i) .or. lake_freeze(i) then + if(flag_iter(i) .or. lake_freeze(i)) then ! Need to initialize ztmax arrays ztmax_lnd(i) = 1. ! log(1) = 0 From 8941516ed69145557a90794a2fb1253e373c3661 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Tue, 19 Dec 2023 00:31:25 +0000 Subject: [PATCH 120/249] fix compiling error for gnu --- physics/clm_lake.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 64c458a36..f58da2fa3 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -757,7 +757,7 @@ SUBROUTINE clm_lake_run( & snowd(i) = snodi(c) ! surface_snow_thickness_water_equivalent_over_ice - if (icy(i) .eq. .false.) then + if (.not. icy(i)) then lake_freeze(i)=.true. end if From a799bc5d54d6cf3f6503d7214f0cbffc336bc5fb Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Tue, 19 Dec 2023 14:46:51 +0000 Subject: [PATCH 121/249] Revise the following files for the computation of air-sea fluxes. --- physics/satmedmfvdifq.F | 12 +++---- physics/sfc_diag.f | 12 +++---- physics/sfc_diff.f | 77 +++++++++++++++++++++++------------------ physics/sfc_nst.f90 | 24 ++++++------- physics/sfc_ocean.F | 51 +++++++++++++++------------ 5 files changed, 95 insertions(+), 81 deletions(-) diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 55667d515..24c12aa8b 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -144,7 +144,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & !---------------------------------------------------------------------- !*** !*** local variables - real(kind=kind_phys) spd1_m(im) + real(kind=kind_phys) spd1_m !*** integer i,is,k,n,ndt,km1,kmpbl,kmscu,ntrac1,idtend integer kps,kbx,kmx @@ -2379,13 +2379,13 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & enddo enddo do i = 1,im - if(icplocn2atm == 1) then - spd1_m(i)=sqrt( (u1(i,1)-ssu(i))**2+(v1(i,1)-ssv(i))**2 ) - dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1_m(i) - dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1_m(i) - else + if(icplocn2atm == 0) then dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i) dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i) + else + spd1_m=sqrt( (u1(i,1)-ssu(i))**2+(v1(i,1)-ssv(i))**2 ) + dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1_m + dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1_m endif enddo ! diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 1fa7fa450..183da8b0e 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -31,8 +31,8 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & implicit none ! integer, intent(in) :: im, lsm, lsm_ruc, iopt_lake, iopt_lake_clm - integer, intent(in) :: icplocn2atm logical, intent(in) :: use_lake2m + integer, intent(in) :: icplocn2atm logical, intent(in) :: thsfc_loc ! Flag for reference pot. temp. logical, intent(in) :: diag_flux ! Flag for flux method in 2-m diagnostics logical, intent(in) :: diag_log ! Flag for 2-m log diagnostics under stable conditions @@ -74,7 +74,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - + !-- testptlat = 35.3_kind_phys testptlon = 273.0_kind_phys @@ -92,12 +92,12 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & do i = 1, im f10m(i) = fm10(i) / fm(i) - if(icplocn2atm ==1) then - u10m(i) = ssu(i) + f10m(i) * (u1(i)-ssu(i)) - v10m(i) = ssv(i) + f10m(i) * (v1(i)-ssv(i)) - else + if(icplocn2atm ==0) then u10m(i) = f10m(i) * u1(i) v10m(i) = f10m(i) * v1(i) + else + u10m(i) = ssu(i)+f10m(i) * (u1(i)-ssu(i)) + v10m(i) = ssv(i)+f10m(i) * (v1(i)-ssv(i)) endif have_2m = use_lake_model(i)>0 .and. use_lake2m .and. & & iopt_lake==iopt_lake_clm diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 9c00b7040..1b801aa7a 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -128,9 +128,9 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! locals ! integer i - real(kind=kind_phys), dimension(im) :: windrel, wind10m + real(kind=kind_phys) :: windrel ! - real(kind=kind_phys) :: rat, tv1, thv1, restar, + real(kind=kind_phys) :: rat, tv1, thv1, restar, wind10m, & czilc, tem1, tem2, virtfac ! @@ -170,21 +170,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! surface roughness length is converted to m from cm ! -! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type - - - if(icplocn2atm == 1) then - do i=1,im - windrel(i)=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) - wind10m(i)= sqrt( (u10m(i)-ssu(i))**2 + (v10m(i)-ssv(i))**2 ) - enddo - else - do i=1,im - wind10m(i)= sqrt( u10m(i)**2 + v10m(i)**2 ) - windrel(i)=wind(i) - enddo - endif - do i=1,im if(flag_iter(i)) then @@ -290,13 +275,24 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) tem2 = max(sigmaf(i), 0.1_kp) zvfun(i) = sqrt(tem1 * tem2) ! - call stability + if(icplocn2atm == 0) then + call stability +! --- inputs: + & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, +! --- outputs: + & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), + & cm_lnd(i), ch_lnd(i), stress_lnd(i), ustar_lnd(i)) + else + windrel=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), - & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, + & (z1(i), zvfun(i), gdx, tv1, thv1, windrel, + & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, ! --- outputs: - & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), - & cm_lnd(i), ch_lnd(i), stress_lnd(i), ustar_lnd(i)) + & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), + & cm_lnd(i), ch_lnd(i), stress_lnd(i), ustar_lnd(i)) + endif endif ! Dry points if (icy(i)) then ! Some ice @@ -344,13 +340,23 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ztmax_ice(i) = max(ztmax_ice(i), 1.0e-6) ! - call stability + if(icplocn2atm == 0) then + call stability +! --- inputs: + & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, +! --- outputs: + & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), + & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i)) + else + call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), - & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, + & (z1(i), zvfun(i), gdx, tv1, thv1, windrel, + & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, ! --- outputs: - & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), - & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i)) + & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), + & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i)) + endif endif ! Icy points ! BWG: Everything from here to end of subroutine was after @@ -370,7 +376,11 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0 = 0.01_kp * z0rl_wat(i) z0max = max(zmin, min(z0,z1(i))) ! ustar_wat(i) = sqrt(grav * z0 / charnock) -! wind10m = sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) + if(icplocn2atm == 0) then + wind10m=sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) + else + wind10m=sqrt((u10m(i)-ssu(i))**2 + (v10m(i)-ssv(i))**2) + endif !** test xubin's new z0 @@ -389,9 +399,9 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ztmax_wat(i) = max(z0max * exp(-rat), zmin) ! if (sfc_z0_type == 6) then - call znot_t_v6(wind10m(i), ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) + call znot_t_v6(wind10m, ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) else if (sfc_z0_type == 7) then - call znot_t_v7(wind10m(i), ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) + call znot_t_v7(wind10m, ztmax_wat(i)) ! 10-m wind,m/s, ztmax(m) else if (sfc_z0_type > 0) then write(0,*)'no option for sfc_z0_type=',sfc_z0_type errflg = 1 @@ -401,7 +411,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), +! & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), + & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), & z0max, ztmax_wat(i), tvs, grav, thsfc_loc, ! --- outputs: & rb_wat(i), fm_wat(i), fh_wat(i), fm10_wat(i), fh2_wat(i), @@ -432,10 +443,10 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) endif elseif (sfc_z0_type == 6) then ! wang - call znot_m_v6(wind10m(i), z0) ! wind, m/s, z0, m + call znot_m_v6(wind10m, z0) ! wind, m/s, z0, m z0rl_wat(i) = 100.0_kp * z0 ! cm elseif (sfc_z0_type == 7) then ! wang - call znot_m_v7(wind10m(i), z0) ! wind, m/s, z0, m + call znot_m_v7(wind10m, z0) ! wind, m/s, z0, m z0rl_wat(i) = 100.0_kp * z0 ! cm else z0rl_wat(i) = 1.0e-4_kp diff --git a/physics/sfc_nst.f90 b/physics/sfc_nst.f90 index 3b5229ba4..1844a1077 100644 --- a/physics/sfc_nst.f90 +++ b/physics/sfc_nst.f90 @@ -240,21 +240,12 @@ subroutine sfc_nst_run & ! real (kind=kind_phys), parameter :: alps=1.0, bets=1.0, gams=0.2, real (kind=kind_phys), parameter :: alps=0.75,bets=0.75,gams=0.15, & ws10cr=30., conlf=7.2e-9, consf=6.4e-8 - real (kind=kind_phys) :: windrel(im) + real (kind=kind_phys) :: windrel ! !====================================================================================================== ! Initialize CCPP error handling variables errmsg = '' errflg = 0 - if(icplocn2atm ==1) then - do i=1,im - windrel(i) = sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) - enddo - else - do i=1,im - windrel(i) = wind(i) - enddo - endif if (nstf_name1 == 0) return ! No NSST model used @@ -326,9 +317,16 @@ subroutine sfc_nst_run & ! --- ... rcp = rho cp ch v - rch(i) = rho_a(i) * cp * ch(i) * windrel(i) - cmm(i) = cm (i) * windrel(i) - chh(i) = rho_a(i) * ch(i) * windrel(i) + if(icplocn2atm ==0) then + rch(i) = rho_a(i) * cp * ch(i) * wind(i) + cmm(i) = cm (i) * wind(i) + chh(i) = rho_a(i) * ch(i) * wind(i) + else + windrel= sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + rch(i) = rho_a(i) * cp * ch(i) * windrel + cmm(i) = cm (i) * windrel + chh(i) = rho_a(i) * ch(i) * windrel + endif !> - Calculate latent and sensible heat flux over open water with tskin. ! at previous time step diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index cde28072a..d8b33f3dc 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -40,7 +40,7 @@ subroutine sfc_ocean_run & ! call sfc_ocean ! ! inputs: ! ! ( im, ps, u1, v1, t1, q1, tskin, cm, ch, lseaspray, fm, fm10, ! -! ssu, ssv, icplocn2atm, ! +! ssu, ssv, icplocn2atm, ! ! prsl1, prslki, wet, use_lake_model, wind, flag_iter, ! ! use_med_flux, ! ! outputs: ! @@ -69,8 +69,8 @@ subroutine sfc_ocean_run & ! ps - real, surface pressure im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! ! ssu,ssv - real, u/v component of surface ocean current (m/s) im ! -! icplocn2atm - integer, option for including 1 ! -! ocean current in the computation of flux ! +! icplocn2atm - integrt, =1 if ssu and ssv are used in the 1 ! +! computation of air-sea fluxes ! ! t1 - real, surface layer mean temperature ( k ) im ! ! q1 - real, surface layer mean specific humidity im ! ! tskin - real, ground surface skin temperature ( k ) im ! @@ -110,19 +110,18 @@ subroutine sfc_ocean_run & & zero = 0.0_kind_phys, qmin = 1.0e-8_kind_phys ! --- inputs: integer, intent(in) :: im - integer, intent(in) :: icplocn2atm real (kind=kind_phys), intent(in) :: hvap, cp, rd, & & eps, epsm1, rvrdm1 real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & - & t1, q1, tskin, cm, ch, fm, fm10, prsl1, prslki, wind, ssu, & - & ssv + & t1, q1, tskin, cm, ch, fm, fm10, prsl1, prslki, wind, ssu,ssv ! For sea spray effect logical, intent(in) :: lseaspray ! logical, dimension(:), intent(in) :: flag_iter, wet integer, dimension(:), intent(in) :: use_lake_model + integer, intent(in) :: icplocn2atm ! logical, intent(in) :: use_med_flux @@ -140,8 +139,9 @@ subroutine sfc_ocean_run & ! --- locals: real (kind=kind_phys) :: qss, rch, tem, - & elocp, cpinv, hvapi, windrel(im) + & elocp, cpinv, hvapi real (kind=kind_phys), dimension(im) :: rho, q0 + real (kind=kind_phys), dimension(im) :: windrel integer :: i @@ -165,16 +165,6 @@ subroutine sfc_ocean_run & errmsg = '' errflg = 0 - if(icplocn2atm == 1) then - do i=1,im - windrel(i) = sqrt((u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2) - enddo - else - do i=1,im - windrel(i) = wind(i) - enddo - endif - cpinv = one/cp hvapi = one/hvap elocp = hvap/cp @@ -187,12 +177,21 @@ subroutine sfc_ocean_run & ! rho is density, qss is sat. hum. at surface if ( flag(i) ) then + if (icplocn2atm == 1) then + windrel(i)=sqrt( (u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2 ) + endif + if (use_med_flux) then q0(i) = max( q1(i), qmin ) rho(i) = prsl1(i) / (rd*t1(i)*(one + rvrdm1*q0(i))) - - tem = ch(i) * windrel(i) - cmm(i) = cm(i) * windrel(i) + + if (icplocn2atm == 0) then + tem = ch(i) * wind(i) + cmm(i) = cm(i) * wind(i) + else + tem = ch(i) * windrel(i) + cmm(i) = cm(i) * windrel(i) + endif chh(i) = rho(i) * tem hflx(i) = dtsfc_med(i) @@ -209,9 +208,15 @@ subroutine sfc_ocean_run & ! --- ... rcp = rho cp ch v - rch = rho(i) * cp * ch(i) * windrel(i) - tem = ch(i) * windrel(i) - cmm(i) = cm(i) * windrel(i) + if (icplocn2atm == 0) then + rch = rho(i) * cp * ch(i) * wind(i) + tem = ch(i) * wind(i) + cmm(i) = cm(i) * wind(i) + else + rch = rho(i) * cp * ch(i) * windrel(i) + tem = ch(i) * windrel(i) + cmm(i) = cm(i) * windrel(i) + endif chh(i) = rho(i) * tem !> - Calcualte sensible and latent heat flux over open water From 0fbcc9f62ad182ded98fcde2e4c2287ee3334738 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Tue, 19 Dec 2023 15:22:38 +0000 Subject: [PATCH 122/249] change name of lake_freeze to flag_lakefreeze --- physics/clm_lake.f90 | 6 +++--- physics/clm_lake.meta | 2 +- physics/sfc_diff.f | 6 +++--- physics/sfc_diff.meta | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index f58da2fa3..77d647812 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -268,7 +268,7 @@ SUBROUTINE clm_lake_run( & ! Atmospheric model state inputs: tg3, pgr, zlvl, gt0, prsi, phii, qvcurr, gu0, gv0, xlat_d, xlon_d, & ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, rho0, tsfc, & - flag_iter, lake_freeze, ISLTYP, rainncprv, raincprv, & + flag_iter, flag_lakefreeze, ISLTYP, rainncprv, raincprv, & ! Feedback to atmosphere: evap_wat, evap_ice, hflx_wat, hflx_ice, gflx_wat, gflx_ice, & @@ -325,7 +325,7 @@ SUBROUTINE clm_lake_run( & rainncprv, raincprv REAL(KIND_PHYS), DIMENSION(:,:), INTENT(in) :: gu0, gv0, prsi, gt0, phii LOGICAL, DIMENSION(:), INTENT(IN) :: flag_iter - LOGICAL, DIMENSION(:), INTENT(INOUT) :: lake_freeze + LOGICAL, DIMENSION(:), INTENT(INOUT) :: flag_lakefreeze INTEGER, DIMENSION(:), INTENT(IN) :: ISLTYP @@ -758,7 +758,7 @@ SUBROUTINE clm_lake_run( & if (.not. icy(i)) then - lake_freeze(i)=.true. + flag_lakefreeze(i)=.true. end if ! Ice points are icy: diff --git a/physics/clm_lake.meta b/physics/clm_lake.meta index 31d0bdb6e..5c454dd11 100644 --- a/physics/clm_lake.meta +++ b/physics/clm_lake.meta @@ -328,7 +328,7 @@ dimensions = (horizontal_loop_extent) type = logical intent = in -[lake_freeze] +[flag_lakefreeze] standard_name = flag_for_lake_water_freeze long_name = flag for lake water freeze units = flag diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index bf2e8cde0..c5ed8bfa6 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -60,7 +60,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & sigmaf,vegtype,shdmax,ivegsrc, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) - & lake_freeze, & !intent(in) + & flag_lakefreeze, & !intent(in) & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) & wet,dry,icy, & !intent(in) & thsfc_loc, & !intent(in) @@ -91,7 +91,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) logical, intent(in) :: redrag ! reduced drag coeff. flag for high wind over sea (j.han) logical, dimension(:), intent(in) :: flag_iter, dry, icy - logical, dimension(:), intent(in) :: lake_freeze + logical, dimension(:), intent(in) :: flag_lakefreeze logical, dimension(:), intent(inout) :: wet logical, intent(in) :: thsfc_loc ! Flag for reference pressure in theta calculation @@ -170,7 +170,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type do i=1,im - if(flag_iter(i) .or. lake_freeze(i)) then + if(flag_iter(i) .or. flag_lakefreeze(i)) then ! Need to initialize ztmax arrays ztmax_lnd(i) = 1. ! log(1) = 0 diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index d10a29d29..1aaad7239 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -194,7 +194,7 @@ dimensions = () type = logical intent = in -[lake_freeze] +[flag_lakefreeze] standard_name = flag_for_lake_water_freeze long_name = flag for lake water freeze units = flag From a9208405adffd6b1b6389ac3f1331097b05069ad Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Tue, 19 Dec 2023 16:45:32 +0000 Subject: [PATCH 123/249] remove excess whitespace --- physics/clm_lake.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index 77d647812..607c0b2df 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -268,7 +268,7 @@ SUBROUTINE clm_lake_run( & ! Atmospheric model state inputs: tg3, pgr, zlvl, gt0, prsi, phii, qvcurr, gu0, gv0, xlat_d, xlon_d, & ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, rho0, tsfc, & - flag_iter, flag_lakefreeze, ISLTYP, rainncprv, raincprv, & + flag_iter, flag_lakefreeze, ISLTYP, rainncprv, raincprv, & ! Feedback to atmosphere: evap_wat, evap_ice, hflx_wat, hflx_ice, gflx_wat, gflx_ice, & From 65358b905b40f16f4c5ee312025fb9cfc37dce89 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Tue, 19 Dec 2023 19:23:49 +0000 Subject: [PATCH 124/249] "update to address code reviewers' comments" --- physics/cu_gf_deep.F90 | 25 +- physics/cu_gf_driver.F90 | 7 +- physics/cu_gf_driver.meta | 2 +- physics/cu_gf_driver_post.F90 | 4 +- physics/cu_gf_driver_post.meta | 2 +- physics/cu_gf_driver_pre.F90 | 4 +- physics/cu_gf_driver_pre.meta | 2 +- physics/smoke_dust/coarsepm_settling_mod.F90 | 1 - physics/smoke_dust/dep_dry_mod_emerson.F90 | 104 ++------ physics/smoke_dust/dep_dry_simple_mod.F90 | 5 - physics/smoke_dust/dust_fengsha_mod.F90 | 3 - physics/smoke_dust/module_add_emiss_burn.F90 | 84 +++---- physics/smoke_dust/module_plumerise.F90 | 172 +++++++++++++ physics/smoke_dust/module_plumerise1.F90 | 225 ------------------ physics/smoke_dust/module_smoke_plumerise.F90 | 4 +- physics/smoke_dust/module_wetdep_ls.F90 | 3 + physics/smoke_dust/plume_data_mod.F90 | 1 - physics/smoke_dust/rrfs_smoke_config.F90 | 3 +- physics/smoke_dust/rrfs_smoke_postpbl.meta | 2 +- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 156 ++++++------ physics/smoke_dust/rrfs_smoke_wrapper.meta | 17 +- physics/smoke_dust/seas_mod.F90 | 1 - 22 files changed, 354 insertions(+), 473 deletions(-) create mode 100755 physics/smoke_dust/module_plumerise.F90 delete mode 100755 physics/smoke_dust/module_plumerise1.F90 diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index ab72c662c..b45452000 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -223,6 +223,7 @@ subroutine cu_gf_deep_run( & real(kind=kind_phys), dimension (its:ite,nchem) & , intent (out) :: wetdpc_deep real(kind=kind_phys), intent (in) :: fscav(:) +!$acc declare copy(chem3d) copyout(wetdpc_deep) copyin(fscav) real(kind=kind_phys) & ,intent (in ) :: & @@ -314,6 +315,8 @@ subroutine cu_gf_deep_run( & real(kind=kind_phys), dimension (kts:kte) :: trac,trcflx_in,trcflx_out,trc,trco real(kind=kind_phys), dimension (its:ite,kts:kte) :: pwdper, massflx integer :: nv +!$acc declare create(chem,chem_cup,chem_up,chem_down,dellac,dellac2,chem_c,chem_pw,chem_pwd, & +!$acc chem_pwav,chem_psum,pwdper,massflux) real(kind=kind_phys), dimension (its:ite,kts:kte) :: & entr_rate_2d,mentrd_rate_2d,he,hes,qes,z, heo,heso,qeso,zo, & @@ -424,7 +427,7 @@ subroutine cu_gf_deep_run( & integer, dimension (its:ite,kts:kte) :: k_inv_layers real(kind=kind_phys), dimension (its:ite) :: c0 ! HCB real(kind=kind_phys), dimension (its:ite,kts:kte) :: c0t3d ! hli for smoke/dust wet scavenging -!$acc declare create(pmin_lev,start_level,ktopkeep,dtempdz,k_inv_layers,c0) +!$acc declare create(pmin_lev,start_level,ktopkeep,dtempdz,k_inv_layers,c0,c0t3d) ! rainevap from sas real(kind=kind_phys) zuh2(40) @@ -2046,6 +2049,7 @@ subroutine cu_gf_deep_run( & ! initialize tracers if they exist ! chem (:,:,:) = 0. +!$acc kernels do nv = 1,nchem do k = 1, ktf do i = 1, itf @@ -2069,7 +2073,7 @@ subroutine cu_gf_deep_run( & do i=its,itf if(ierr(i).eq.0)then do k=kts,jmin(i) - pwdper(i,k)=-edtc(i,1)*pwdo(i,k)/pwavo(i) + if(pwavo(i).ne.0.) pwdper(i,k)=-edtc(i,1)*pwdo(i,k)/pwavo(i) enddo pwdper(i,:)=0. do nv=1,nchem @@ -2094,8 +2098,6 @@ subroutine cu_gf_deep_run( & trash=chem_c(i,k,nv)/(1.+c0t3d(i,k)*dz) chem_pw=c0t3d(i,k)*dz*trash*zuo(i,k) chem_up(i,k,nv)=trash2+trash -! chem_pw(i,k,nv)=min(chem_up(i,k,nv),chem_c(i,k,nv)*pwo(i,k)/zuo(i,k)/(1.e-8+qrco(i,k))) -! chem_up(i,k,nv)=chem_up(i,k,nv)-chem_pw(i,k,nv) chem_pwav(i,nv)=chem_pwav(i,nv)+chem_pw(i,k,nv)! *g/dp enddo do k=ktop(i)+1,ktf @@ -2109,11 +2111,11 @@ subroutine cu_gf_deep_run( & do ki=jmin(i),2,-1 dp=100.*(po_cup(i,ki)-po_cup(i,ki+1)) chem_down(i,ki,nv)=(chem_down(i,ki+1,nv)*zdo(i,ki+1) & - -.5*dd_massdetro(i,ki)*chem_down(i,ki+1,nv)+ & + -.5_kind_phys*dd_massdetro(i,ki)*chem_down(i,ki+1,nv)+ & dd_massentro(i,ki)*chem(i,ki,nv)) / & - (zdo(i,ki+1)-.5*dd_massdetro(i,ki)+dd_massentro(i,ki)) + (zdo(i,ki+1)-.5_kind_phys*dd_massdetro(i,ki)+dd_massentro(i,ki)) chem_down(i,ki,nv)=chem_down(i,ki,nv)+pwdper(i,ki)*chem_pwav(i,nv) - chem_pwd(i,ki,nv)=max(0.,pwdper(i,ki)*chem_pwav(i,nv)) + chem_pwd(i,ki,nv)=max(0._kind_phys,pwdper(i,ki)*chem_pwav(i,nv)) enddo ! total wet deposition do k=1,ktf-1 @@ -2167,6 +2169,7 @@ subroutine cu_gf_deep_run( & dellac2(:,:,:)=0. massflx(:,:)=0. do nv=1,nchem +!$acc loop private(trcflx_in) do i=its,itf if(ierr(i).eq.0)then trcflx_in(:)=0. @@ -2174,8 +2177,8 @@ subroutine cu_gf_deep_run( & ! initialize fct routine do k=kts,ktop(i) - dp=100.*(po_cup(i,k)-po_cup(i,k+1)) - dtime_max=min(dtime_max,.5*dp) + dp=100._kind_phys*(po_cup(i,k)-po_cup(i,k+1)) + dtime_max=min(dtime_max,.5_kind_phys*dp) massflx(i,k)=-xmb(i)*(zuo(i,k)-edto(i)*zdo(i,k)) trcflx_in(k)=massflx(i,k)*chem_cup(i,k,nv) enddo @@ -2212,6 +2215,7 @@ subroutine cu_gf_deep_run( & wetdpc_deep(i,nv)=max(wetdpc_deep(i,nv),qamin) enddo enddo +!$acc end kernels endif ! nchem > 0 @@ -4345,6 +4349,7 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & ,intent (in ) :: & kbcon,ktop,k22,xland1 !$acc declare copyin(p_cup,rho,q,zu,gamma_cup,qe_cup,up_massentr,up_massdetr,dby,qes_cup,z_cup,zqexec,c0,kbcon,ktop,k22,xland1) +!$acc declare copy(c0t3d) real(kind=kind_phys), intent (in ) :: & ! HCB ccnclean ! @@ -4421,7 +4426,9 @@ subroutine cup_up_moisture(name,ierr,z_cup,qc,qrc,pw,pwav, & c0_iceconv=0.01 c1d_b=c1d bdsp(:)=bdispm +!$acc kernels c0t3d = 0. +!$acc end kernels ! !--- no precip for small clouds diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index d8bc11629..e4a78b030 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -155,9 +155,10 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer, intent(in ) :: imfshalcnv integer, dimension(:), intent(inout) :: 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 -!$acc declare copy(cactiv,cactiv_m) +!$acc declare copy(cactiv,cactiv_m,chem3d,wetdpc_deep) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -188,14 +189,14 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer, dimension (im) :: k22s,kbcons,ktops,k22,jmin,jminm integer, dimension (im) :: kbconm,ktopm,k22m !$acc declare create(k22_shallow,kbcon_shallow,ktop_shallow,rand_mom,rand_vmas, & -!$acc rand_clos,gdc,gdc2,ht,ccn_gf,ccn_m,dx,frhm,frhd, & +!$acc rand_clos,gdc,gdc2,ht,ccn_gf,ccn_m,dx,frhm,frhd,wetdpc_mid, & !$acc outt,outq,outqc,phh,subm,cupclw,cupclws, & !$acc dhdt,zu,zus,zd,phf,zum,zdm,outum,outvm, & !$acc outts,outqs,outqcs,outu,outv,outus,outvs, & !$acc outtm,outqm,outqcm,submm,cupclwm, & !$acc cnvwt,cnvwts,cnvwtm,hco,hcdo,zdo,zdd,hcom,hcdom,zdom, & !$acc tau_ecmwf,edt,edtm,edtd,ter11,aa0,xlandi, & -!$acc pret,prets,pretm,hexec,forcing,forcing2, & +!$acc pret,prets,pretm,hexec,forcing,forcing2,wetdpc_mid, & !$acc kbcon, ktop,ierr,ierrs,ierrm,kpbli, & !$acc k22s,kbcons,ktops,k22,jmin,jminm,kbconm,ktopm,k22m) diff --git a/physics/cu_gf_driver.meta b/physics/cu_gf_driver.meta index d6d874f7e..dce20064a 100644 --- a/physics/cu_gf_driver.meta +++ b/physics/cu_gf_driver.meta @@ -614,7 +614,7 @@ intent = in [nchem] standard_name = number_of_chemical_species_vertically_mixed - long_name = number of chemical vertically mixed + long_name = number of chemical species vertically mixed units = count dimensions = () type = integer diff --git a/physics/cu_gf_driver_post.F90 b/physics/cu_gf_driver_post.F90 index 1700fbde9..6ed1321bc 100644 --- a/physics/cu_gf_driver_post.F90 +++ b/physics/cu_gf_driver_post.F90 @@ -35,7 +35,7 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m integer, intent(in) :: ntsmoke, ntdust, ntcoarsepm real(kind_phys), intent(inout) :: chem3d(:,:,:), gq0(:,:,:) character(len=*), intent(out) :: errmsg -!$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m) +!$acc declare copyin(t,q,cactiv,cactiv_m) copyout(prevst,prevsq,conv_act,conv_act_m,chem3d,gq0) integer, intent(out) :: errflg ! Local variables @@ -61,13 +61,13 @@ subroutine cu_gf_driver_post_run (im, km, t, q, prevst, prevsq, cactiv, cactiv_m conv_act_m(i)=0.0 endif enddo -!$acc end kernels if (rrfs_sd) then gq0(:,:,ntsmoke ) = chem3d(:,:,1) gq0(:,:,ntdust ) = chem3d(:,:,2) gq0(:,:,ntcoarsepm) = chem3d(:,:,3) endif +!$acc end kernels end subroutine cu_gf_driver_post_run diff --git a/physics/cu_gf_driver_post.meta b/physics/cu_gf_driver_post.meta index 4c04224dc..f8320d5c9 100644 --- a/physics/cu_gf_driver_post.meta +++ b/physics/cu_gf_driver_post.meta @@ -85,7 +85,7 @@ intent = out [rrfs_sd] standard_name = do_smoke_coupling - long_name = flag controlling rrfs_sd collection (default off) + long_name = flag controlling rrfs_sd collection units = flag dimensions = () type = logical diff --git a/physics/cu_gf_driver_pre.F90 b/physics/cu_gf_driver_pre.F90 index 6be7b8aec..7ff66be21 100644 --- a/physics/cu_gf_driver_pre.F90 +++ b/physics/cu_gf_driver_pre.F90 @@ -44,7 +44,7 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, real(kind_phys), intent(in) :: conv_act(:) real(kind_phys), intent(in) :: conv_act_m(:) real(kind_phys), intent(inout) :: chem3d(:,:,:), gq0(:,:,:) -!$acc declare copyin(conv_act,conv_act_m) +!$acc declare copyin(conv_act,conv_act_m) copy(chem3d,gq0) character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -81,13 +81,13 @@ subroutine cu_gf_driver_pre_run (flag_init, flag_restart, kdt, fhour, dtp, t, q, !$acc kernels cactiv(:)=nint(conv_act(:)) cactiv_m(:)=nint(conv_act_m(:)) -!$acc end kernels if (rrfs_sd) then chem3d(:,:,1) = gq0(:,:,ntsmoke) chem3d(:,:,2) = gq0(:,:,ntdust) chem3d(:,:,3) = gq0(:,:,ntcoarsepm) endif +!$acc end kernels end subroutine cu_gf_driver_pre_run diff --git a/physics/cu_gf_driver_pre.meta b/physics/cu_gf_driver_pre.meta index 6d8787d06..49cc98148 100644 --- a/physics/cu_gf_driver_pre.meta +++ b/physics/cu_gf_driver_pre.meta @@ -124,7 +124,7 @@ intent = in [rrfs_sd] standard_name = do_smoke_coupling - long_name = flag controlling rrfs_sd collection (default off) + long_name = flag controlling rrfs_sd collection units = flag dimensions = () type = logical diff --git a/physics/smoke_dust/coarsepm_settling_mod.F90 b/physics/smoke_dust/coarsepm_settling_mod.F90 index 49f229453..b044edb67 100755 --- a/physics/smoke_dust/coarsepm_settling_mod.F90 +++ b/physics/smoke_dust/coarsepm_settling_mod.F90 @@ -64,7 +64,6 @@ SUBROUTINE coarsepm_settling_driver(dt,t_phy, & airmas(1,1,kk)=-(p8w(i,k+1,j)-p8w(i,k,j))*area(i,j)/g airden(1,1,kk)=rho_phy(i,k,j) tmp(1,1,kk)=t_phy(i,k,j) -! rh(1,1,kk) = rel_hum(i,k,j) ! hli do nv = 1, num_chem chem_before(i,j,k,nv) = chem(i,k,j,nv) enddo diff --git a/physics/smoke_dust/dep_dry_mod_emerson.F90 b/physics/smoke_dust/dep_dry_mod_emerson.F90 index d2d34bb4e..76fdc2411 100755 --- a/physics/smoke_dust/dep_dry_mod_emerson.F90 +++ b/physics/smoke_dust/dep_dry_mod_emerson.F90 @@ -9,7 +9,7 @@ module dep_dry_emerson_mod use machine , only : kind_phys use dep_data_mod ! JLS - use rrfs_smoke_config + use rrfs_smoke_config, only : num_chem, p_smoke, p_dust_1, p_coarse_pm implicit none @@ -20,7 +20,7 @@ module dep_dry_emerson_mod contains subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & chem,delz,snowh,t_phy,p_phy,rho_phy,ivgtyp,g0,dt, & - settling_flag,drydep_flux,settling_flux, & + settling_flag,drydep_flux,settling_flux,dbg_opt, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) @@ -38,13 +38,14 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) , & - INTENT(INOUT) :: ustar, rmol, znt, snowh + INTENT(IN) :: ustar, rmol, znt, snowh REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), & INTENT(IN ) :: t_phy, rho_phy, p_phy, delz INTEGER, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: ivgtyp REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), & INTENT(INOUT ) :: chem REAL(kind_phys), INTENT(IN) :: g0,dt + LOGICAL, INTENT(IN) :: dbg_opt ! ! Output arrays REAL(kind_phys), DIMENSION( ims:ime, jms:jme, ndvel ), INTENT(INOUT) :: ddvel @@ -73,6 +74,7 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & real(kind_phys) :: Rs ! Surface resistance real(kind_phys) :: vgpart real(kind_phys) :: growth_fac,vsettl,dtmax,conver,converi,dzmin + real(kind_phys) :: rmol_local real(kind_phys), dimension( kts:kte) :: rho_col, delz_col real(kind_phys), dimension(ndvel) :: dt_settl, chem_before, chem_after real(kind_phys), dimension( kts:kte, ndvel ) :: cblk_col, vg_col @@ -93,6 +95,7 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & do j = jts, jte do i = its, ite aer_res(i,j) = 0.0 + rmol_local = rmol(i,j) do k = kts, kte delz_col(k) = delz(i,k,j) rho_col(k) = rho_phy(i,k,j) @@ -108,14 +111,9 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & ! where beta = 1.458e-6 [ kg sec^-1 K**-0.5 ], s = 110.4 [ K ]. amu = 1.458E-6 * t_phy(i,k,j) * sqrt(t_phy(i,k,j)) / ( t_phy(i,k,j) + 110.4 ) ! Aerodynamic resistance - call depvel( rmol(i,j), dep_ref_hgt, znt(i,j), ustar(i,j), vgpart, aer_res(i,j) ) + call depvel( rmol_local, dep_ref_hgt, znt(i,j), ustar(i,j), vgpart, aer_res(i,j) ) ! depvel uses meters, need to convert to s/cm - aer_res(i,j) = max(aer_res(i,j)/100.,0.) - ! Get the aerosol properties dp and aerodens and mean free path (xlm) - ! FOR RRFS-SD, diameters and densities are explicityly defined - !call modpar( cblk,t_phy(i,k,j),p_phy(i,k,j), amu, & - ! pmasssn,pmassa,pmassc,pdensn,pdensa,pdensc, & - ! dgnuc,dgacc,dgcor,knnuc,knacc,kncor,xlm, ndvel ) + aer_res(i,j) = max(aer_res(i,j)/100._kind_phys,0._kind_phys) ! Air kinematic viscosity (cm^2/s) airkinvisc = ( 1.8325e-4 * ( 416.16 / ( t_phy(i,k,j) + 120.0 ) ) * & ( ( t_phy(i,k,j) / 296.16 )**1.5 ) ) / ( rho_phy(i,k,j) / 28.966e3 ) ! Convert density to mol/cm^3 @@ -182,6 +180,10 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & ! Compute final ddvel = aer_res + RS, set max at max_dep_vel in dep_data_mod.F[ m/s] ! The /100. term converts from cm/s to m/s, required for MYNN. ddvel(i,j,nv) = min( (1. / (aer_res(i,j) + Rs ))/100., max_dep_vel) + if ( dbg_opt ) then + WRITE(6,*) 'dry_dep_mod_emerson: i,j,nv',i,j,nv + WRITE(6,*) 'dry_dep_mod_emerson: deposition velocity (m/s) ',ddvel(i,j,nv) + endif drydep_flux(i,j,nv) = chem(i,kts,j,chem_pointers(nv))*p_phy(i,kts,j) / & (RSI*t_phy(i,kts,j))*ddvel(i,j,nv)*dt*1.E-6 endif ! k == kts @@ -216,9 +218,10 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & ndt_settl(nv) = MAX( 1, INT( ntdt /dtmax) ) ! Limit maximum number of iterations IF (ndt_settl(nv) > 12) ndt_settl(nv) = 12 - dt_settl(nv) = REAL(ntdt) / REAL(ndt_settl(nv)) + dt_settl(nv) = REAL(ntdt,kind=kind_phys) /REAL(ndt_settl(nv),kind=kind_phys) enddo do nv = 1, ndvel + chem_before(nv) = 0._kind_phys do k = kts, kte chem_before(nv) = chem_before(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 enddo @@ -229,6 +232,8 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & endif ! Put cblk back into chem array do nv= 1, ndvel + chem_after(nv) = 0._kind_phys + settling_flux(i,j,nv) = 0._kind_phys do k = kts, kte chem(i,k,j,chem_pointers(nv)) = cblk_col(k,nv) chem_after(nv) = chem_after(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 @@ -302,7 +307,7 @@ subroutine depvel( rmol, zr, z0, ustar, vgpart, aer_res ) ELSE IF (rmol==0.) THEN polint = 0.74*alog(zr/z0) ELSE - polint = 0.74*alog(zr/z0) + 4.7*rmol*(zr-z0) + polint = 0.74_kind_phys*alog(zr/z0) + 4.7_kind_phys*rmol*(zr-z0) END IF vgpart = ustar*vk/polint aer_res = polint/(karman*max(ustar,1.0e-4)) @@ -310,81 +315,6 @@ end subroutine depvel ! !-------------------------------------------------------------------------------- ! -subroutine modpar( cblk, blkta, blkprs, amu, & - pmassn,pmassa,pmassc, pdensn,pdensa,pdensc, & - dgnuc,dgacc,dgcor,knnuc,knacc,kncor, xlm,ndvel ) - IMPLICIT NONE - - INTEGER, INTENT(IN) :: ndvel - REAL(kind_phys), DIMENSION(ndvel), INTENT( IN) :: cblk - REAL(kind_phys), INTENT(IN ) :: blkta, blkprs, amu - REAL(kind_phys), INTENT(OUT) :: pmassn,pmassa,pmassc,pdensn,pdensa,pdensc, & - dgnuc,dgacc,dgcor,knnuc,knacc,kncor,xlm -! -! Local - REAL(kind_phys) :: xxlsgn,xxlsga,xxlsgc,l2sginin,l2sginia,l2sginic, & - en1,ea1,ec1,esn04,esa04,esc04, & - esn08,esa08,esc08,esn16,esa16,esc16, & - esn20,esa20,esc20,esn36,esa36,esc36 - REAL(kind_phys), DIMENSION( 6 ) :: nblk ! number densities -! Pointers - INTEGER, PARAMETER :: vnu0 = 1 - INTEGER, PARAMETER :: vac0 = 2 - INTEGER, PARAMETER :: vcorn = 3 - INTEGER, PARAMETER :: vnu3 = 4 - INTEGER, PARAMETER :: vac3 = 5 - INTEGER, PARAMETER :: vcor3 = 6 -! - xxlsgn = log(sginin) - xxlsga = log(sginia) - xxlsgc = log(sginic) - l2sginin = xxlsgn**2 - l2sginia = xxlsga**2 - l2sginic = xxlsgc**2 - en1 = exp(0.125*l2sginin) - ea1 = exp(0.125*l2sginia) - ec1 = exp(0.125*l2sginic) - esn04 = en1**4 - esa04 = ea1**4 - esc04 = ec1**4 - esn08 = esn04*esn04 - esa08 = esa04*esa04 - esc08 = esc04*esc04 - esn16 = esn08*esn08 - esa16 = esa08*esa08 - esc16 = esc08*esc08 - esn20 = esn16*esn04 - esa20 = esa16*esa04 - esc20 = esc16*esc04 - esn36 = esn16*esn20 - esa36 = esa16*esa20 - esc36 = esc16*esc20 -! First step in WRF-Chem is to add together the aitken, accumulation, and coarse modes -! Calculate number densities - nblk(vnu0) = max(conmin,0.0) - nblk(vnu3) = max(conmin,0.0) - nblk(vac0) = max(conmin, (cblk(1)/rhosmoke + cblk(2)/rhodust)*fact_wfa) - nblk(vcorn) = max(conmin, cblk(3)/rhodust*fact_wfa) - nblk(vac3) = max(conmin,smokefac*cblk(2) + dustfac*cblk(1)) ! Accumulation is smoke + fine dust - nblk(vcor3) = max(conmin,dustfac*cblk(3)) -! Dust in coarse - pmassn = max(conmin,0.0) - pmassa = max(conmin,cblk(1) + cblk(2)) - pmassc = max(conmin,cblk(3)) - pdensn = max(conmin,0.0) - pdensa = max(densmin,(f6dpim9*pmassa/nblk(vac3))) - pdensc = max(densmin,(f6dpim9*pmassc/nblk(vcor3))) -! Calculate mean free path - xlm = 6.6328E-8*pss0*blkta/(tss0*blkprs*1.e3) -! Calculate diameters - dgnuc = max(dgmin,0.0) - dgacc = max(dgmin,(nblk(vac3)/(nblk(vac0)*esa36))**one3) - dgcor = max(dgmin,(nblk(vcor3)/(nblk(vcorn)*esc36))**one3) -! Calculate Knudsen numbers - knnuc = 2.0*xlm/dgnuc - knacc = 2.0*xlm/dgacc - kncor = 2.0*xlm/dgcor -end subroutine modpar ! !-------------------------------------------------------------------------------- ! diff --git a/physics/smoke_dust/dep_dry_simple_mod.F90 b/physics/smoke_dust/dep_dry_simple_mod.F90 index 91e2997c5..e47d3d974 100755 --- a/physics/smoke_dust/dep_dry_simple_mod.F90 +++ b/physics/smoke_dust/dep_dry_simple_mod.F90 @@ -26,8 +26,6 @@ subroutine dry_dep_driver_simple(rmol,ust,ndvel,ddvel, & its,ite, jts,jte, kts,kte REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) , & INTENT(INOUT) :: ust, rmol -! REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), & -! INTENT(IN ) :: rel_hum REAL(kind_phys), PARAMETER :: kpart=500. REAL(kind_phys) :: dvpart @@ -56,9 +54,6 @@ subroutine dry_dep_driver_simple(rmol,ust,ndvel,ddvel, & dvpart = dvpart*(1.+(-300.*rmol(i,j))**0.66667) ENDIF -! IF (rel_hum(i,1,j)>0.8) THEN ! HIGH RELATIVE HUMIDITY CORRECTION -! dvpart = dvpart*(1.+0.37*exp((rel_hum(i,1,j)-0.8)/0.2)) -! END IF ddvel(i,j,nv) = MIN(0.50,dvpart) ! m/s enddo enddo diff --git a/physics/smoke_dust/dust_fengsha_mod.F90 b/physics/smoke_dust/dust_fengsha_mod.F90 index 3902d6508..54e66712d 100755 --- a/physics/smoke_dust/dust_fengsha_mod.F90 +++ b/physics/smoke_dust/dust_fengsha_mod.F90 @@ -140,9 +140,6 @@ subroutine gocart_dust_fengsha_driver(dt, & endif ! limit where there is lots of vegetation - !if (sum(vegfra(i,:,j)) .gt. .17) then - ! ilwi = 0 - !endif ! limit where there is snow on the ground if (snowh(i,j) .gt. 0) then diff --git a/physics/smoke_dust/module_add_emiss_burn.F90 b/physics/smoke_dust/module_add_emiss_burn.F90 index 70c14c54c..95005b973 100755 --- a/physics/smoke_dust/module_add_emiss_burn.F90 +++ b/physics/smoke_dust/module_add_emiss_burn.F90 @@ -17,9 +17,9 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & IMPLICIT NONE - INTEGER, INTENT(IN ) :: julday, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & + INTEGER, INTENT(IN ) :: julday, & + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte real(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), & @@ -49,14 +49,14 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & ! bx_bburn = 20.041288 * 3600., RAR: this depends on the vegetation class, location (local time) etc. real(kind_phys) :: timeq, fire_age, age_hr, dt1,dt2,dtm ! For BB emis. diurnal cycle calculation ! For Gaussian diurnal cycle - REAL, PARAMETER :: sc_factor=1. ! to scale up the wildfire emissions, TBD later - REAL, PARAMETER :: rinti=2.1813936e-8, ax2=3400., const2=130., & - coef2=10.6712963e-4, cx2=7200., timeq_max=3600.*24. + real(kind_phys), PARAMETER :: sc_factor=1. ! to scale up the wildfire emissions, TBD later + real(kind_phys), PARAMETER :: rinti=2.1813936e-8, ax2=3400., const2=130., & + coef2=10.6712963e-4, cx2=7200., timeq_max=3600.*24. !>-- Fire parameters - real(kind=kind_phys), dimension(1:5), parameter :: avg_fire_dur = (/8.9, 4.2, 3.3, 3.0, 1.4/) - real(kind=kind_phys), dimension(1:5), parameter :: sigma_fire_dur = (/8.7, 6.0, 5.5, 5.2, 2.4/) + real(kind_phys), dimension(1:5), parameter :: avg_fire_dur = (/8.9, 4.2, 3.3, 3.0, 1.4/) + real(kind_phys), dimension(1:5), parameter :: sigma_fire_dur = (/8.7, 6.0, 5.5, 5.2, 2.4/) - timeq= gmt*3600. + real(time_int,4) + timeq= gmt*3600._kind_phys + real(time_int,4) timeq= mod(timeq,timeq_max) @@ -94,28 +94,26 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & SELECT CASE ( fire_type(i,j) ) !Ag, urban fires, bare land etc. CASE (1) - ! these fires will have exponentially decreasing diurnal cycle, - ! these fires decrease 55% in 2 hours, end in 5 hours - ! r_q(i,j) = rinti* ax1 * exp(- (time_int**2)/(cx1**2) ) - ! We assume 1hr latency in ingesting the sat. data - coef_bb_dc(i,j) = 1./((2*pi)**0.5 * sigma_fire_dur(1) *fire_age) * & + ! these fires will have exponentially decreasing diurnal cycle, + ! We assume 1hr latency in ingesting the sat. data + coef_bb_dc(i,j) = 1._kind_phys/((2*pi)**0.5_kind_phys * sigma_fire_dur(1) *fire_age) * & exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2*sigma_fire_dur(1)**2 )) CASE (3) - age_hr= fire_age/3600. + age_hr= fire_age/3600._kind_phys IF (swdown(i,j)<.1 .AND. age_hr> 12. .AND. fhist(i,j)>0.75) THEN - fhist(i,j)= 0.75 + fhist(i,j)= 0.75_kind_phys ENDIF IF (swdown(i,j)<.1 .AND. age_hr> 24. .AND. fhist(i,j)>0.5) THEN - fhist(i,j)= 0.5 + fhist(i,j)= 0.5_kind_phys ENDIF IF (swdown(i,j)<.1 .AND. age_hr> 48. .AND. fhist(i,j)>0.25) THEN - fhist(i,j)= 0.25 + fhist(i,j)= 0.25_kind_phys ENDIF ! this is based on hwp, hourly or instantenous TBD - dc_hwp= ebu_in(i,j)* hwp(i,j)/ MAX(1.,hwp_prevd(i,j)) - dc_hwp= MAX(0.,dc_hwp) + dc_hwp= ebu_in(i,j)* hwp(i,j)/ MAX(1._kind_phys,hwp_prevd(i,j)) + dc_hwp= MAX(0._kind_phys,dc_hwp) !coef_bb_dc(i,j)= sc_factor* fhist(i,j)* rate_ebb2(i,j)* (1. + log( !hwp_(i,j)/ hwp_day_avg(i,j))) @@ -124,33 +122,39 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & dt1= abs(timeq - peak_hr(i,j)) dt2= timeq_max - peak_hr(i,j) + timeq ! peak hour is always <86400. dtm= MIN(dt1,dt2) - dc_gp = rinti*( ax2 * exp(- dtm**2/(2.*cx2**2) ) + const2 - coef2*timeq ) - dc_gp = MAX(0.,dc_gp) + dc_gp = rinti*( ax2 * exp(- dtm**2/(2._kind_phys*cx2**2) ) + const2 - coef2*timeq ) + dc_gp = MAX(0._kind_phys,dc_gp) - dc_fn = MAX(dc_hwp/dc_gp,3.) - coef_bb_dc(i,j) = sc_factor* fhist(i,j)* dc_fn - - do k=kts,kfire_max - conv= coef_bb_dc(i,j)*dtstep/(rho_phy(i,k,j)* dz8w(i,k,j)) - - dm_smoke= conv*ebu(i,k,j) - ! print*,'hli dm_smoke',dm_smoke,conv,ebu(i,k,j,p_ebu_smoke) - - chem(i,k,j,p_smoke) = chem(i,k,j,p_smoke) + dm_smoke - chem(i,k,j,p_smoke) = MIN(chem(i,k,j,p_smoke),5.e+3) - - if ( dbg_opt .and. (k==kts .OR. k==kfire_max) ) then - WRITE(6,*) 'add_emiss_burn: i,j,k ',i,j,k - WRITE(6,*) 'add_emiss_burn: rho_phy(i,k,j),dz8w(i,k,j),conv ',rho_phy(i,k,j),dz8w(i,k,j),conv - WRITE(6,*) 'add_emiss_burn: ebu(i,k,j),dm_smoke ', ebu(i,k,j),dm_smoke - endif - enddo + dc_fn = MAX(dc_hwp/dc_gp,3._kind_phys) + coef_bb_dc(i,j) = fhist(i,j)* dc_fn CASE DEFAULT END SELECT enddo enddo endif + do j=jts,jte + do i=its,ite + do k=kts,kfire_max + if (ebb_dcycle==1) then + conv= dtstep/(rho_phy(i,k,j)* dz8w(i,k,j)) + elseif (ebb_dcycle==2) then + conv= sc_factor*coef_bb_dc(i,j)*dtstep/(rho_phy(i,k,j)* dz8w(i,k,j)) + endif + dm_smoke= conv*ebu(i,k,j) + chem(i,k,j,p_smoke) = chem(i,k,j,p_smoke) + dm_smoke + chem(i,k,j,p_smoke) = MIN(chem(i,k,j,p_smoke),5.e+3) + + if ( dbg_opt .and. (k==kts .OR. k==kfire_max) ) then + WRITE(6,*) 'add_emiss_burn: i,j,k ',i,j,k + WRITE(6,*) 'add_emiss_burn: rho_phy(i,k,j),dz8w(i,k,j),conv',rho_phy(i,k,j),dz8w(i,k,j),conv + WRITE(6,*) 'add_emiss_burn: ebu(i,k,j),dm_smoke ', ebu(i,k,j),dm_smoke + endif + enddo + enddo + enddo + + END subroutine add_emis_burn END module module_add_emiss_burn diff --git a/physics/smoke_dust/module_plumerise.F90 b/physics/smoke_dust/module_plumerise.F90 new file mode 100755 index 000000000..8a1d6ab25 --- /dev/null +++ b/physics/smoke_dust/module_plumerise.F90 @@ -0,0 +1,172 @@ +!>\file module_plumerise.F90 +!! This file is the fire plume rise driver. + + module module_plumerise + + use machine , only : kind_phys +! real(kind=kind_phys),parameter :: p1000mb = 100000. ! p at 1000mb (pascals) +!- Implementing the fire radiative power (FRP) methodology for biomass burning +!- emissions and convective energy estimation. +!- Saulo Freitas, Gabriel Pereira (INPE/UFJS, Brazil) +!- Ravan Ahmadov, Georg Grell (NOAA, USA) +!- The flag "plumerise_flag" defines the method: +!- =1 => original method +!- =2 => FRP based + +CONTAINS +subroutine ebu_driver ( flam_frac,ebu_in,ebu, & + theta_phy,q_vap, & ! RAR: moist is replaced with q_vap, SRB: t_phy is repalced by theta_phy + rho_phy,vvel,u_phy,v_phy,pi_phy, & ! SRB: p_phy is replaced by pi_phy + wind_phy, & ! SRB: added wind_phy + z_at_w,z,g,con_cp,con_rd, & ! scale_fire_emiss is part of config_flags + frp_inst, k_min, k_max, & ! RAR: + wind_eff_opt, & + kpbl_thetav, & ! SRB: added kpbl_thetav + ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte, errmsg, errflg) + + use rrfs_smoke_config + use plume_data_mod + USE module_zero_plumegen_coms + USE module_smoke_plumerise + IMPLICIT NONE + + REAL(kind_phys), PARAMETER :: frp_threshold= 1.e+7 ! Minimum FRP (Watts) to distribute smoke in PBL + + REAL(kind_phys), PARAMETER :: zpbl_threshold = 2000. ! SRB: Minimum PBL depth to have plume rise + REAL(kind_phys), PARAMETER :: uspd_threshold = 5. ! SRB: Wind speed averaged across PBL depth to control smoke release levels + REAL(kind_phys), PARAMETER :: frp_threshold500 = 500.e+6 ! SRB: Minimum FRP (Watts) to have plume rise + + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme), INTENT(IN ) :: frp_inst ! RAR: FRP array + + real(kind_phys), DIMENSION(ims:ime, jms:jme), INTENT(IN) :: kpbl_thetav ! SRB + + character(*), intent(inout) :: errmsg + integer, intent(inout) :: errflg + INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, & + ims,ime, jms,jme, kms,kme, & + its,ite, jts,jte, kts,kte + INTEGER, INTENT(IN ) :: wind_eff_opt + real(kind=kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: ebu + real(kind=kind_phys), INTENT(IN ) :: g, con_cp, con_rd + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: ebu_in + real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(OUT ) :: flam_frac + real(kind=kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ) , & + INTENT(IN ) :: z,z_at_w,vvel,u_phy,v_phy,rho_phy,pi_phy,q_vap,theta_phy,wind_phy ! RAR, SRB + +! Local variables... + INTEGER :: nv, i, j, k, kp1, kp2 + INTEGER, DIMENSION(ims:ime, jms:jme), INTENT (OUT) :: k_min, k_max ! Min and max ver. levels for BB injection spread + real(kind_phys), dimension (kte) :: u_in ,v_in ,w_in ,theta_in ,pi_in, rho_phyin ,qv_in ,zmid, z_lev, uspd ! SRB + real(kind=kind_phys) :: dz_plume, cpor, con_rocp, uspdavg ! SRB + + cpor =con_cp/con_rd + con_rocp=con_rd/con_cp + + IF ( dbg_opt ) then + WRITE(*,*) 'module_plumerise: its,ite,jts,jte ', its,ite,jts,jte + WRITE(*,*) 'module_plumerise: ims,ime,jms,jme ', ims,ime,jms,jme + WRITE(*,*) 'module_plumerise: maxval(ebu(:,kts,:)) ', maxval(ebu(:,kts,:)) + END IF + +! RAR: setting to zero the ebu emissions at the levels k>1, this is necessary when the plumerise is called, so the emissions at k>1 are updated + !do nv=1,num_ebu + do j=jts,jte + do k=kts+1,kte + do i=its,ite + ebu(i,k,j)=0. + enddo + enddo + enddo + !enddo + +! For now the flammable fraction is constant, based on the namelist. The next +! step to use LU index and meteorology to parameterize it + do j=jts,jte + do i=its,ite + flam_frac(i,j)= 0. + if (frp_inst(i,j) > frp_threshold) then + flam_frac(i,j)= 0.9 + end if + enddo + enddo + + +! RAR: new FRP based approach +! Haiqin: do_plumerise is added to the namelist options +check_pl: IF (do_plumerise) THEN ! if the namelist option is set for plumerise + do j=jts,jte + do i=its,ite + + do k=kts,kte + u_in(k)= u_phy(i,k,j) + v_in(k)= v_phy(i,k,j) + w_in(k)= vvel(i,k,j) + qv_in(k)= q_vap(i,k,j) + pi_in(k)= pi_phy(i,k,j) + zmid(k)= z(i,k,j)-z_at_w(i,kts,j) + z_lev(k)= z_at_w(i,k,j)-z_at_w(i,kts,j) + rho_phyin(k)= rho_phy(i,k,j) + theta_in(k)= theta_phy(i,k,j) + uspd(k)= wind_phy(i,k,j) ! SRB + enddo + + IF (dbg_opt) then + WRITE(*,*) 'module_plumerise: i,j ',i,j + WRITE(*,*) 'module_plumerise: frp_inst(i,j) ',frp_inst(i,j) + WRITE(*,*) 'module_plumerise: ebu(i,kts,j) ',ebu(i,kts,j) + WRITE(*,*) 'module_plumerise: u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) ',u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) + WRITE(*,*) 'module_plumerise: zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) ',zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) + END IF + +! RAR: the plume rise calculation step: + CALL plumerise(kte,1,1,1,1,1,1, & + u_in, v_in, w_in, theta_in ,pi_in, & + rho_phyin, qv_in, zmid, z_lev, & + wind_eff_opt, & + frp_inst(i,j), k_min(i,j), & + k_max(i,j), dbg_opt, g, con_cp, & + con_rd, cpor, errmsg, errflg ) + if(errflg/=0) return + + kp1= k_min(i,j) + kp2= k_max(i,j) + dz_plume= z_at_w(i,kp2,j) - z_at_w(i,kp1,j) + +! SRB: Adding condition for overwriting plumerise levels + uspdavg=SUM(uspd(kts:kpbl_thetav(i,j)))/kpbl_thetav(i,j) !Average wind speed within the boundary layer + + IF ((frp_inst(i,j) .gt. frp_threshold) .AND. (frp_inst(i,j) .le. frp_threshold500) .AND. & + (z_at_w(i,kpbl_thetav(i,j),j) .gt. zpbl_threshold) .AND. (wind_eff_opt .eq. 1)) THEN + kp1=1 + IF (uspdavg .ge. uspd_threshold) THEN ! Too windy + kp2=kpbl_thetav(i,j)/3 + ELSE + kp2=kpbl_thetav(i,j) + END IF + dz_plume= z_at_w(i,kp2,j) - z_at_w(i,kp1,j) + do k=kp1,kp2-1 + ebu(i,k,j)= ebu_in(i,j)* (z_at_w(i,k+1,j)-z_at_w(i,k,j))/dz_plume + enddo + ELSE + do k=kp1,kp2-1 + ebu(i,k,j)= flam_frac(i,j)* ebu_in(i,j)* (z_at_w(i,k+1,j)-z_at_w(i,k,j))/dz_plume + enddo + ebu(i,kts,j)= (1.-flam_frac(i,j))* ebu_in(i,j) + END IF +! SRB: End modification + + IF ( dbg_opt ) then + WRITE(*,*) 'module_plumerise: i,j ',i,j + WRITE(*,*) 'module_plumerise: k_min(i,j), k_max(i,j) ',kp1, kp2 ! SRB: replaced k_min, k_max with kp1, kp2 + END IF +! endif check_frp + enddo + enddo + + ENDIF check_pl + +end subroutine ebu_driver + +END module module_plumerise diff --git a/physics/smoke_dust/module_plumerise1.F90 b/physics/smoke_dust/module_plumerise1.F90 deleted file mode 100755 index f98350130..000000000 --- a/physics/smoke_dust/module_plumerise1.F90 +++ /dev/null @@ -1,225 +0,0 @@ -!>\file module_plumerise1.F90 -!! This file is the fire plume rise driver. - - module module_plumerise1 - - use machine , only : kind_phys - real(kind=kind_phys),parameter :: p1000mb = 100000. ! p at 1000mb (pascals) -!- Implementing the fire radiative power (FRP) methodology for biomass burning -!- emissions and convective energy estimation. -!- Saulo Freitas, Gabriel Pereira (INPE/UFJS, Brazil) -!- Ravan Ahmadov, Georg Grell (NOAA, USA) -!- The flag "plumerise_flag" defines the method: -!- =1 => original method -!- =2 => FRP based -!------------------------------------------------------------------------- -! -! use module_zero_plumegen_coms -! integer, parameter :: nveg_agreg = 4 -! integer, parameter :: tropical_forest = 1 -! integer, parameter :: boreal_forest = 2 -! integer, parameter :: savannah = 3 - -! integer, parameter :: grassland = 4 -! real(kind_phys), dimension(nveg_agreg) :: firesize,mean_fct -! character(len=20), parameter :: veg_name(nveg_agreg) = (/ & -! 'Tropical-Forest', & -! 'Boreal-Forest ', & -! 'Savanna ', & -! 'Grassland ' /) -! character(len=20), parameter :: spc_suf(nveg_agreg) = (/ & -! 'agtf' , & ! trop forest -! 'agef' , & ! extratrop forest -! 'agsv' , & ! savanna -! 'aggr' /) ! grassland - -CONTAINS -subroutine ebu_driver ( flam_frac,ebu_in,ebu,coef_bb_dc, & - t_phy,q_vap, & ! RAR: moist is replaced with q_vap - rho_phy,vvel,u_phy,v_phy,p_phy, & - z_at_w,z,g,con_cp,con_rd, & ! scale_fire_emiss is part of config_flags - frp_hr, k_min, k_max, & ! RAR: - wind_eff_opt, & - ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte, errmsg, errflg) - - use rrfs_smoke_config - use plume_data_mod - USE module_zero_plumegen_coms - USE module_smoke_plumerise - IMPLICIT NONE - - REAL(kind_phys), PARAMETER :: frp_threshold= 1.e+7 ! Minimum FRP (Watts) to have plume rise - - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme), INTENT(IN ) :: frp_hr ! RAR: FRP array - -! TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags - character(*), intent(inout) :: errmsg - integer, intent(inout) :: errflg - INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, & - ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte - INTEGER, INTENT(IN ) :: wind_eff_opt -! real(kind=kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), & -! INTENT(IN ) :: moist - real(kind=kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: ebu - real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: coef_bb_dc ! RAR: - real(kind=kind_phys), INTENT(IN ) :: g, con_cp, con_rd - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: ebu_in - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), INTENT(OUT ) :: flam_frac - real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ) :: frp_hr_coef_bb_dc - -! real(kind=kind_phys), DIMENSION( ims:ime, 1, jms:jme ), & -! INTENT(IN ) :: ebu_in -! real(kind=kind_phys), DIMENSION( ims:ime, jms:jme ), & -! INTENT(IN ) :: & -! mean_fct_agtf,mean_fct_agef,& -! mean_fct_agsv,mean_fct_aggr,firesize_agtf,firesize_agef, & -! firesize_agsv,firesize_aggr - - real(kind=kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ) , & - INTENT(IN ) :: t_phy,z,z_at_w,vvel,u_phy,v_phy,rho_phy,p_phy,q_vap ! RAR - ! real(kind=kind_phys), INTENT(IN ) :: dtstep - -! Local variables... - INTEGER :: nv, i, j, k, kp1, kp2 - INTEGER, DIMENSION(ims:ime, jms:jme), INTENT (OUT) :: k_min, k_max ! Min and max ver. levels for BB injection spread - !real(kind_phys), dimension (num_ebu) :: eburn_in - !real(kind_phys), dimension (kte,num_ebu) :: eburn_out - real(kind_phys), dimension (kte) :: u_in ,v_in ,w_in ,theta_in ,pi_in, rho_phyin ,qv_in ,zmid, z_lev - real(kind=kind_phys) :: dz_plume, cpor, con_rocp - - !INTEGER, PARAMETER :: kfire_max=30 -! real(kind_phys), dimension(nveg_agreg) :: firesize,mean_fct -! real(kind_phys) :: sum, ffirs, ratio -! real(kind_phys),save,dimension(its:ite,jts:jte) :: ffirs -! nspecies=num_ebu -! write(0,*)'plumerise' - -! RAR: -! do j=jts,jte: -! do i=its,ite -! ebu(i,kts,j,p_ebu_smoke)= ebb_smoke(i,j) -! ebu(i,kts,j,p_ebu_no) = ebu_in(i,1,j,p_ebu_in_no) -! ebu(i,kts,j,p_ebu_co) = ebu_in(i,1,j,p_ebu_in_co) -! ebu(i,kts,j,p_ebu_so2) = ebu_in(i,1,j,p_ebu_in_so2) -! ebu(i,kts,j,p_ebu_dms) = ebu_in(i,1,j,p_ebu_in_dms) -! ebu(i,kts,j,p_ebu_oc) = ebu_in(i,1,j,p_ebu_in_oc) -! ebu(i,kts,j,p_ebu_bc) = ebu_in(i,1,j,p_ebu_in_bc) -! ebu(i,kts,j,p_ebu_pm25) = ebu_in(i,1,j,p_ebu_in_pm25) -! ebu(i,kts,j,p_ebu_pm10) = ebu_in(i,1,j,p_ebu_in_pm10) -! enddo -! enddo - cpor =con_cp/con_rd - con_rocp=con_rd/con_cp - - IF ( dbg_opt ) then - WRITE(*,*) 'module_plumerise1: its,ite,jts,jte ', its,ite,jts,jte - WRITE(*,*) 'module_plumerise1: ims,ime,jms,jme ', ims,ime,jms,jme - !WRITE(*,*) 'module_plumerise1: p_ebu_smoke,num_ebu: ', p_ebu_smoke,num_ebu - WRITE(*,*) 'module_plumerise1: maxval(ebu(:,kts,:)) ', maxval(ebu(:,kts,:)) - END IF - !endif - -! RAR: setting to zero the ebu emissions at the levels k>1, this is necessary when the plumerise is called, so the emissions at k>1 are updated - !do nv=1,num_ebu - do j=jts,jte - do k=kts+1,kte - do i=its,ite - ebu(i,k,j)=0. - enddo - enddo - enddo - !enddo - -! Apply the diurnal cycle coefficient - do j=jts,jte - do i=its,ite - frp_hr_coef_bb_dc(i,j) = frp_hr(i,j)*coef_bb_dc(i,j) - enddo - enddo - -! For now the flammable fraction is constant, based on the namelist. The next -! step to use LU index and meteorology to parameterize it - do j=jts,jte - do i=its,ite - flam_frac(i,j)= 0. - if (frp_hr_coef_bb_dc(i,j) > frp_threshold) then - flam_frac(i,j)= 0.9 - end if - enddo - enddo - - -! RAR: new FRP based approach -!check_pl: IF (config_flags%plumerise_flag == 2 ) THEN ! if the namelist option is set for plumerise -! Haiqin: plumerise_flag is added to the namelist options -check_pl: IF (do_plumerise) THEN ! if the namelist option is set for plumerise - do j=jts,jte - do i=its,ite - ! k_min(i,j)=0 - ! k_max(i,j)=0 - -! check_frp: if (.NOT.do_plumerise) then ! namelist option -! ebu(i,kts,j)= ebb_smoke(i,j) -! else - - do k=kts,kte - u_in(k)= u_phy(i,k,j) - v_in(k)= v_phy(i,k,j) - w_in(k)= vvel(i,k,j) - qv_in(k)= q_vap(i,k,j) ! RAR: moist(i,k,j,p_qv) - !pi_in(k)= cp*(p_phy(i,k,j)/p1000mb)**rcp - pi_in(k)= con_cp*(p_phy(i,k,j)/p1000mb)**con_rocp - zmid(k)= z(i,k,j)-z_at_w(i,kts,j) - z_lev(k)= z_at_w(i,k,j)-z_at_w(i,kts,j) - rho_phyin(k)= rho_phy(i,k,j) - theta_in(k)= t_phy(i,k,j)/pi_in(k)*con_cp - !theta_in(k)= t_phy(i,k,j)/pi_in(k)*cp - enddo - - IF (dbg_opt) then - WRITE(*,*) 'module_plumerise1: i,j ',i,j - WRITE(*,*) 'module_plumerise1: frp_hr(i,j) ',frp_hr_coef_bb_dc(i,j) - WRITE(*,*) 'module_plumerise1: ebu(i,kts,j) ',ebu(i,kts,j) - WRITE(*,*) 'module_plumerise1: u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) ',u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) - WRITE(*,*) 'module_plumerise1: zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) ',zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) - WRITE(*,*) 'module_plumerise1: t_phy(i,kte,j),pi_in(kte)',t_phy(i,kte,j),pi_in(kte) - END IF - -! RAR: the plume rise calculation step: - CALL plumerise(kte,1,1,1,1,1,1, & - !firesize,mean_fct, & - !num_ebu, eburn_in, eburn_out, & - u_in, v_in, w_in, theta_in ,pi_in, & - rho_phyin, qv_in, zmid, z_lev, & - wind_eff_opt, & - frp_hr_coef_bb_dc(i,j), k_min(i,j), & - k_max(i,j), dbg_opt, g, con_cp, & - con_rd, cpor, errmsg, errflg ) - !k_max(i,j), config_flags%debug_chem ) - if(errflg/=0) return - - kp1= k_min(i,j) - kp2= k_max(i,j) - dz_plume= z_at_w(i,kp2,j) - z_at_w(i,kp1,j) - - do k=kp1,kp2-1 - ebu(i,k,j)= flam_frac(i,j)* ebu_in(i,j)* (z_at_w(i,k+1,j)-z_at_w(i,k,j))/dz_plume - enddo - ebu(i,kts,j)= (1.-flam_frac(i,j))* ebu_in(i,j) - - IF ( dbg_opt ) then - WRITE(*,*) 'module_plumerise1: i,j ',i,j - WRITE(*,*) 'module_plumerise1: k_min(i,j), k_max(i,j) ',k_min(i,j), k_max(i,j) - END IF -! endif check_frp - enddo - enddo - - ENDIF check_pl - -end subroutine ebu_driver - -END module module_plumerise1 diff --git a/physics/smoke_dust/module_smoke_plumerise.F90 b/physics/smoke_dust/module_smoke_plumerise.F90 index d80eaeb62..0fca91de4 100755 --- a/physics/smoke_dust/module_smoke_plumerise.F90 +++ b/physics/smoke_dust/module_smoke_plumerise.F90 @@ -24,9 +24,7 @@ module module_smoke_plumerise CONTAINS ! RAR: - subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & -! firesize,mean_fct, & - ! nspecies,eburn_in,eburn_out, & + subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & up,vp,wp,theta,pp,dn0,rv,zt_rams,zm_rams, & wind_eff_opt, & frp_inst,k1,k2, dbg_opt, g, cp, rgas, & diff --git a/physics/smoke_dust/module_wetdep_ls.F90 b/physics/smoke_dust/module_wetdep_ls.F90 index b9d52cb49..8ba8f67d9 100755 --- a/physics/smoke_dust/module_wetdep_ls.F90 +++ b/physics/smoke_dust/module_wetdep_ls.F90 @@ -32,6 +32,9 @@ subroutine wetdep_ls(dt,var,rain,moist, integer :: nv,i,j,k,km,kb,kbeg !real(kind_phys), parameter :: alpha = .5 ! scavenging factor + wetdpr_smoke =0. + wetdpr_dust =0. + wetdpr_coarsepm=0. do nv=1,nchem do i=its,ite diff --git a/physics/smoke_dust/plume_data_mod.F90 b/physics/smoke_dust/plume_data_mod.F90 index 2bf91dbfa..3f0bcdecd 100755 --- a/physics/smoke_dust/plume_data_mod.F90 +++ b/physics/smoke_dust/plume_data_mod.F90 @@ -45,7 +45,6 @@ module plume_data_mod integer, parameter :: savannah = 3 integer, parameter :: grassland = 4 integer, parameter :: nveg_agreg = 4 -! integer, parameter :: wind_eff = 1 public diff --git a/physics/smoke_dust/rrfs_smoke_config.F90 b/physics/smoke_dust/rrfs_smoke_config.F90 index 5f8f02e7b..d7478986b 100755 --- a/physics/smoke_dust/rrfs_smoke_config.F90 +++ b/physics/smoke_dust/rrfs_smoke_config.F90 @@ -31,6 +31,7 @@ module rrfs_smoke_config integer :: ebb_dcycle = 2 ! 1: read in ebb_smoke(i,24), 2: daily logical :: dbg_opt = .true. logical :: aero_ind_fdb = .false. + logical :: add_fire_heat_flux= .false. logical :: do_rrfs_sd = .true. ! integer :: wind_eff_opt = 1 logical :: extended_sd_diags = .false. @@ -40,8 +41,6 @@ module rrfs_smoke_config integer, parameter :: CHEM_OPT_GOCART= 1 integer, parameter :: num_moist=2, num_chem=20, num_emis_seas=5, num_emis_dust=5 - integer, parameter :: DUST_OPT_FENGSHA = 5 - ! -- hydrometeors integer, parameter :: p_qv=1 integer, parameter :: p_qc=2 diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.meta b/physics/smoke_dust/rrfs_smoke_postpbl.meta index 5f8ca2a8e..392a6ea6b 100755 --- a/physics/smoke_dust/rrfs_smoke_postpbl.meta +++ b/physics/smoke_dust/rrfs_smoke_postpbl.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_postpbl type = scheme - dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,dep_dry_mod_emerson.F90,dep_data_mod.F90 + dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,dep_dry_mod_emerson.F90,dep_data_mod.F90 ######################################################################## [ccpp-arg-table] name = rrfs_smoke_postpbl_run diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index f4e28be3a..afd386595 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -9,9 +9,9 @@ module rrfs_smoke_wrapper addsmoke_flag, plumerisefire_frq, wetdep_ls_opt, & drydep_opt, pm_settling, aero_ind_fdb, ebb_dcycle, & dbg_opt,smoke_forecast,wetdep_ls_alpha,do_rrfs_sd, & - ebb_dcycle, extended_sd_diags, & + ebb_dcycle, extended_sd_diags,add_fire_heat_flux, & num_moist, num_chem, num_emis_seas, num_emis_dust, & - DUST_OPT_FENGSHA, p_qv, p_atm_shum, p_atm_cldq, & + p_qv, p_atm_shum, p_atm_cldq, & p_smoke, p_dust_1, p_coarse_pm, epsilc use dust_data_mod, only : dust_alpha, dust_gamma, dust_moist_opt, & dust_moist_correction, dust_drylimit_factor @@ -20,7 +20,7 @@ module rrfs_smoke_wrapper use dep_dry_simple_mod, only : dry_dep_driver_simple use dep_dry_emerson_mod, only : dry_dep_driver_emerson use module_wetdep_ls, only : wetdep_ls - use module_plumerise1, only : ebu_driver + use module_plumerise, only : ebu_driver use module_add_emiss_burn, only : add_emis_burn use coarsepm_settling_mod, only : coarsepm_settling_driver @@ -30,7 +30,7 @@ module rrfs_smoke_wrapper public :: rrfs_smoke_wrapper_run, rrfs_smoke_wrapper_init - integer :: wind_eff_opt + integer :: plume_wind_eff contains @@ -45,7 +45,7 @@ subroutine rrfs_smoke_wrapper_init( seas_opt_in, drydep_opt_in, pm_settling_in, & ! Dry Dep namelist wetdep_ls_opt_in,wetdep_ls_alpha_in, & ! Wet dep namelist rrfs_sd, do_plumerise_in, plumerisefire_frq_in, & ! smoke namelist - wind_eff_opt_in, & ! smoke namelist + plume_wind_eff_in,add_fire_heat_flux_in, & ! smoke namelist addsmoke_flag_in, ebb_dcycle_in, smoke_forecast_in, & ! Smoke namelist dust_opt_in, dust_alpha_in, dust_gamma_in, & ! Dust namelist dust_moist_opt_in, & ! Dust namelist @@ -61,8 +61,8 @@ subroutine rrfs_smoke_wrapper_init( seas_opt_in, real(kind_phys), intent(in) :: dust_drylimit_factor_in integer, intent(in) :: dust_opt_in,dust_moist_opt_in, wetdep_ls_opt_in, pm_settling_in, seas_opt_in integer, intent(in) :: drydep_opt_in - logical, intent(in) :: aero_ind_fdb_in,dbg_opt_in, extended_sd_diags_in - integer, intent(in) :: smoke_forecast_in, wind_eff_opt_in, plumerisefire_frq_in + logical, intent(in) :: aero_ind_fdb_in,dbg_opt_in, extended_sd_diags_in, add_fire_heat_flux_in + integer, intent(in) :: smoke_forecast_in, plume_wind_eff_in, plumerisefire_frq_in integer, intent(in) :: addsmoke_flag_in, ebb_dcycle_in logical, intent(in) :: do_plumerise_in, rrfs_sd character(len=*),intent(out):: errmsg @@ -93,7 +93,8 @@ subroutine rrfs_smoke_wrapper_init( seas_opt_in, plumerisefire_frq = plumerisefire_frq_in addsmoke_flag = addsmoke_flag_in smoke_forecast = smoke_forecast_in - wind_eff_opt = wind_eff_opt_in + plume_wind_eff = plume_wind_eff_in + add_fire_heat_flux = add_fire_heat_flux_in !>-Feedback aero_ind_fdb = aero_ind_fdb_in !>-Other @@ -110,14 +111,14 @@ end subroutine rrfs_smoke_wrapper_init subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, & u10m, v10m, ustar, rlat, rlon, tskin, pb2d, t2m, dpt2m, & pr3d, ph3d,phl3d, prl3d, tk3d, us3d, vs3d, spechum, w, & - nsoil, smc, vegtype_dom, vegtype_frac,soiltyp,nlcat, & + nsoil, smc, vegtype_dom, vegtype_frac, soiltyp, nlcat, & dswsfc, zorl, snow, julian,recmol, & idat, rain_cpl, rainc_cpl, hf2d, g, pi, con_cp, con_rd, con_fv, & dust12m_in, emi_ant_in, smoke_RRFS, smoke2d_RRFS, & ntrac, qgrs, gq0, chem3d, tile_num, & ntsmoke, ntdust, ntcoarsepm, imp_physics, imp_physics_thompson, & nwfa, nifa, emanoc, emdust, emseas, drydep_flux_out, wetdpr, & - ebb_smoke_in, frp_input, coef_bb, ebu_smoke,fhist,min_fplume, & + ebb_smoke_in, frp_output, coef_bb, ebu_smoke,fhist,min_fplume, & max_fplume, hwp, hwp_ave, wetness, ndvel, ddvel_inout,fire_in, & fire_heat_flux_out, frac_grid_burned_out, kpbl,oro, & errmsg,errflg ) @@ -148,7 +149,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, 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_input, fhist + 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(inout) :: fire_in real(kind_phys), dimension(:), intent(out) :: fire_heat_flux_out, frac_grid_burned_out @@ -169,8 +170,9 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !>-- Local Variables real(kind_phys), dimension(ims:im, kms:kme, jms:jme) :: ebu real(kind_phys), dimension(1:im, 1:kme,jms:jme) :: rri, t_phy, u_phy, v_phy, & - p_phy, z_at_w, dz8w, p8w, t8w, rho_phy, vvel, zmid - real(kind_phys), dimension(ims:im, jms:jme) :: u10, v10, ust, tsk, & + p_phy,pi_phy,wind_phy,theta_phy,z_at_w, dz8w, p8w, t8w, & + rho_phy, vvel, zmid + real(kind_phys), dimension(ims:im, jms:jme) :: frp_inst, u10, v10, ust, tsk, & xland, xlat, xlong, dxy, pbl, hfx, rnav, hwp_local, & wetdpr_smoke_local, wetdpr_dust_local, wetdpr_coarsepm_local !>- sea salt & chemistry variables @@ -183,8 +185,8 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, real(kind_phys) :: gmt !>- dust & chemistry variables real(kind_phys), dimension(ims:im, jms:jme) :: ssm, rdrag, uthr, snowh ! fengsha dust - real(kind_phys), dimension(ims:im, nlcat, jms:jme) :: vegfrac real(kind_phys), dimension(ims:im, jms:jme) :: rmol, swdown, znt, clayf, sandf + real(kind_phys), dimension(ims:im, nlcat, jms:jme) :: vegfrac real(kind_phys), dimension(ims:im, nsoil, jms:jme) :: smois real(kind_phys), dimension(ims:im, 1:1, jms:jme, 1:num_emis_dust) :: emis_dust integer, dimension(ims:im, jms:jme) :: isltyp, ivgtyp @@ -192,9 +194,9 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ! -- buffers real(kind_phys), dimension(ims:im, jms:jme ) :: coef_bb_dc, flam_frac, frp_in, & fire_hist, peak_hr, lu_nofire, lu_qfire, ebu_in, & - fire_end_hr, hwp_day_avg + fire_end_hr, hwp_day_avg, kpbl_thetav integer, dimension(ims:im, jms:jme ) :: min_fplume2, max_fplume2, fire_type - logical :: call_fire, reset_hwp_ave + logical :: call_plume, reset_hwp_ave !>- optical variables real(kind_phys), dimension(ims:im, jms:jme, ndvel) :: ddvel, settling_flux, drydep_flux_local real(kind_phys), dimension(ims:im, kms:kme, jms:jme, ndvel) :: vgrav @@ -204,8 +206,6 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !> -- parameter to caluclate wfa&ifa (m) real(kind_phys), parameter :: mean_diameter1= 4.E-8, sigma1=1.8 real(kind_phys), parameter :: mean_diameter2= 1.E-6, sigma2=1.8 - ! real(kind_phys), parameter :: kappa_oc = 0.2 - ! real(kind_phys), parameter :: kappa_dust = 0.04 real(kind_phys) :: fact_wfa, fact_ifa !> -- aerosol density (kg/m3) real(kind_phys), parameter :: density_dust= 2.6e+3, density_sulfate=1.8e+3 @@ -247,7 +247,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, curr_secs = ktau * dt current_month=jdate(2) ! needed for the dust input data current_hour =jdate(5)+1 ! =1 at 00Z - hour_int=ktau*dt/3600. ! hours since the simulation start + hour_int=floor(ktau*dt/3600.) ! hours since the simulation start gmt = real(mod(idat(5)+hour_int,24)) julday = int(julian) @@ -268,25 +268,25 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, reset_hwp_ave = mod(int(curr_secs-dt),3600) == 0 ! plumerise frequency in minutes set up by the namelist input - call_fire = (do_plumerise .and. (plumerisefire_frq > 0)) - if (call_fire) call_fire = (mod(int(curr_secs), max(1, 60*plumerisefire_frq)) == 0) .or. (ktau == 2) + call_plume = (do_plumerise .and. (plumerisefire_frq > 0)) + if (call_plume) call_plume = (mod(int(curr_secs), max(1, 60*plumerisefire_frq)) == 0) .or. (ktau == 2) !>- get ready for chemistry run call rrfs_smoke_prep( & - ktau,current_month, current_hour, gmt, con_rd, con_fv, & + ktau,current_month, current_hour, gmt, con_rd, con_fv, con_cp, & u10m,v10m,ustar,land,garea,rlat,rlon,tskin, & pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,w, & nsoil,smc,vegtype_dom,soiltyp,nlcat,vegtype_frac,dswsfc,zorl, & snow,dust12m_in,emi_ant_in,smoke_RRFS,smoke2d_RRFS,coef_bb_dc, & hf2d, pb2d, g, pi, hour_int, peak_hr, & u10,v10,ust,tsk,xland,xlat,xlong,dxy, & - rri,t_phy,u_phy,v_phy,p_phy,rho_phy,dz8w,p8w, & - t8w,recmol, & + rri,t_phy,u_phy,v_phy,p_phy,pi_phy,wind_phy,theta_phy, & + rho_phy,dz8w,p8w,t8w,recmol, & z_at_w,vvel,zmid, & ntrac,gq0, & num_chem,num_moist, & ntsmoke, ntdust,ntcoarsepm, & - moist,chem,ebu_in,ebb_smoke_in, & + moist,chem,ebu_in,kpbl_thetav,ebb_smoke_in, & fhist,frp_in, hwp_day_avg, fire_end_hr, & emis_anoc,smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & snowh,clayf,rdrag,sandf,ssm,uthr,oro, hwp_local, & @@ -315,15 +315,16 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !RAR: change this to the fractional LU type; fire_type: 0- no fires, 1- Ag ! or urban fires, 2- prescribed fires in wooded area, 3- wildfires + if (ebb_dcycle==2) then do j=jts,jte do i=its,ite if (ebu_in(i,j)<0.01) then fire_type(i,j) = 0 else ! Permanent wetlands, snow/ice, water, barren tundra - lu_nofire(i,j) = vegfrac(i,11,j) + vegfrac(i,15,j) + vegfrac(i,17,j) + vegfrac(i,20,j) + lu_nofire(i,j) = vegfrac(i,11,j) + vegfrac(i,15,j) + vegfrac(i,17,j) + vegfrac(i,20,j) ! cropland, urban, cropland/natural mosaic, barren and sparsely vegetated - lu_qfire(i,j) = vegfrac(i,12,j) + vegfrac(i,13,j) + vegfrac(i,14,j) + vegfrac(i,16,j) + lu_qfire(i,j) = vegfrac(i,12,j) + vegfrac(i,13,j) + vegfrac(i,14,j) + vegfrac(i,16,j) if (lu_nofire(i,j)>0.95) then fire_type(i,j) = 0 else if (lu_qfire(i,j)>0.95) then @@ -334,6 +335,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, end if end do end do + endif !>- compute sea-salt ! -- compute sea salt (opt=1) @@ -348,7 +350,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, endif !-- compute dust (opt=5) - if (dust_opt==DUST_OPT_FENGSHA) then + if (dust_opt==5) then call gocart_dust_fengsha_driver(dt,chem,rho_phy,smois,p8w,ssm, & isltyp,snowh,xland,dxy,g,emis_dust,ust,znt, & clayf,sandf,rdrag,uthr, & @@ -364,9 +366,9 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !-- /scratch2/BMC/ap-fc/Ravan/rapid-refresh/WRFV3.9/smoke ! Every hour (per namelist) the ebu_driver is called to calculate ebu, but ! the plumerise is controlled by the namelist option of plumerise_flag - !if (add_fire_heat_flux) then - do i = its,ite - if ( frp_in(i,1) .ge. 1.E7 ) then + if (add_fire_heat_flux) then + do i = its,ite + if ( coef_bb_dc(i,1)*frp_in(i,1) .ge. 1.E7 ) then fire_heat_flux_out(i) = min(max(0.,0.88*coef_bb_dc(i,1)*frp_in(i,1) / & 0.55/dxy(i,1)) ,5000.) ! JLS - W m-2 [0 - 10,000] frac_grid_burned_out(i) = min(max(0., 1.3*0.0006*coef_bb_dc(i,1)*frp_in(i,1)/dxy(i,1) ),1.) @@ -374,17 +376,24 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, fire_heat_flux_out(i) = 0.0 frac_grid_burned_out(i) = 0.0 endif - enddo - !endif - if (call_fire) then + enddo + endif + if (call_plume) then + ! Apply the diurnal cycle coefficient to frp_inst () + do j=jts,jte + do i=its,ite + frp_inst(i,j) = frp_in(i,j)*coef_bb_dc(i,j) + enddo + enddo + call ebu_driver ( & flam_frac,ebu_in,ebu, & - coef_bb_dc, & - t_phy,moist(:,:,:,p_qv), & - rho_phy,vvel,u_phy,v_phy,p_phy, & + theta_phy,moist(:,:,:,p_qv), & + rho_phy,vvel,u_phy,v_phy,pi_phy,wind_phy, & z_at_w,zmid,g,con_cp,con_rd, & - frp_in, min_fplume2, max_fplume2, & ! new approach - wind_eff_opt, & + frp_inst, min_fplume2, max_fplume2, & + plume_wind_eff, & + kpbl_thetav, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte, errmsg, errflg ) @@ -419,7 +428,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, if (drydep_opt == 1) then call dry_dep_driver_emerson(rmol,ust,znt,ndvel,ddvel, & vgrav,chem,dz8w,snowh,t_phy,p_phy,rho_phy,ivgtyp,g,dt, & - pm_settling,drydep_flux_local,settling_flux, & + pm_settling,drydep_flux_local,settling_flux,dbg_opt, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) @@ -452,7 +461,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) - if ( extended_sd_diags ) then + if ( extended_sd_diags .or. dbg_opt) then do i = its, ite wetdpr(i,1) = wetdpr(i,1) + wetdpr_smoke_local (i,1) wetdpr(i,2) = wetdpr(i,2) + wetdpr_dust_local (i,1) @@ -479,7 +488,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, enddo !---- diagnostic output of dry deposition & gravitational settling fluxes - if ( drydep_opt == 1 .and. extended_sd_diags ) then + if ( drydep_opt == 1 .and. (extended_sd_diags .or. dbg_opt) ) then do nv = 1, ndvel do i=its,ite drydep_flux_out(i,nv) = drydep_flux_out(i,nv) + & @@ -511,12 +520,12 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !------------------------------------- !-- to output for diagnostics do i = 1, im - !emseas (i) = emis_seas(i,1,1,1)*1.e+9 ! size bin 1 sea salt emission: ug/m2/s - !emanoc (i) = emis_anoc (i) ! anthropogenic organic carbon: ug/m2/s + emseas (i) = emis_seas(i,1,1,1)*1.e+9 ! size bin 1 sea salt emission: ug/m2/s + emanoc (i) = emis_anoc (i) ! anthropogenic organic carbon: ug/m2/s emdust (i) = emis_dust(i,1,1,1) + emis_dust(i,1,1,2) + & emis_dust(i,1,1,3) + emis_dust(i,1,1,4) ! dust emission: ug/m2/s coef_bb (i) = coef_bb_dc(i,1) - frp_input (i) = coef_bb_dc(i,1)*frp_in(i,1) + frp_output (i) = coef_bb_dc(i,1)*frp_in(i,1) fhist (i) = fire_hist (i,1) min_fplume (i) = real(min_fplume2(i,1)) max_fplume (i) = real(max_fplume2(i,1)) @@ -556,20 +565,20 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, end subroutine rrfs_smoke_wrapper_run subroutine rrfs_smoke_prep( & - ktau,current_month,current_hour,gmt,con_rd,con_fv, & + ktau,current_month,current_hour,gmt,con_rd,con_fv,con_cp, & u10m,v10m,ustar,land,garea,rlat,rlon,ts2d, & pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,w, & nsoil,smc,vegtype_dom,soiltyp,nlcat,vegtype_frac,dswsfc,zorl, & snow_cpl,dust12m_in,emi_ant_in,smoke_RRFS,smoke2d_RRFS,coef_bb_dc, & hf2d, pb2d, g, pi, hour_int, peak_hr, & u10,v10,ust,tsk,xland,xlat,xlong,dxy, & - rri,t_phy,u_phy,v_phy,p_phy,rho_phy,dz8w,p8w, & - t8w,recmol, & + rri,t_phy,u_phy,v_phy,p_phy,pi_phy,wind_phy,theta_phy, & + rho_phy,dz8w,p8w,t8w,recmol, & z_at_w,vvel,zmid, & ntrac,gq0, & num_chem, num_moist, & ntsmoke, ntdust, ntcoarsepm, & - moist,chem,ebu_in,ebb_smoke_in, & + moist,chem,ebu_in,kpbl_thetav,ebb_smoke_in, & fhist,frp_in, hwp_day_avg, fire_end_hr, & emis_anoc,smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & snowh,clayf,rdrag,sandf,ssm,uthr,oro,hwp_local, & @@ -585,7 +594,7 @@ subroutine rrfs_smoke_prep( & integer, intent(in) :: nsoil, ktau integer, dimension(ims:ime), intent(in) :: land, vegtype_dom, soiltyp, kpbl integer, intent(in) :: ntrac - real(kind=kind_phys), intent(in) :: g, pi, gmt, con_rd, con_fv + real(kind=kind_phys), intent(in) :: g, pi, gmt, con_rd, con_fv, con_cp real(kind=kind_phys), dimension(ims:ime), intent(in) :: & u10m, v10m, ustar, garea, rlat, rlon, ts2d, dswsfc, & zorl, snow_cpl, pb2d, hf2d, oro, t2m, dpt2m, wetness, recmol @@ -596,7 +605,7 @@ subroutine rrfs_smoke_prep( & ! This is a place holder for ebb_dcycle == 2, currently set to hold a single ! value, which is the previous day's average of hwp, frp, ebb, fire_end real(kind=kind_phys), dimension(ims:ime, 4), intent(in) :: smoke2d_RRFS - real(kind=kind_phys), dimension(ims:ime, 4), intent(in) :: emi_ant_in + real(kind=kind_phys), dimension(ims:ime, 1), intent(in) :: emi_ant_in real(kind=kind_phys), dimension(ims:ime, kms:kme), intent(in) :: pr3d,ph3d real(kind=kind_phys), dimension(ims:ime, kts:kte), intent(in) :: & phl3d,tk3d,prl3d,us3d,vs3d,spechum,w @@ -611,12 +620,11 @@ subroutine rrfs_smoke_prep( & real(kind_phys), dimension(ims:ime, jms:jme),intent(out) :: ebu_in - ! real(kind_phys), dimension(ims:ime, jms:jme, num_frp_plume), intent(out) :: plume_frp integer,dimension(ims:ime, jms:jme), intent(out) :: isltyp, ivgtyp real(kind_phys), dimension(ims:ime, kms:kme, jms:jme), intent(out) :: & rri, t_phy, u_phy, v_phy, p_phy, rho_phy, dz8w, p8w, t8w, vvel, & - zmid + zmid, pi_phy, theta_phy, wind_phy real(kind_phys), dimension(ims:ime, jms:jme), intent(out) :: & u10, v10, ust, tsk, xland, xlat, xlong, dxy, rmol, swdown, znt, & pbl, hfx, snowh, clayf, rdrag, sandf, ssm, uthr, hwp_local @@ -629,16 +637,17 @@ subroutine rrfs_smoke_prep( & real(kind_phys), dimension(ims:ime,jms:jme), intent(inout) :: frp_in, fire_end_hr, fhist, coef_bb_dc real(kind_phys), dimension(ims:ime,jms:jme), intent(inout) :: hwp_day_avg, peak_hr real(kind_phys), dimension(ims:ime), intent(inout) :: emis_anoc,ebb_smoke_in - ! real(kind_phys), dimension(ims:ime, jms:jme, num_plume_data) :: plume real(kind_phys), parameter :: conv_frp = 1.e+06_kind_phys ! FRP conversion factor, MW to W - real(kind_phys), parameter :: frpc = 1._kind_phys ! FRP conversion factor (Regional) + real(kind_phys), parameter :: frpc = 1._kind_phys ! FRP conversion factor (Regional) ! -- local variables integer i,ip,j,k,k1,kp,kk,kkp,nv,l,ll,n,nl - real(kind_phys) :: SFCWIND,WIND,DELWIND,DZ,wdgust,snoweq,THETA,ZSF + real(kind_phys) :: SFCWIND,WIND,DELWIND,DZ,wdgust,snoweq,THETA real(kind_phys), dimension(ims:ime, kms:kme, jms:jme) :: THETAV - real(kind_phys), dimension(ims:ime, jms:jme) :: windgustpot,kpbl_thetav + real(kind_phys), dimension(ims:ime, jms:jme) :: windgustpot + real(kind_phys), dimension(ims:ime, jms:jme), intent(out) :: kpbl_thetav real(kind_phys), parameter :: delta_theta4gust = 0.5 + real(kind=kind_phys),parameter :: p1000mb = 100000. ! -- initialize fire emissions ebu_in = 0._kind_phys @@ -653,9 +662,12 @@ subroutine rrfs_smoke_prep( & ivgtyp = 0._kind_phys rri = 0._kind_phys t_phy = 0._kind_phys + theta_phy = 0._kind_phys u_phy = 0._kind_phys v_phy = 0._kind_phys + wind_phy = 0._kind_phys p_phy = 0._kind_phys + pi_phy = 0._kind_phys rho_phy = 0._kind_phys dz8w = 0._kind_phys p8w = 0._kind_phys @@ -755,6 +767,9 @@ subroutine rrfs_smoke_prep( & p_phy(i,k,j)=prl3d(i,kkp) u_phy(i,k,j)=us3d(i,kkp) v_phy(i,k,j)=vs3d(i,kkp) + pi_phy(i,k,j) = con_cp*(p_phy(i,k,j)/p1000mb)**(con_rd/con_cp) + theta_phy(i,k,j) = t_phy(i,k,j)/pi_phy(i,k,j)*con_cp + wind_phy(i,k,j) = sqrt(u_phy(i,k,j)**2 + v_phy(i,k,j)**2) ! from mp_thompson.F90 ; rho = con_eps*prsl/(con_rd*tgrs*(qv+con_eps)) ! from mynnd rho_phy(i,k,j)=p_phy(i,k,j)/(con_rd*t_phy(i,k,j)) !*(1.+con_fv*spechum(i,kkp))) @@ -764,14 +779,9 @@ subroutine rrfs_smoke_prep( & moist(i,k,j,1)=gq0(i,kkp,p_atm_shum) if (t_phy(i,k,j) > 265.) then moist(i,k,j,2)=gq0(i,kkp,p_atm_cldq) - !moist(i,k,j,3)=0. - ! TODO -- should we keep these limits? if (moist(i,k,j,2) < 1.e-8) moist(i,k,j,2)=0. else moist(i,k,j,2)=0. - ! moist(i,k,j,3)=gq0(i,kkp,p_atm_cldq) - ! TODO -- should we keep these limits? - ! if(moist(i,k,j,3) < 1.e-8)moist(i,k,j,3)=0. endif !-- zmid(i,k,j)=phl3d(i,kkp)/g @@ -813,7 +823,6 @@ subroutine rrfs_smoke_prep( & do i = its, ite do j = jts, jte if ( THETAV(i,kts+1,j) .lt. ( THETAV(i,kts,j) + delta_theta4gust) ) then - ZSF = oro(i) do k = kts+1, kte k1 = k !--- give theta-v at the sfc a 0.5K boost in the PBLH definition @@ -822,12 +831,7 @@ subroutine rrfs_smoke_prep( & endif enddo kpbl_thetav(i,j) = k1 - !pblh_thetav(i,j) = zmid(i,k+k1-1,j) * & - ! ((THETAV(i,kts,j)+delta_theta4gust) - THETAV(i,kts+k1-1,j)) & - ! * (zmid(i,kts+k1-1,j) - zmid(i,kts+k1-2,j)) & - ! / (THETAV(i,kts+k1-1,j) - THETAV(i,kts+k1-2,j)) - ZSF else - !pblh_thetav(i,j) = 0.0 kpbl_thetav(i,j) = kts + 1 endif enddo @@ -838,7 +842,7 @@ subroutine rrfs_smoke_prep( & SFCWIND = sqrt(u10m(i)**2+v10m(i)**2) windgustpot(i,1) = SFCWIND if (kpbl_thetav(i,1)+1 .ge. kts+1 ) then - do k=kts+1,kpbl_thetav(i,1)+1 + do k=kts+1,int(kpbl_thetav(i,1))+1 WIND = sqrt(us3d(i,k)**2+vs3d(i,k)**2) DELWIND = WIND - SFCWIND DZ = zmid(i,k,1) - oro(i) @@ -851,7 +855,6 @@ subroutine rrfs_smoke_prep( & do i=its,ite wdgust=max(windgustpot(i,1),3.) snoweq=max((25.-snow_cpl(i))/25.,0.) - ! hwp_local(i,1)=0.237*wdgust**1.11*max(t2m(i)-dpt2m(i),15.)**0.92*((1.-wetness(i))**6.95)*snoweq ! Eric original 08/2022 hwp_local(i,1)=0.177*wdgust**0.97*max(t2m(i)-dpt2m(i),15.)**1.03*((1.-wetness(i))**0.4)*snoweq ! Eric update 11/2023 enddo ! Set paramters for ebb_dcycle option @@ -865,10 +868,6 @@ subroutine rrfs_smoke_prep( & fire_end_hr(i,j) = 0.0 hwp_day_avg(i,j) = 0.0 ebb_smoke_in (i) = ebu_in(i,j) - if (ktau == 1) then - fhist (i,j) = 1. - coef_bb_dc (i,j) = 1. - endif enddo enddo endif @@ -876,7 +875,7 @@ subroutine rrfs_smoke_prep( & ! RAR: here we need to initialize various arrays in order to apply HWP to ! diurnal cycle ! if ebb_dcycle/=2 then those arrays=0, we need to read in temporal - if (ebb_dcycle == 2) then + if (ebb_dcycle == 2 .and. ktau == 1) then do i=its, ite do j=jts, jte ebu_in (i,j) = smoke2d_RRFS(i,1)!/86400. @@ -884,11 +883,6 @@ subroutine rrfs_smoke_prep( & fire_end_hr (i,j) = smoke2d_RRFS(i,3) hwp_day_avg (i,j) = smoke2d_RRFS(i,4) ebb_smoke_in(i ) = ebu_in(i,j) - ! Initialize to 1 on first time step, modified by add_emiss_burn thereafter - if (ktau == 1) then - fhist (i,j) = 1. - coef_bb_dc (i,j) = 1. - endif enddo enddo end if @@ -896,6 +890,8 @@ subroutine rrfs_smoke_prep( & if (ktau==1) then do j=jts,jte do i=its,ite + fhist (i,j) = 1. + coef_bb_dc (i,j) = 1. if (xlong(i,j)<230.) then peak_hr(i,j)= 0.0* 3600. ! peak at 24 UTC, fires in Alaska elseif(xlong(i,j)<245.) then diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index fe664d31d..393c5d3d8 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_wrapper type = scheme - dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise1.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90, dep_dry_mod_emerson.F90,dep_data_mod.F90 + dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90, dep_dry_mod_emerson.F90,dep_data_mod.F90 ######################################################################## [ccpp-arg-table] @@ -50,6 +50,13 @@ dimensions = () type = logical intent = in +[add_fire_heat_flux_in] + standard_name = flag_for_fire_heat_flux + long_name = flag to add fire heat flux to LSM + units = flag + dimensions = () + type = logical + intent = in [do_plumerise_in] standard_name = do_smoke_plumerise long_name = rrfs smoke plumerise option @@ -64,7 +71,7 @@ dimensions = () type = integer intent = in -[wind_eff_opt_in] +[plume_wind_eff_in] standard_name = option_for_wind_effects_on_smoke_plumerise long_name = wind effect plumerise option units = index @@ -551,7 +558,7 @@ standard_name = anthropogenic_background_input long_name = anthropogenic background input units = various - dimensions = (horizontal_loop_extent,4) + dimensions = (horizontal_loop_extent,1) type = real kind = kind_phys intent = in @@ -567,7 +574,7 @@ standard_name = emission_smoke_prvd_RRFS long_name = emission fire RRFS daily units = various - dimensions = (horizontal_dimension,4) + dimensions = (horizontal_loop_extent,4) type = real kind = kind_phys intent = in @@ -692,7 +699,7 @@ type = real kind = kind_phys intent = inout -[frp_input] +[frp_output] standard_name = frp_hourly long_name = hourly fire radiative power units = MW diff --git a/physics/smoke_dust/seas_mod.F90 b/physics/smoke_dust/seas_mod.F90 index 1d18046ad..e5e63e909 100755 --- a/physics/smoke_dust/seas_mod.F90 +++ b/physics/smoke_dust/seas_mod.F90 @@ -185,7 +185,6 @@ subroutine gocart_seasalt_driver(dt,alt,t_phy,u_phy, & chem(i,kts,j,p_seas_3) = chem(i,kts,j,p_seas_3) + tc(3)*converi chem(i,kts,j,p_seas_4) = chem(i,kts,j,p_seas_4) + tc(4)*converi chem(i,kts,j,p_seas_5) = chem(i,kts,j,p_seas_5) + tc(5)*converi - !print*,'hli tc(2),chem(i,kts,j,p_seas_2)',tc(2),chem(i,kts,j,p_seas_2) ! for output diagnostics emis_seas(i,1,j,p_eseas1) = bems(1) From 846ec8e0075e9e330401e03d5e0880963926d9d7 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 20 Dec 2023 03:08:53 +0000 Subject: [PATCH 125/249] remove extra rho0 --- physics/clm_lake.f90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/clm_lake.f90 b/physics/clm_lake.f90 index a035928f4..91e8c71b7 100644 --- a/physics/clm_lake.f90 +++ b/physics/clm_lake.f90 @@ -270,7 +270,7 @@ SUBROUTINE clm_lake_run( & ! Atmospheric model state inputs: tg3, pgr, zlvl, gt0, prsi, phii, qvcurr, gu0, gv0, xlat_d, xlon_d, & - ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, rho0, tsfc, & + ch, cm, dlwsfci, dswsfci, oro_lakedepth, wind, tsfc, & flag_iter, flag_lakefreeze, ISLTYP, rainncprv, raincprv, & ! Feedback to atmosphere: From bf99b986d1a35c24e6fee2a518196ac65788a4c6 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Wed, 20 Dec 2023 17:40:11 +0000 Subject: [PATCH 126/249] "declare nchem as intent in" --- physics/cu_gf_driver.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/cu_gf_driver.F90 b/physics/cu_gf_driver.F90 index e4a78b030..92f8760b0 100644 --- a/physics/cu_gf_driver.F90 +++ b/physics/cu_gf_driver.F90 @@ -94,8 +94,8 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer, parameter :: dicycle_m=0 !- diurnal cycle flag integer :: ishallow_g3 ! depend on imfshalcnv !------------------------------------------------------------- - integer :: its,ite, jts,jte, kts,kte, nchem - integer, intent(in ) :: im,km,ntracer + integer :: its,ite, jts,jte, kts,kte + integer, intent(in ) :: im,km,ntracer, nchem integer, intent(in ) :: ichoice_in,ichoicem_in,ichoice_s_in logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend From 37d512f55b425ef7f1ff069c89d23d85c7f9bb8e Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Fri, 22 Dec 2023 21:17:51 +0000 Subject: [PATCH 127/249] "update the dimension of chem3d in GF for hercules/gnu rap cases" --- physics/cu_gf_deep.F90 | 4 ++-- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/cu_gf_deep.F90 b/physics/cu_gf_deep.F90 index b45452000..a1bca36c9 100644 --- a/physics/cu_gf_deep.F90 +++ b/physics/cu_gf_deep.F90 @@ -216,11 +216,11 @@ subroutine cu_gf_deep_run( & ,intent (inout ) :: & mconv,ccn !$acc declare copy(mconv,ccn) - real(kind=kind_phys), dimension (its:ite,kts:kte,nchem) & + real(kind=kind_phys), dimension (:,:,:) & ,intent (inout) :: & chem3d logical, intent (in) :: do_smoke_transport - real(kind=kind_phys), dimension (its:ite,nchem) & + real(kind=kind_phys), dimension (:,:) & , intent (out) :: wetdpc_deep real(kind=kind_phys), intent (in) :: fscav(:) !$acc declare copy(chem3d) copyout(wetdpc_deep) copyin(fscav) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index afd386595..eb7f83af6 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -875,7 +875,7 @@ subroutine rrfs_smoke_prep( & ! RAR: here we need to initialize various arrays in order to apply HWP to ! diurnal cycle ! if ebb_dcycle/=2 then those arrays=0, we need to read in temporal - if (ebb_dcycle == 2 .and. ktau == 1) then + if (ebb_dcycle == 2) then do i=its, ite do j=jts, jte ebu_in (i,j) = smoke2d_RRFS(i,1)!/86400. From a5ac3f5289e0c9ad700b65e35483f0592224fa70 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Tue, 26 Dec 2023 15:12:24 +0000 Subject: [PATCH 128/249] Updated sfc_diff.f to add the option to check the surface ocean current. --- physics/sfc_diff.f | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 1b801aa7a..9c143218e 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -126,6 +126,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) integer, intent(out) :: errflg ! ! locals + real(kind=kind_phys) :: ssumax, ssvmax + logical :: check_ssu_ssv ! integer i real(kind=kind_phys) :: windrel @@ -169,6 +171,18 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ps is in pascals, wind is wind speed, ! surface roughness length is converted to m from cm ! + + check_ssu_ssv=.false. + if(check_ssu_ssv) then + ssumax=0.0 + ssvmax=0.0 + do i=1,im + if(ssu(i) .gt. ssumax) ssumax=ssu(i) + if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) + enddo + print*, 'in sfc_diff ssumax,ssvmax im =',ssumax,ssvmax,im + print*, 'in sfc_diff wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) + endif do i=1,im if(flag_iter(i)) then From 790960e3ff3203c69420282e87f7c164776c4e36 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 26 Dec 2023 20:30:50 -0700 Subject: [PATCH 129/249] Make ozone physics CCPP compliant by removing 'optional' and 'pointer' attributes --- physics/GFS_suite_stateout_update.F90 | 15 ++++++------ physics/GFS_suite_stateout_update.meta | 7 ++++++ physics/module_ozphys.F90 | 32 +++++++++++++++----------- 3 files changed, 34 insertions(+), 20 deletions(-) diff --git a/physics/GFS_suite_stateout_update.F90 b/physics/GFS_suite_stateout_update.F90 index e9e477fce..53867f6cc 100644 --- a/physics/GFS_suite_stateout_update.F90 +++ b/physics/GFS_suite_stateout_update.F90 @@ -18,7 +18,7 @@ module GFS_suite_stateout_update subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, tgrs, ugrs, vgrs, qgrs, & dudt, dvdt, dtdt, dqdt, gt0, gu0, gv0, gq0, oz0, ntiw, nqrimef, imp_physics, & imp_physics_fer_hires, epsq, ozphys, oz_phys_2015, oz_phys_2006, con_1ovg, prsl, & - dp, ozpl, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, errmsg, errflg) + dp, ozpl, qdiag3d, do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz, errmsg, errflg) ! Inputs integer, intent(in ) :: im @@ -31,12 +31,13 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, tgrs, ugrs, vgrs real(kind=kind_phys), intent(in ), dimension(:,:,:) :: qgrs, ozpl real(kind=kind_phys), intent(in ), dimension(:,:) :: dudt, dvdt, dtdt real(kind=kind_phys), intent(in ), dimension(:,:,:) :: dqdt + logical, intent(in) :: qdiag3d logical, intent(in) :: oz_phys_2015 logical, intent(in) :: oz_phys_2006 type(ty_ozphys), intent(in) :: ozphys ! Outputs (optional) - real(kind=kind_phys), intent(inout), dimension(:,:), pointer, optional :: & + real(kind=kind_phys), intent(inout), dimension(:,:) :: & 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 @@ -50,7 +51,7 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, tgrs, ugrs, vgrs ! Locals integer :: i, k - + ! Initialize CCPP error handling variables errmsg = '' errflg = 0 @@ -65,12 +66,12 @@ subroutine GFS_suite_stateout_update_run (im, levs, ntrac, dtp, tgrs, ugrs, vgrs ! If using photolysis physics schemes, update (prognostic) gas concentrations using ! updated state. if (oz_phys_2015) then - call ozphys%run_o3prog_2015(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, do3_dt_prd, & - do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) + call ozphys%run_o3prog_2015(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, qdiag3d, & + do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) endif if (oz_phys_2006) then - call ozphys%run_o3prog_2006(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, do3_dt_prd, & - do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) + call ozphys%run_o3prog_2006(con_1ovg, dtp, prsl, gt0, dp, ozpl, oz0, qdiag3d, & + do3_dt_prd, do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) endif ! If using Ferrier-Aligo microphysics, set bounds on the mass-weighted rime factor. diff --git a/physics/GFS_suite_stateout_update.meta b/physics/GFS_suite_stateout_update.meta index fae276d2f..75f7fe59e 100644 --- a/physics/GFS_suite_stateout_update.meta +++ b/physics/GFS_suite_stateout_update.meta @@ -44,6 +44,13 @@ dimensions = () type = ty_ozphys intent = in +[qdiag3d] + standard_name = flag_for_tracer_diagnostics_3D + long_name = flag for 3d tracer diagnostic fields + units = flag + dimensions = () + type = logical + intent = in [oz_phys_2015] standard_name = flag_for_nrl_2015_ozone_scheme long_name = flag for new (2015) ozone physics diff --git a/physics/module_ozphys.F90 b/physics/module_ozphys.F90 index f824736b1..8d0486422 100644 --- a/physics/module_ozphys.F90 +++ b/physics/module_ozphys.F90 @@ -198,7 +198,7 @@ end subroutine update_o3prog ! ######################################################################################### ! Procedure (type-bound) for NRL prognostic ozone (2015). ! ######################################################################################### - subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, & + subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do_diag, do3_dt_prd, & do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) class(ty_ozphys), intent(in) :: this real(kind_phys), intent(in) :: & @@ -213,7 +213,8 @@ subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, ozpl ! Ozone forcing data real(kind_phys), intent(inout), dimension(:,:) :: & oz ! Ozone concentration updated by physics - real(kind_phys), intent(inout), dimension(:,:), pointer, optional :: & + logical, intent(in) :: do_diag + real(kind_phys), intent(inout), dimension(:,:) :: & 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 @@ -297,10 +298,12 @@ subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, enddo ! Diagnostics (optional) - if (associated(do3_dt_prd)) do3_dt_prd(:,iLev) = (prod(:,1)-prod(:,2)*prod(:,6))*dt - if (associated(do3_dt_ozmx)) do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:)) - if (associated(do3_dt_temp)) do3_dt_temp(:,iLev) = prod(:,3)*(t(:,iLev)-prod(:,5))*dt - if (associated(do3_dt_ohoz)) do3_dt_ohoz(:,iLev) = prod(:,4) * (colo3(:,iLev)-coloz(:,iLev))*dt + if (do_diag) then + do3_dt_prd(:,iLev) = (prod(:,1)-prod(:,2)*prod(:,6))*dt + do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:)) + do3_dt_temp(:,iLev) = prod(:,3)*(t(:,iLev)-prod(:,5))*dt + do3_dt_ohoz(:,iLev) = prod(:,4) * (colo3(:,iLev)-coloz(:,iLev))*dt + endif enddo return @@ -309,7 +312,7 @@ end subroutine run_o3prog_2015 ! ######################################################################################### ! Procedure (type-bound) for NRL prognostic ozone (2006). ! ######################################################################################### - subroutine run_o3prog_2006(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, & + subroutine run_o3prog_2006(this, con_1ovg, dt, p, t, dp, ozpl, oz, do_diag, do3_dt_prd, & do3_dt_ozmx, do3_dt_temp, do3_dt_ohoz) class(ty_ozphys), intent(in) :: this real(kind_phys), intent(in) :: & @@ -324,7 +327,8 @@ subroutine run_o3prog_2006(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, ozpl ! Ozone forcing data real(kind_phys), intent(inout), dimension(:,:) :: & oz ! Ozone concentration updated by physics - real(kind_phys), intent(inout), dimension(:,:), pointer, optional :: & + logical, intent(in) :: do_diag + real(kind_phys), intent(inout), dimension(:,:) :: & 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 @@ -418,12 +422,14 @@ subroutine run_o3prog_2006(this, con_1ovg, dt, p, t, dp, ozpl, oz, do3_dt_prd, oz(iCol,iLev) = (ozib(iCol) + tem*dt) / (1.0 + prod(iCol,2)*dt) enddo endif - ! Diagnostics (optional) - if (associated(do3_dt_prd)) do3_dt_prd(:,iLev) = prod(:,1)*dt - if (associated(do3_dt_ozmx)) do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:)) - if (associated(do3_dt_temp)) do3_dt_temp(:,iLev) = prod(:,3) * t(:,iLev) * dt - if (associated(do3_dt_ohoz)) do3_dt_ohoz(:,iLev) = prod(:,4) * colo3(:,iLev) * dt + ! Diagnostics (optional) + if (do_diag) then + do3_dt_prd(:,iLev) = prod(:,1)*dt + do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:)) + do3_dt_temp(:,iLev) = prod(:,3) * t(:,iLev) * dt + do3_dt_ohoz(:,iLev) = prod(:,4) * colo3(:,iLev) * dt + endif enddo return From 094860f48799e6e5737cbf1ab147770a34783629 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Wed, 27 Dec 2023 12:06:32 +0000 Subject: [PATCH 130/249] update sfc_diff.f --- physics/sfc_diff.f | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 9c143218e..2f392919a 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -180,8 +180,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) if(ssu(i) .gt. ssumax) ssumax=ssu(i) if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) enddo - print*, 'in sfc_diff ssumax,ssvmax im =',ssumax,ssvmax,im - print*, 'in sfc_diff wind(1),u1(1),v1(1) =',wind(1),u1(1),v1(1) + print*, 'sfc_diff ssumax,ssvmax im:',ssumax,ssvmax,im + print*, 'sfc_diff wind(1),u1(1):',wind(1),u1(1) endif do i=1,im From 19cad16dc1cf05626ef2df9fde8f47b0cf3070c1 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Sat, 30 Dec 2023 09:04:51 +0000 Subject: [PATCH 131/249] Update the following files: satmedmfvdif.F satmedmfvdif.meta satmedmfvdifq.F sfc_diag.f sfc_diff.f sfc_nst.f90 sfc_ocean.F --- physics/satmedmfvdif.F | 17 +---------------- physics/satmedmfvdif.meta | 16 ---------------- physics/satmedmfvdifq.F | 2 +- physics/sfc_diag.f | 4 ++-- physics/sfc_diff.f | 38 ++++++++++---------------------------- physics/sfc_nst.f90 | 4 ++-- physics/sfc_ocean.F | 9 ++++----- 7 files changed, 20 insertions(+), 70 deletions(-) diff --git a/physics/satmedmfvdif.F b/physics/satmedmfvdif.F index cc7ce95b3..79f7bbea1 100644 --- a/physics/satmedmfvdif.F +++ b/physics/satmedmfvdif.F @@ -63,7 +63,7 @@ end subroutine satmedmfvdif_init !> @{ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & & grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, & - & dv,du,tdt,rtg,u1,v1,ssu,ssv,t1,q1,swh,hlw,xmu,garea, & + & dv,du,tdt,rtg,u1,v1,t1,q1,swh,hlw,xmu,garea, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,heat,evap,stress,spd1,kpbl, & & prsi,del,prsl,prslk,phii,phil,delt, & @@ -95,7 +95,6 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & & tdt(:,:), rtg(:,:,:) real(kind=kind_phys), intent(in) :: & & u1(:,:), v1(:,:), & - & ssu(:), ssv(:), & & t1(:,:), q1(:,:,:), & & swh(:,:), hlw(:,:), & & xmu(:), garea(:), & @@ -218,9 +217,6 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & ! real(kind=kind_phys) h1 integer :: idtend - integer ii - real(kind=kind_phys) :: ssumax, ssvmax - logical :: check_ssu_ssv !! parameter(wfac=7.0,cfac=4.5) parameter(gamcrt=3.,gamcrq=0.,sfcfrac=0.1) @@ -254,17 +250,6 @@ subroutine satmedmfvdif_run(im,km,ntrac,ntcw,ntiw,ntke, & ! Initialize CCPP error handling variables errmsg = '' errflg = 0 -! - check_ssu_ssv=.false. - if(check_ssu_ssv) then - ssumax=0.0 - ssvmax=0.0 - do ii=1,im - if(ssu(ii) .gt. ssumax) ssumax=ssu(ii) - if(ssv(ii) .gt. ssvmax) ssvmax=ssv(ii) - enddo - print*, 'in satmedmfvdif.F ssumax,ssvmax =',ssumax,ssvmax - endif !> -# Compute preliminary variables from input arguments dt2 = delt diff --git a/physics/satmedmfvdif.meta b/physics/satmedmfvdif.meta index 522ce543b..3609ed50f 100644 --- a/physics/satmedmfvdif.meta +++ b/physics/satmedmfvdif.meta @@ -211,22 +211,6 @@ type = real kind = kind_phys intent = in -[ssu] - standard_name = ocn_current_zonal - long_name = ocn_current_zonal - units = m s-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[ssv] - standard_name = ocn_current_merid - long_name = ocn_current_merid - units = m s-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in [t1] standard_name = air_temperature long_name = layer mean air temperature diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 24c12aa8b..90cba0553 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -2382,7 +2382,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & if(icplocn2atm == 0) then dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i) dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i) - else + else if (icplocn2atm ==1) then spd1_m=sqrt( (u1(i,1)-ssu(i))**2+(v1(i,1)-ssv(i))**2 ) dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1_m dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1_m diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index 183da8b0e..bdc96ade6 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -92,10 +92,10 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & do i = 1, im f10m(i) = fm10(i) / fm(i) - if(icplocn2atm ==0) then + if (icplocn2atm ==0) then u10m(i) = f10m(i) * u1(i) v10m(i) = f10m(i) * v1(i) - else + else if (icplocn2atm ==1) then u10m(i) = ssu(i)+f10m(i) * (u1(i)-ssu(i)) v10m(i) = ssv(i)+f10m(i) * (v1(i)-ssv(i)) endif diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 2f392919a..0c9bc5275 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -167,11 +167,13 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) errmsg = '' errflg = 0 + ! initialize variables. all units are supposedly m.k.s. unless specified ! ps is in pascals, wind is wind speed, ! surface roughness length is converted to m from cm ! - +! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type + check_ssu_ssv=.false. if(check_ssu_ssv) then ssumax=0.0 @@ -289,24 +291,13 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) tem2 = max(sigmaf(i), 0.1_kp) zvfun(i) = sqrt(tem1 * tem2) ! - if(icplocn2atm == 0) then - call stability + call stability ! --- inputs: & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, ! --- outputs: & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), & cm_lnd(i), ch_lnd(i), stress_lnd(i), ustar_lnd(i)) - else - windrel=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) - call stability -! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, windrel, - & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, -! --- outputs: - & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), - & cm_lnd(i), ch_lnd(i), stress_lnd(i), ustar_lnd(i)) - endif endif ! Dry points if (icy(i)) then ! Some ice @@ -354,23 +345,13 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ztmax_ice(i) = max(ztmax_ice(i), 1.0e-6) ! - if(icplocn2atm == 0) then - call stability + call stability ! --- inputs: & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, ! --- outputs: & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i)) - else - call stability -! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, windrel, - & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, -! --- outputs: - & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), - & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i)) - endif endif ! Icy points ! BWG: Everything from here to end of subroutine was after @@ -390,10 +371,12 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0 = 0.01_kp * z0rl_wat(i) z0max = max(zmin, min(z0,z1(i))) ! ustar_wat(i) = sqrt(grav * z0 / charnock) - if(icplocn2atm == 0) then + if (icplocn2atm == 0) then wind10m=sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) - else + windrel=wind(i) + else if (icplocn2atm ==1) then wind10m=sqrt((u10m(i)-ssu(i))**2 + (v10m(i)-ssv(i))**2) + windrel=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) endif !** test xubin's new z0 @@ -425,8 +408,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! call stability ! --- inputs: -! & (z1(i), zvfun(i), gdx, tv1, thv1, windrel(i), - & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & (z1(i), zvfun(i), gdx, tv1, thv1, windrel, & z0max, ztmax_wat(i), tvs, grav, thsfc_loc, ! --- outputs: & rb_wat(i), fm_wat(i), fh_wat(i), fm10_wat(i), fh2_wat(i), diff --git a/physics/sfc_nst.f90 b/physics/sfc_nst.f90 index 1844a1077..06d2b061b 100644 --- a/physics/sfc_nst.f90 +++ b/physics/sfc_nst.f90 @@ -317,11 +317,11 @@ subroutine sfc_nst_run & ! --- ... rcp = rho cp ch v - if(icplocn2atm ==0) then + if (icplocn2atm ==0) then rch(i) = rho_a(i) * cp * ch(i) * wind(i) cmm(i) = cm (i) * wind(i) chh(i) = rho_a(i) * ch(i) * wind(i) - else + else if (icplocn2atm ==1) then windrel= sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) rch(i) = rho_a(i) * cp * ch(i) * windrel cmm(i) = cm (i) * windrel diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index d8b33f3dc..0d1ebc2cd 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -177,9 +177,6 @@ subroutine sfc_ocean_run & ! rho is density, qss is sat. hum. at surface if ( flag(i) ) then - if (icplocn2atm == 1) then - windrel(i)=sqrt( (u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2 ) - endif if (use_med_flux) then q0(i) = max( q1(i), qmin ) @@ -188,7 +185,8 @@ subroutine sfc_ocean_run & if (icplocn2atm == 0) then tem = ch(i) * wind(i) cmm(i) = cm(i) * wind(i) - else + else if (icplocn2atm ==1) then + windrel(i)=sqrt( (u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2 ) tem = ch(i) * windrel(i) cmm(i) = cm(i) * windrel(i) endif @@ -212,7 +210,8 @@ subroutine sfc_ocean_run & rch = rho(i) * cp * ch(i) * wind(i) tem = ch(i) * wind(i) cmm(i) = cm(i) * wind(i) - else + else if (icplocn2atm ==1) then + windrel(i)=sqrt( (u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2 ) rch = rho(i) * cp * ch(i) * windrel(i) tem = ch(i) * windrel(i) cmm(i) = cm(i) * windrel(i) From e8eaaf9c1f328bd2ef4f03d1831885b858f305e4 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Wed, 3 Jan 2024 10:48:38 +0000 Subject: [PATCH 132/249] Code cleanup --- physics/sfc_diff.f | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 0c9bc5275..1976ab5c2 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -126,8 +126,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) integer, intent(out) :: errflg ! ! locals - real(kind=kind_phys) :: ssumax, ssvmax - logical :: check_ssu_ssv ! integer i real(kind=kind_phys) :: windrel @@ -174,18 +172,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! ! write(0,*)'in sfc_diff, sfc_z0_type=',sfc_z0_type - check_ssu_ssv=.false. - if(check_ssu_ssv) then - ssumax=0.0 - ssvmax=0.0 - do i=1,im - if(ssu(i) .gt. ssumax) ssumax=ssu(i) - if(ssv(i) .gt. ssvmax) ssvmax=ssv(i) - enddo - print*, 'sfc_diff ssumax,ssvmax im:',ssumax,ssvmax,im - print*, 'sfc_diff wind(1),u1(1):',wind(1),u1(1) - endif - do i=1,im if(flag_iter(i)) then From f80f52f250d60b311783fe3a317ef14cd93fab22 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Fri, 5 Jan 2024 08:59:25 +0000 Subject: [PATCH 133/249] Change the variable name for zonal ocean current from ssu to usfco. Change the variable name for meridional ocean current from ssv to vsfco. --- physics/satmedmfvdifq.F | 10 +++++----- physics/satmedmfvdifq.meta | 4 ++-- physics/sfc_diag.f | 8 ++++---- physics/sfc_diag.meta | 4 ++-- physics/sfc_diff.f | 9 +++++---- physics/sfc_diff.meta | 4 ++-- physics/sfc_nst.f90 | 8 ++++---- physics/sfc_nst.meta | 4 ++-- physics/sfc_ocean.F | 16 +++++++++------- physics/sfc_ocean.meta | 4 ++-- 10 files changed, 37 insertions(+), 34 deletions(-) diff --git a/physics/satmedmfvdifq.F b/physics/satmedmfvdifq.F index 90cba0553..9698a140f 100644 --- a/physics/satmedmfvdifq.F +++ b/physics/satmedmfvdifq.F @@ -75,7 +75,7 @@ end subroutine satmedmfvdifq_init !! \section detail_satmedmfvidfq GFS satmedmfvdifq Detailed Algorithm subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & & ntiw,ntke,grav,rd,cp,rv,hvap,hfus,fv,eps,epsm1, & - & dv,du,tdt,rtg,u1,v1,t1,q1,ssu,ssv,icplocn2atm, & + & dv,du,tdt,rtg,u1,v1,t1,q1,usfco,vsfco,icplocn2atm, & & swh,hlw,xmu,garea,zvfun,sigmaf, & & psk,rbsoil,zorl,u10m,v10m,fm,fh, & & tsea,heat,evap,stress,spd1,kpbl, & @@ -110,7 +110,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & & tdt(:,:), rtg(:,:,:) real(kind=kind_phys), intent(in) :: & & u1(:,:), v1(:,:), & - & ssu(:), ssv(:), & + & usfco(:), vsfco(:), & & t1(:,:), q1(:,:,:), & & swh(:,:), hlw(:,:), & & xmu(:), garea(:), & @@ -2383,9 +2383,9 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & dusfc(i) = -1.*rho_a(i)*stress(i)*u1(i,1)/spd1(i) dvsfc(i) = -1.*rho_a(i)*stress(i)*v1(i,1)/spd1(i) else if (icplocn2atm ==1) then - spd1_m=sqrt( (u1(i,1)-ssu(i))**2+(v1(i,1)-ssv(i))**2 ) - dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-ssu(i))/spd1_m - dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-ssv(i))/spd1_m + spd1_m=sqrt( (u1(i,1)-usfco(i))**2+(v1(i,1)-vsfco(i))**2 ) + dusfc(i) = -1.*rho_a(i)*stress(i)*(u1(i,1)-usfco(i))/spd1_m + dvsfc(i) = -1.*rho_a(i)*stress(i)*(v1(i,1)-vsfco(i))/spd1_m endif enddo ! diff --git a/physics/satmedmfvdifq.meta b/physics/satmedmfvdifq.meta index c97126457..113843f11 100644 --- a/physics/satmedmfvdifq.meta +++ b/physics/satmedmfvdifq.meta @@ -217,7 +217,7 @@ type = real kind = kind_phys intent = in -[ssu] +[usfco] standard_name = ocn_current_zonal long_name = ocn_current_zonal units = m s-1 @@ -225,7 +225,7 @@ type = real kind = kind_phys intent = in -[ssv] +[vsfco] standard_name = ocn_current_merid long_name = ocn_current_merid units = m s-1 diff --git a/physics/sfc_diag.f b/physics/sfc_diag.f index bdc96ade6..b0432df6f 100644 --- a/physics/sfc_diag.f +++ b/physics/sfc_diag.f @@ -17,7 +17,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & & lsm,lsm_ruc,grav,cp,eps,epsm1,con_rocp, & & con_karman, & & shflx,cdq,wind, & - & ssu,ssv,icplocn2atm, & + & usfco,vsfco,icplocn2atm, & & zf,ps,u1,v1,t1,q1,prslki,evap,fm,fh,fm10,fh2, & & ust,tskin,qsurf,thsfc_loc,diag_flux,diag_log, & & use_lake_model,iopt_lake,iopt_lake_clm, & @@ -40,7 +40,7 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & real(kind=kind_phys), intent(in) :: con_karman real(kind=kind_phys), dimension(:), intent( in) :: & & zf, ps, u1, v1, t1, q1, ust, tskin, & - & ssu, ssv, & + & usfco, vsfco, & & qsurf, prslki, evap, fm, fh, fm10, fh2, & & shflx, cdq, wind, xlat_d, xlon_d real(kind=kind_phys), dimension(:), intent(out) :: & @@ -96,8 +96,8 @@ subroutine sfc_diag_run (im,xlat_d,xlon_d, & u10m(i) = f10m(i) * u1(i) v10m(i) = f10m(i) * v1(i) else if (icplocn2atm ==1) then - u10m(i) = ssu(i)+f10m(i) * (u1(i)-ssu(i)) - v10m(i) = ssv(i)+f10m(i) * (v1(i)-ssv(i)) + u10m(i) = usfco(i)+f10m(i) * (u1(i)-usfco(i)) + v10m(i) = vsfco(i)+f10m(i) * (v1(i)-vsfco(i)) endif have_2m = use_lake_model(i)>0 .and. use_lake2m .and. & & iopt_lake==iopt_lake_clm diff --git a/physics/sfc_diag.meta b/physics/sfc_diag.meta index da300d053..44f3b5c6a 100644 --- a/physics/sfc_diag.meta +++ b/physics/sfc_diag.meta @@ -123,7 +123,7 @@ type = real kind = kind_phys intent = in -[ssu] +[usfco] standard_name = ocn_current_zonal long_name = ocn_current_zonal units = m s-1 @@ -131,7 +131,7 @@ type = real kind = kind_phys intent = in -[ssv] +[vsfco] standard_name = ocn_current_merid long_name = ocn_current_merid units = m s-1 diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 1976ab5c2..96f96faeb 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -61,7 +61,7 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) & z0pert,ztpert, & ! mg, sfc-perts !intent(in) & flag_iter,redrag, & !intent(in) & u10m,v10m,sfc_z0_type, & !hafs,z0 type !intent(in) - & u1,v1,ssu,ssv,icplocn2atm, & + & u1,v1,usfco,vsfco,icplocn2atm, & & wet,dry,icy, & !intent(in) & thsfc_loc, & !intent(in) & tskin_wat, tskin_lnd, tskin_ice, & !intent(in) @@ -97,7 +97,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) logical, intent(in) :: thsfc_loc ! Flag for reference pressure in theta calculation real(kind=kind_phys), dimension(:), intent(in) :: u10m,v10m - real(kind=kind_phys), dimension(:), intent(in) :: u1,v1,ssu,ssv + real(kind=kind_phys), dimension(:), intent(in) :: u1,v1 + real(kind=kind_phys), dimension(:), intent(in) :: usfco,vsfco real(kind=kind_phys), intent(in) :: rvrdm1, eps, epsm1, grav real(kind=kind_phys), dimension(:), intent(in) :: & & ps,t1,q1,z1,garea,prsl1,prslki,prsik1,prslk1, & @@ -361,8 +362,8 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) wind10m=sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) windrel=wind(i) else if (icplocn2atm ==1) then - wind10m=sqrt((u10m(i)-ssu(i))**2 + (v10m(i)-ssv(i))**2) - windrel=sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + wind10m=sqrt((u10m(i)-usfco(i))**2 + (v10m(i)-vsfco(i))**2) + windrel=sqrt( (u1(i)-usfco(i))**2 + (v1(i)-vsfco(i))**2 ) endif !** test xubin's new z0 diff --git a/physics/sfc_diff.meta b/physics/sfc_diff.meta index 1233e17af..3a141712b 100644 --- a/physics/sfc_diff.meta +++ b/physics/sfc_diff.meta @@ -226,7 +226,7 @@ type = real kind = kind_phys intent = in -[ssu] +[usfco] standard_name = ocn_current_zonal long_name = ocn_current_zonal units = m s-1 @@ -234,7 +234,7 @@ type = real kind = kind_phys intent = in -[ssv] +[vsfco] standard_name = ocn_current_merid long_name = ocn_current_merid units = m s-1 diff --git a/physics/sfc_nst.f90 b/physics/sfc_nst.f90 index 06d2b061b..1dd9d6117 100644 --- a/physics/sfc_nst.f90 +++ b/physics/sfc_nst.f90 @@ -26,7 +26,7 @@ module sfc_nst !> \section NSST_general_algorithm GFS Near-Surface Sea Temperature Scheme General Algorithm subroutine sfc_nst_run & ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs: - pi, tgice, sbc, ps, u1, v1, ssu, ssv, icplocn2atm, t1, & + pi, tgice, sbc, ps, u1, v1, usfco, vsfco, icplocn2atm, t1, & q1, tref, cm, ch, lseaspray, fm, fm10, & prsl1, prslki, prsik1, prslk1, wet, use_lake_model, xlon, & sinlat, stress, & @@ -84,7 +84,7 @@ subroutine sfc_nst_run & ! im - integer, horiz dimension 1 ! ! ps - real, surface pressure (pa) im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! - ! ssu, ssv - real, u/v component of surface current (m/s) im ! + ! usfco, vsfco - real, u/v component of surface current (m/s) im ! ! icplocn2atm - integer, option to include ocean surface 1 ! ! current in the computation of flux ! ! t1 - real, surface layer mean temperature ( k ) im ! @@ -175,7 +175,7 @@ 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, & - ssu, ssv, t1, q1, tref, cm, ch, fm, fm10, & + usfco, vsfco, t1, q1, tref, cm, ch, fm, fm10, & prsl1, prslki, prsik1, prslk1, xlon, xcosz, & sinlat, stress, sfcemis, dlwflx, sfcnsw, rain, wind real (kind=kind_phys), intent(in) :: timestep @@ -322,7 +322,7 @@ subroutine sfc_nst_run & cmm(i) = cm (i) * wind(i) chh(i) = rho_a(i) * ch(i) * wind(i) else if (icplocn2atm ==1) then - windrel= sqrt( (u1(i)-ssu(i))**2 + (v1(i)-ssv(i))**2 ) + windrel= sqrt( (u1(i)-usfco(i))**2 + (v1(i)-vsfco(i))**2 ) rch(i) = rho_a(i) * cp * ch(i) * windrel cmm(i) = cm (i) * windrel chh(i) = rho_a(i) * ch(i) * windrel diff --git a/physics/sfc_nst.meta b/physics/sfc_nst.meta index 7504b9d49..a9082515e 100644 --- a/physics/sfc_nst.meta +++ b/physics/sfc_nst.meta @@ -134,7 +134,7 @@ type = real kind = kind_phys intent = in -[ssu] +[usfco] standard_name = ocn_current_zonal long_name = ocn_current_zonal units = m s-1 @@ -142,7 +142,7 @@ type = real kind = kind_phys intent = in -[ssv] +[vsfco] standard_name = ocn_current_merid long_name = ocn_current_merid units = m s-1 diff --git a/physics/sfc_ocean.F b/physics/sfc_ocean.F index 0d1ebc2cd..505476510 100644 --- a/physics/sfc_ocean.F +++ b/physics/sfc_ocean.F @@ -25,7 +25,7 @@ subroutine sfc_ocean_run & ! --- inputs: & ( im, hvap, cp, rd, eps, epsm1, rvrdm1, ps, u1, v1, t1, q1, & & tskin, cm, ch, lseaspray, fm, fm10, & - & ssu, ssv, icplocn2atm, & + & usfco, vsfco, icplocn2atm, & & prsl1, prslki, wet, use_lake_model, wind, &, ! --- inputs & flag_iter, use_med_flux, dqsfc_med, dtsfc_med, & & qsurf, cmm, chh, gflux, evap, hflx, ep, & ! --- outputs @@ -40,7 +40,7 @@ subroutine sfc_ocean_run & ! call sfc_ocean ! ! inputs: ! ! ( im, ps, u1, v1, t1, q1, tskin, cm, ch, lseaspray, fm, fm10, ! -! ssu, ssv, icplocn2atm, ! +! usfco, vsfco, icplocn2atm, ! ! prsl1, prslki, wet, use_lake_model, wind, flag_iter, ! ! use_med_flux, ! ! outputs: ! @@ -68,8 +68,9 @@ subroutine sfc_ocean_run & ! im - integer, horizontal dimension 1 ! ! ps - real, surface pressure im ! ! u1, v1 - real, u/v component of surface layer wind (m/s) im ! -! ssu,ssv - real, u/v component of surface ocean current (m/s) im ! -! icplocn2atm - integrt, =1 if ssu and ssv are used in the 1 ! +! usfco - real, u component of surface ocean current (m/s) im ! +! vsfco - real, v component of surface ocean current (m/s) im ! +! icplocn2atm - integer, =1 if usfco and vsfco are used in the 1 ! ! computation of air-sea fluxes ! ! t1 - real, surface layer mean temperature ( k ) im ! ! q1 - real, surface layer mean specific humidity im ! @@ -114,7 +115,8 @@ subroutine sfc_ocean_run & & eps, epsm1, rvrdm1 real (kind=kind_phys), dimension(:), intent(in) :: ps, u1, v1, & - & t1, q1, tskin, cm, ch, fm, fm10, prsl1, prslki, wind, ssu,ssv + & t1, q1, tskin, cm, ch, fm, fm10, prsl1, prslki, wind, & + & usfco, vsfco ! For sea spray effect logical, intent(in) :: lseaspray @@ -186,7 +188,7 @@ subroutine sfc_ocean_run & tem = ch(i) * wind(i) cmm(i) = cm(i) * wind(i) else if (icplocn2atm ==1) then - windrel(i)=sqrt( (u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2 ) + windrel(i)=sqrt( (u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2 ) tem = ch(i) * windrel(i) cmm(i) = cm(i) * windrel(i) endif @@ -211,7 +213,7 @@ subroutine sfc_ocean_run & tem = ch(i) * wind(i) cmm(i) = cm(i) * wind(i) else if (icplocn2atm ==1) then - windrel(i)=sqrt( (u1(i)-ssu(i))**2+(v1(i)-ssv(i))**2 ) + windrel(i)=sqrt( (u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2 ) rch = rho(i) * cp * ch(i) * windrel(i) tem = ch(i) * windrel(i) cmm(i) = cm(i) * windrel(i) diff --git a/physics/sfc_ocean.meta b/physics/sfc_ocean.meta index dbb9c9131..ac063ab5d 100644 --- a/physics/sfc_ocean.meta +++ b/physics/sfc_ocean.meta @@ -86,7 +86,7 @@ type = real kind = kind_phys intent = in -[ssu] +[usfco] standard_name = ocn_current_zonal long_name = ocn_current_zonal units = m s-1 @@ -94,7 +94,7 @@ type = real kind = kind_phys intent = in -[ssv] +[vsfco] standard_name = ocn_current_merid long_name = ocn_current_merid units = m s-1 From fa1078f56b72f9a3f38c5332cefc372b69ed55c2 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Sat, 6 Jan 2024 11:54:13 +0000 Subject: [PATCH 134/249] Update sfc_diff.f. --- physics/sfc_diff.f | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/sfc_diff.f b/physics/sfc_diff.f index 96f96faeb..5a9b1e54f 100644 --- a/physics/sfc_diff.f +++ b/physics/sfc_diff.f @@ -359,11 +359,11 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0max = max(zmin, min(z0,z1(i))) ! ustar_wat(i) = sqrt(grav * z0 / charnock) if (icplocn2atm == 0) then - wind10m=sqrt(u10m(i)*u10m(i) + v10m(i)*v10m(i)) + wind10m=sqrt(u10m(i)*u10m(i)+v10m(i)*v10m(i)) windrel=wind(i) else if (icplocn2atm ==1) then - wind10m=sqrt((u10m(i)-usfco(i))**2 + (v10m(i)-vsfco(i))**2) - windrel=sqrt( (u1(i)-usfco(i))**2 + (v1(i)-vsfco(i))**2 ) + wind10m=sqrt((u10m(i)-usfco(i))**2+(v10m(i)-vsfco(i))**2) + windrel=sqrt((u1(i)-usfco(i))**2+(v1(i)-vsfco(i))**2) endif !** test xubin's new z0 From fe77e06ab907accb3b860857d050f990ba88662d Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Mon, 8 Jan 2024 11:54:41 -0600 Subject: [PATCH 135/249] move sfc_land to new location --- physics/{ => SFC_Models/Land}/sfc_land.F90 | 0 physics/{ => SFC_Models/Land}/sfc_land.meta | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename physics/{ => SFC_Models/Land}/sfc_land.F90 (100%) rename physics/{ => SFC_Models/Land}/sfc_land.meta (100%) diff --git a/physics/sfc_land.F90 b/physics/SFC_Models/Land/sfc_land.F90 similarity index 100% rename from physics/sfc_land.F90 rename to physics/SFC_Models/Land/sfc_land.F90 diff --git a/physics/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta similarity index 100% rename from physics/sfc_land.meta rename to physics/SFC_Models/Land/sfc_land.meta From 09b02350a7526f1eddc0885f8bcb26e9cac5c72d Mon Sep 17 00:00:00 2001 From: Ufuk Turuncoglu Date: Mon, 8 Jan 2024 11:55:57 -0600 Subject: [PATCH 136/249] fix meta file --- physics/SFC_Models/Land/sfc_land.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/SFC_Models/Land/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta index 493d2a70b..6a4bd8fbe 100644 --- a/physics/SFC_Models/Land/sfc_land.meta +++ b/physics/SFC_Models/Land/sfc_land.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = sfc_land type = scheme - dependencies = machine.F + dependencies = ../../hooks/machine.F ######################################################################## [ccpp-arg-table] From 18616d4344cda61f313086b483ccdc350bf1005e Mon Sep 17 00:00:00 2001 From: "anning.cheng" Date: Mon, 8 Jan 2024 17:06:43 -0500 Subject: [PATCH 137/249] established a branch for q MERRA2 bug fixed from RRFS --- physics/MP/Morrison_Gettelman/aerinterp.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/MP/Morrison_Gettelman/aerinterp.F90 b/physics/MP/Morrison_Gettelman/aerinterp.F90 index 4e2dc9047..fcfe29607 100644 --- a/physics/MP/Morrison_Gettelman/aerinterp.F90 +++ b/physics/MP/Morrison_Gettelman/aerinterp.F90 @@ -426,7 +426,7 @@ SUBROUTINE aerinterpol( me,master,nthrds,npts,IDATE,FHOUR,iflip, jindx1,jindx2, ENDDO else DO k=1, levsaer-1 !! from sfc to toa - IF(prsl(j,L) < aerpres(j,k) .and. prsl(j,L)>aerpres(j,k+1)) then + IF(prsl(j,L) <= aerpres(j,k) .and. prsl(j,L)>aerpres(j,k+1)) then i1 = k i2 = min(k+1,levsaer) exit From 952d62af87b36bd47dfe129e9a8fc5e6b94b388c Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Sun, 24 Dec 2023 21:52:12 -0700 Subject: [PATCH 138/249] zmtb, zlwb, and zogw are initialized to 0.0 to fix "intent(out) variables not given an explicit value" warning. The following table provides justification for setting the variable to 0, it is how they are treated in other places. | file | line | description | |--------------------+------+-----------------------------| | ugwpv1_gsldrag.F90 | 521 | zlwb(:)= 0. ; zogw(:)=0. | | ugwp_driver_v0.F | 206 | zmtb(i) = 0.0 | | cires_ugwp.F90 | 297 | if (do_ugwp) zlwb(:) = 0. | --- physics/GWD/unified_ugwp.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/physics/GWD/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 index 0bcbc4f62..0b649bd10 100644 --- a/physics/GWD/unified_ugwp.F90 +++ b/physics/GWD/unified_ugwp.F90 @@ -377,6 +377,10 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt errmsg = '' errflg = 0 + ! Initialize variables not being used + zmtb(:) = 0.0 + zlwb(:) = 0.0 + zogb(:) = 0.0 ! 1) ORO stationary GWs ! ------------------ From f18350846725c93f6e6221ba765c329a689b3781 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Sun, 24 Dec 2023 22:08:40 -0700 Subject: [PATCH 139/249] issue 1984 fix: "intent out variables not given a value" warning. The drain_cpl and dsnow_cpl vars are changed from intent(out) to intent(in) variables. This is to replicate the rain_cpl and snow_cpl variables. --- .../Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 | 4 ++-- .../UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) 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 5d321814c..de5312af7 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 @@ -87,8 +87,8 @@ subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot, real(kind=kind_phys), dimension(:), intent(inout) :: sigmaf, work3, zlvl ! Stochastic physics / surface perturbations - real(kind=kind_phys), dimension(:), intent(out) :: drain_cpl - real(kind=kind_phys), dimension(:), intent(out) :: dsnow_cpl + real(kind=kind_phys), dimension(:), intent(in) :: drain_cpl + real(kind=kind_phys), dimension(:), intent(in) :: dsnow_cpl real(kind=kind_phys), dimension(:), intent(in) :: rain_cpl real(kind=kind_phys), dimension(:), intent(in) :: snow_cpl integer, intent(in) :: lndp_type, n_var_lndp diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta index bbf7dd5c3..6221fbfda 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta @@ -297,7 +297,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = in [dsnow_cpl] standard_name = tendency_of_lwe_thickness_of_snowfall_amount_on_dynamics_timestep_for_coupling long_name = change in show_cpl (coupling_type) @@ -305,7 +305,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = in [rain_cpl] standard_name = cumulative_lwe_thickness_of_precipitation_amount_for_coupling long_name = total rain precipitation From ba7c62719debac58280c81b9e4161b0a870d0bf3 Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Tue, 26 Dec 2023 11:21:02 -0700 Subject: [PATCH 140/249] issue 1984 fix: initialize err_message to "" because they are intent(out) variables. Variable err_message will report any errors in open and read statements --- physics/photochem/module_ozphys.F90 | 41 ++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 12 deletions(-) diff --git a/physics/photochem/module_ozphys.F90 b/physics/photochem/module_ozphys.F90 index f824736b1..873a223b6 100644 --- a/physics/photochem/module_ozphys.F90 +++ b/physics/photochem/module_ozphys.F90 @@ -95,13 +95,18 @@ function load_o3prog(this, file, fileID) result (err_message) integer, intent(in) :: fileID character(len=*), intent(in) :: file character(len=128) :: err_message - integer :: i1, i2, i3 + integer :: i1, i2, i3, ierr real(kind=4), dimension(:), allocatable :: lat4, pres4, time4, tempin real(kind=4) :: blatc4 + ! initialize error message + err_message = "" + ! Get dimensions from data file - open(unit=fileID,file=trim(file), form='unformatted', convert='big_endian') - read (fileID) this%ncf, this%nlat, this%nlev, this%ntime + open(unit=fileID,file=trim(file), form='unformatted', convert='big_endian', iostat=ierr, iomsg=err_message) + if (ierr /= 0 ) return + read (fileID, iostat=ierr, iomsg=err_message) this%ncf, this%nlat, this%nlev, this%ntime + if (ierr /= 0 ) return rewind(fileID) allocate (this%lat(this%nlat)) @@ -111,7 +116,8 @@ function load_o3prog(this, file, fileID) result (err_message) allocate (this%data(this%nlat,this%nlev,this%ncf,this%ntime)) allocate(lat4(this%nlat), pres4(this%nlev), time4(this%ntime+1)) - read (fileID) this%ncf, this%nlat, this%nlev, this%ntime, lat4, pres4, time4 + read (fileID, iostat=ierr, iomsg=err_message) this%ncf, this%nlat, this%nlev, this%ntime, lat4, pres4, time4 + if (ierr /= 0 ) return ! Store this%pres(:) = pres4(:) @@ -124,7 +130,8 @@ function load_o3prog(this, file, fileID) result (err_message) do i1=1,this%ntime do i2=1,this%ncf do i3=1,this%nlev - read(fileID) tempin + read(fileID, iostat=ierr, iomsg=err_message) tempin + if (ierr /= 0 ) return this%data(:,i3,i2,i1) = tempin(:) enddo enddo @@ -520,12 +527,18 @@ function load_o3clim(this, file, fileID) result (err_message) ! Locals real(kind=4) :: blatc4 - integer :: iLev, iLat, imo + integer :: iLev, iLat, imo, ierr real(kind=4), allocatable :: o3clim4(:,:,:), pstr4(:) integer, allocatable :: imond(:), ilatt(:,:) - open(unit=fileID,file=trim(file), form='unformatted', convert='big_endian') - read (fileID,end=101) this%nlatc, this%nlevc, this%ntimec, blatc4 + ! initialize error message + err_message = "" + + open(unit=fileID,file=trim(file),form='unformatted',convert='big_endian', iostat=ierr, iomsg=err_message) + if (ierr /= 0 ) return + read (fileID,end=101,iostat=ierr,iomsg=err_message) this%nlatc, this%nlevc, this%ntimec, blatc4 + if (ierr /= 0 ) return + 101 if (this%nlevc < 10 .or. this%nlevc > 100) then rewind (fileID) this%nlevc = 17 @@ -545,15 +558,18 @@ function load_o3clim(this, file, fileID) result (err_message) allocate (this%pkstr(this%nlevc), this%pstr(this%nlevc), this%datac(this%nlatc,this%nlevc,12)) if ( this%nlevc == 17 ) then ! For the operational ozone climatology do iLev = 1, this%nlevc - read (fileID,15) pstr4(iLev) + read (fileID,15,iostat=ierr,iomsg=err_message) pstr4(iLev) + if (ierr /= 0 ) return 15 format(f10.3) enddo do imo = 1, 12 do iLat = 1, this%nlatc - read (fileID,16) imond(imo), ilatt(iLat,imo), (o3clim4(iLat,iLev,imo),iLev=1,10) + read (fileID,16,iostat=ierr,iomsg=err_message) imond(imo), ilatt(iLat,imo), (o3clim4(iLat,iLev,imo),iLev=1,10) + if (ierr /= 0 ) return 16 format(i2,i4,10f6.2) - read (fileID,20) (o3clim4(iLat,iLev,imo),iLev=11,this%nlevc) + read (fileID,20,iostat=ierr,iomsg=err_message) (o3clim4(iLat,iLev,imo),iLev=11,this%nlevc) + if (ierr /= 0 ) return 20 format(6x,10f6.2) enddo enddo @@ -565,7 +581,8 @@ function load_o3clim(this, file, fileID) result (err_message) do imo = 1, 12 do iLev = 1, this%nlevc - read (fileID) (o3clim4(iLat,iLev,imo),iLat=1,this%nlatc) + read (fileID,iostat=ierr,iomsg=err_message) (o3clim4(iLat,iLev,imo),iLat=1,this%nlatc) + if (ierr /= 0 ) return enddo enddo endif ! end if_this%nlevc_block From 65bf1d0fdb8593235f5dcfec2cf95b5e87a020fb Mon Sep 17 00:00:00 2001 From: Soren Rasmussen Date: Thu, 11 Jan 2024 12:36:56 -0700 Subject: [PATCH 141/249] Removing a few variables that are not used in the *_pre function --- .../GFS_surface_generic_pre.F90 | 7 +--- .../GFS_surface_generic_pre.meta | 32 ------------------- 2 files changed, 1 insertion(+), 38 deletions(-) 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 de5312af7..b85168a2d 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.F90 @@ -61,8 +61,7 @@ end subroutine GFS_surface_generic_pre_init !! subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot, ivegsrc, stype, scolor,vtype, slope, & prsik_1, prslk_1, tsfc, phil, con_g, sigmaf, work3, zlvl, & - drain_cpl, dsnow_cpl, rain_cpl, snow_cpl, lndp_type, n_var_lndp, sfc_wts, & - lndp_var_list, lndp_prt_list, & + lndp_type, n_var_lndp, sfc_wts, lndp_var_list, lndp_prt_list, & z01d, zt1d, bexp1d, xlai1d, vegf1d, lndp_vgf, & cplflx, flag_cice, islmsk_cice, slimskin_cpl, & wind, u1, v1, cnvwind, smcwlt2, smcref2, vtype_save, stype_save,scolor_save, slope_save, & @@ -87,10 +86,6 @@ subroutine GFS_surface_generic_pre_run (nthreads, im, levs, vfrac, islmsk, isot, real(kind=kind_phys), dimension(:), intent(inout) :: sigmaf, work3, zlvl ! Stochastic physics / surface perturbations - real(kind=kind_phys), dimension(:), intent(in) :: drain_cpl - real(kind=kind_phys), dimension(:), intent(in) :: dsnow_cpl - real(kind=kind_phys), dimension(:), intent(in) :: rain_cpl - real(kind=kind_phys), dimension(:), intent(in) :: snow_cpl 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 diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta index 6221fbfda..2b21c606d 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta @@ -290,38 +290,6 @@ type = real kind = kind_phys intent = inout -[drain_cpl] - standard_name = tendency_of_lwe_thickness_of_rain_amount_on_dynamics_timestep_for_coupling - long_name = change in rain_cpl (coupling_type) - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[dsnow_cpl] - standard_name = tendency_of_lwe_thickness_of_snowfall_amount_on_dynamics_timestep_for_coupling - long_name = change in show_cpl (coupling_type) - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[rain_cpl] - standard_name = cumulative_lwe_thickness_of_precipitation_amount_for_coupling - long_name = total rain precipitation - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in -[snow_cpl] - standard_name = cumulative_lwe_thickness_of_snow_amount_for_coupling - long_name = total snow precipitation - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = in [lndp_type] standard_name = control_for_stochastic_land_surface_perturbation long_name = index for stochastic land surface perturbations type From ea70fbdaa81c2ad4b8f1b7a7b7bd31fa9115fc52 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Wed, 17 Jan 2024 15:42:07 +0000 Subject: [PATCH 142/249] Make changes for consistent style. --- physics/SFC_Layer/UFS/sfc_diff.f | 17 ++++++++--------- physics/SFC_Layer/UFS/sfc_nst.f90 | 2 +- physics/SFC_Models/Ocean/UFS/sfc_ocean.F | 1 - 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/physics/SFC_Layer/UFS/sfc_diff.f b/physics/SFC_Layer/UFS/sfc_diff.f index f4a102c91..eb5bd7b5c 100644 --- a/physics/SFC_Layer/UFS/sfc_diff.f +++ b/physics/SFC_Layer/UFS/sfc_diff.f @@ -168,7 +168,6 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) errmsg = '' errflg = 0 - ! initialize variables. all units are supposedly m.k.s. unless specified ! ps is in pascals, wind is wind speed, ! surface roughness length is converted to m from cm @@ -282,11 +281,11 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), - & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, + & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & z0max, ztmax_lnd(i), tvs, grav, thsfc_loc, ! --- outputs: - & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), - & cm_lnd(i), ch_lnd(i), stress_lnd(i), ustar_lnd(i)) + & rb_lnd(i), fm_lnd(i), fh_lnd(i), fm10_lnd(i), fh2_lnd(i), + & cm_lnd(i), ch_lnd(i), stress_lnd(i), ustar_lnd(i)) endif ! Dry points if (icy(i)) then ! Some ice @@ -336,11 +335,11 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) ! call stability ! --- inputs: - & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), - & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, + & (z1(i), zvfun(i), gdx, tv1, thv1, wind(i), + & z0max, ztmax_ice(i), tvs, grav, thsfc_loc, ! --- outputs: - & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), - & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i)) + & rb_ice(i), fm_ice(i), fh_ice(i), fm10_ice(i), fh2_ice(i), + & cm_ice(i), ch_ice(i), stress_ice(i), ustar_ice(i)) endif ! Icy points ! BWG: Everything from here to end of subroutine was after diff --git a/physics/SFC_Layer/UFS/sfc_nst.f90 b/physics/SFC_Layer/UFS/sfc_nst.f90 index 1dd9d6117..9c3804211 100644 --- a/physics/SFC_Layer/UFS/sfc_nst.f90 +++ b/physics/SFC_Layer/UFS/sfc_nst.f90 @@ -27,7 +27,7 @@ module sfc_nst subroutine sfc_nst_run & ( im, hvap, cp, hfus, jcal, eps, epsm1, rvrdm1, rd, rhw0, & ! --- inputs: pi, tgice, sbc, ps, u1, v1, usfco, vsfco, icplocn2atm, t1, & - q1, tref, cm, ch, lseaspray, fm, fm10, & + q1, tref, cm, ch, lseaspray, fm, fm10, & prsl1, prslki, prsik1, prslk1, wet, use_lake_model, xlon, & sinlat, stress, & sfcemis, dlwflx, sfcnsw, rain, timestep, kdt, solhr,xcosz, & diff --git a/physics/SFC_Models/Ocean/UFS/sfc_ocean.F b/physics/SFC_Models/Ocean/UFS/sfc_ocean.F index 505476510..88d23a7aa 100644 --- a/physics/SFC_Models/Ocean/UFS/sfc_ocean.F +++ b/physics/SFC_Models/Ocean/UFS/sfc_ocean.F @@ -179,7 +179,6 @@ subroutine sfc_ocean_run & ! rho is density, qss is sat. hum. at surface if ( flag(i) ) then - if (use_med_flux) then q0(i) = max( q1(i), qmin ) rho(i) = prsl1(i) / (rd*t1(i)*(one + rvrdm1*q0(i))) From c9460205f6047047025536653e05675749b9d074 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Wed, 17 Jan 2024 15:54:26 +0000 Subject: [PATCH 143/249] fix NSSL MP init issue when initialized from other microphysics schemes --- physics/MP/NSSL/mp_nssl.F90 | 42 ++++++++++++++-- physics/MP/NSSL/mp_nssl.meta | 95 ++++++++++++++++++++++++++++++++++++ 2 files changed, 134 insertions(+), 3 deletions(-) diff --git a/physics/MP/NSSL/mp_nssl.F90 b/physics/MP/NSSL/mp_nssl.F90 index e79376709..ad1d41090 100644 --- a/physics/MP/NSSL/mp_nssl.F90 +++ b/physics/MP/NSSL/mp_nssl.F90 @@ -15,6 +15,7 @@ module mp_nssl private logical :: is_initialized = .False. + logical :: missing_vars_global = .False. real :: nssl_qccn contains @@ -26,7 +27,9 @@ module mp_nssl !! \htmlinclude mp_nssl_init.html !! subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & - mpirank, mpiroot, & + mpirank, mpiroot,mpicomm, & + qc, qr, qi, qs, qh, & + ccw, crw, cci, csw, chw, vh, & con_g, con_rd, con_cp, con_rv, & con_t0c, con_cliq, con_csol, con_eps, & imp_physics, imp_physics_nssl, & @@ -36,6 +39,9 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & use module_mp_nssl_2mom, only: nssl_2mom_init, nssl_2mom_init_const +#ifdef MPI + use mpi +#endif implicit none @@ -50,16 +56,32 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & integer, intent(in) :: mpirank integer, intent(in) :: mpiroot + integer, intent(in) :: mpicomm integer, intent(in) :: imp_physics integer, intent(in) :: imp_physics_nssl real(kind_phys), intent(in) :: nssl_cccn, nssl_alphah, nssl_alphahl real(kind_phys), intent(in) :: nssl_alphar, nssl_ehw0, nssl_ehlw0 logical, intent(in) :: nssl_ccn_on, nssl_hail_on, nssl_invertccn, nssl_3moment + 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) :: 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 + ! Local variables: dimensions used in nssl_init integer :: ims,ime, jms,jme, kms,kme, nx, nz, i,k real :: nssl_params(20) integer :: ihailv,ipc + real, parameter :: qmin = 1.e-12 + integer :: ierr + logical :: missing_vars = .False. ! Initialize the CCPP error handling variables @@ -143,6 +165,19 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & ! For restart runs, the init is done here if (restart) then + + ! For restart, check if the IC is from a different scheme that does not have all the needed variables + missing_vars = .False. + IF ( Any( qc > qmin .and. ccw == 0.0 ) ) missing_vars = .true. + IF ( .not. missing_vars .and. Any( qi > qmin .and. cci == 0.0 ) ) missing_vars = .true. + IF ( .not. missing_vars .and. Any( qs > qmin .and. csw == 0.0 ) ) missing_vars = .true. + IF ( .not. missing_vars .and. Any( qr > qmin .and. crw == 0.0 ) ) missing_vars = .true. + IF ( .not. missing_vars .and. Any( qh > qmin .and. (chw == 0.0 .or. vh == 0.0) ) ) missing_vars = .true. + +#ifdef MPI + call MPI_Allreduce(missing_vars, missing_vars_global, 1, MPI_LOGICAL, MPI_LOR, mpicomm, ierr) +#endif + is_initialized = .true. return end if @@ -319,6 +354,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & real :: cwmas real(kind_phys), allocatable :: an(:,:,:,:) ! temporary scalar array + errflg = 0 @@ -529,8 +565,8 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & dtptmp = dtp ntmul = 1 ENDIF - - IF ( first_time_step .and. .not. restart ) THEN + + IF ( first_time_step .and. ( .not. restart .or. missing_vars_global ) ) THEN itimestep = 0 ! gets incremented to 1 in call loop IF ( nssl_ccn_on ) THEN IF ( invertccn ) THEN diff --git a/physics/MP/NSSL/mp_nssl.meta b/physics/MP/NSSL/mp_nssl.meta index 1f2023ea9..8449f26cf 100644 --- a/physics/MP/NSSL/mp_nssl.meta +++ b/physics/MP/NSSL/mp_nssl.meta @@ -63,6 +63,101 @@ dimensions = () type = integer intent = in +[mpicomm] + standard_name = mpi_communicator + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in +[qc] + standard_name = cloud_liquid_water_mixing_ratio + long_name = cloud water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension ,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[qr] + standard_name = rain_mixing_ratio + long_name = rain water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[qi] + standard_name = cloud_ice_mixing_ratio + long_name = ice water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[qs] + standard_name = snow_mixing_ratio + long_name = snow water mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[qh] + standard_name = graupel_mixing_ratio + long_name = graupel mixing ratio wrt dry+vapor (no condensates) + units = kg kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[ccw] + standard_name = mass_number_concentration_of_cloud_liquid_water_particles_in_air + long_name = cloud droplet number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[crw] + standard_name = mass_number_concentration_of_rain_water_in_air + long_name = rain number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[cci] + standard_name = mass_number_concentration_of_cloud_ice_water_crystals_in_air + long_name = ice number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[csw] + standard_name = mass_number_concentration_of_snow_in_air + long_name = snow number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[chw] + standard_name = mass_number_concentration_of_graupel_in_air + long_name = graupel number concentration + units = kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout +[vh] + standard_name = graupel_volume + long_name = graupel particle volume + units = m3 kg-1 + dimensions = (horizontal_dimension,vertical_layer_dimension) + type = real + kind = kind_phys + intent = inout [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration From 97e3b1ce4e9721ae6cc361733842de53a061d7ed Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Thu, 18 Jan 2024 12:24:03 -0500 Subject: [PATCH 144/249] update surface physics z0 from waves --- physics/SFC_Layer/UFS/sfc_diff.f | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/physics/SFC_Layer/UFS/sfc_diff.f b/physics/SFC_Layer/UFS/sfc_diff.f index e1bf3c756..5dd6525f9 100644 --- a/physics/SFC_Layer/UFS/sfc_diff.f +++ b/physics/SFC_Layer/UFS/sfc_diff.f @@ -437,6 +437,18 @@ subroutine sfc_diff_run (im,rvrdm1,eps,epsm1,grav, & !intent(in) z0rl_wat(i) = 1.0e-4_kp endif + elseif (z0rl_wav(i) <= 1.0e-7_kp .or. + & z0rl_wav(i) > 1.0_kp) then +! z0 = (charnock / grav) * ustar_wat(i) * ustar_wat(i) + tem1 = 0.11 * vis / ustar_wat(i) + z0 = tem1 + (charnock/grav)*ustar_wat(i)*ustar_wat(i) + + if (redrag) then + z0rl_wat(i) = 100.0_kp * max(min(z0, z0s_max),1.0e-7_kp) + else + z0rl_wat(i) = 100.0_kp * max(min(z0,0.1_kp), 1.0e-7_kp) + endif + endif endif ! end of if(open ocean) From 02b3440378e5bb04ddc4ba50b44f2532eb7cab08 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Fri, 19 Jan 2024 18:24:37 +0000 Subject: [PATCH 145/249] "Supplementary physics updates for RRFS code freeze" --- physics/CONV/Grell_Freitas/cu_gf_deep.F90 | 5 +- physics/CONV/Grell_Freitas/cu_gf_driver.F90 | 8 +- physics/CONV/Grell_Freitas/cu_gf_driver.meta | 7 + physics/PBL/MYNN_EDMF/module_bl_mynn.F90 | 146 ++++++++---------- .../SFC_Models/Land/RUC/module_sf_ruclsm.F90 | 6 +- physics/smoke_dust/dep_dry_mod_emerson.F90 | 58 ++++--- physics/smoke_dust/dust_fengsha_mod.F90 | 11 +- physics/smoke_dust/module_add_emiss_burn.F90 | 75 +++++---- physics/smoke_dust/module_plumerise.F90 | 61 +++++--- physics/smoke_dust/module_smoke_plumerise.F90 | 40 ++--- physics/smoke_dust/module_wetdep_ls.F90 | 13 +- physics/smoke_dust/plume_data_mod.F90 | 51 ------ physics/smoke_dust/rrfs_smoke_config.F90 | 3 +- physics/smoke_dust/rrfs_smoke_postpbl.meta | 3 +- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 145 ++++++++++------- physics/smoke_dust/rrfs_smoke_wrapper.meta | 85 +++++++++- 16 files changed, 424 insertions(+), 293 deletions(-) delete mode 100755 physics/smoke_dust/plume_data_mod.F90 diff --git a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 index a1bca36c9..8a2c73600 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 @@ -142,13 +142,13 @@ subroutine cu_gf_deep_run( & !! betwee -1 and +1 ,do_capsuppress,cap_suppress_j & ! ,k22 & ! - ,jmin,tropics) ! + ,jmin,kdt,tropics) ! implicit none integer & ,intent (in ) :: & - nranflag,itf,ktf,its,ite, kts,kte,ipr,imid + nranflag,itf,ktf,its,ite, kts,kte,ipr,imid,kdt integer, intent (in ) :: & ichoice,nchem real(kind=kind_phys), dimension (its:ite,4) & @@ -591,6 +591,7 @@ subroutine cu_gf_deep_run( & sig(i)=(1.-frh)**2 !frh_out(i) = frh if(forcing(i,7).eq.0.)sig(i)=1. + if(kdt.le.(3600./dtime))sig(i)=1. frh_out(i) = frh*sig(i) enddo !$acc end kernels diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver.F90 index 92f8760b0..54a23ca74 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.F90 @@ -68,7 +68,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& dfi_radar_max_intervals,ldiag3d,qci_conv,do_cap_suppress, & maxupmf,maxMF,do_mynnedmf,ichoice_in,ichoicem_in,ichoice_s_in, & spp_cu_deep,spp_wts_cu_deep,nchem,chem3d,fscav,wetdpc_deep, & - do_smoke_transport,errmsg,errflg) + do_smoke_transport,kdt,errmsg,errflg) !------------------------------------------------------------- implicit none integer, parameter :: maxiens=1 @@ -95,7 +95,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& integer :: ishallow_g3 ! depend on imfshalcnv !------------------------------------------------------------- integer :: its,ite, jts,jte, kts,kte - integer, intent(in ) :: im,km,ntracer, nchem + integer, intent(in ) :: im,km,ntracer,nchem,kdt integer, intent(in ) :: ichoice_in,ichoicem_in,ichoice_s_in logical, intent(in ) :: flag_init, flag_restart, do_mynnedmf logical, intent(in ) :: flag_for_scnv_generic_tend,flag_for_dcnv_generic_tend @@ -766,7 +766,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ! betwee -1 and +1 ,do_cap_suppress_here,cap_suppress_j & ,k22m & - ,jminm,tropics) + ,jminm,kdt,tropics) !$acc kernels do i=its,itf do k=kts,ktf @@ -853,7 +853,7 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ! betwee -1 and +1 ,do_cap_suppress_here,cap_suppress_j & ,k22 & - ,jmin,tropics) + ,jmin,kdt,tropics) jpr=0 ipr=0 !$acc kernels diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.meta b/physics/CONV/Grell_Freitas/cu_gf_driver.meta index fe9b4c375..d0b661fd8 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.meta @@ -651,6 +651,13 @@ type = real kind = kind_phys intent = inout +[kdt] + standard_name = index_of_timestep + long_name = current forecast iteration + units = index + dimensions = () + type = integer + intent = in [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 b/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 index 6840f80bf..cc7a47ce6 100644 --- a/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 +++ b/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 @@ -2001,9 +2001,9 @@ SUBROUTINE mym_length ( & uonset= 15. wt_u = (1.0 - min(max(ugrid - uonset, 0.0)/30.0, 0.5)) cns = 2.7 !was 3.5 - alp1 = 0.22 + alp1 = 0.23 alp2 = 0.3 - alp3 = 2.0 * wt_u !taper off bouyancy enhancement in shear-driven pbls + alp3 = 2.5 * wt_u !taper off bouyancy enhancement in shear-driven pbls alp4 = 5.0 alp5 = 0.3 alp6 = 50. @@ -2059,12 +2059,12 @@ SUBROUTINE mym_length ( & ! ** Length scale limited by the buoyancy effect ** IF ( dtv(k) .GT. 0.0 ) THEN - bv = max( sqrt( gtr*dtv(k) ), 0.001) + bv = max( sqrt( gtr*dtv(k) ), 0.0001) elb = MAX(alp2*qkw(k), & & alp6*edmf_a1(k-1)*edmf_w1(k-1)) / bv & & *( 1.0 + alp3*SQRT( vsc/(bv*elt) ) ) elb = MIN(elb, zwk) - elf = 0.80 * qkw(k)/bv + elf = 1.0 * qkw(k)/bv elBLavg(k) = MAX(elBLavg(k), alp6*edmf_a1(k-1)*edmf_w1(k-1)/bv) ELSE elb = 1.0e10 @@ -2084,8 +2084,10 @@ SUBROUTINE mym_length ( & !add blending to use BouLac mixing length in free atmos; !defined relative to the PBLH (zi) + transition layer (h1) !el(k) = MIN(elb/( elb/elt+elb/els+1.0 ),elf) - !try squared-blending - el(k) = SQRT( els**2/(1. + (els**2/elt**2) +(els**2/elb**2))) + !try squared-blending - but take out elb (makes it underdiffusive) + !el(k) = SQRT( els**2/(1. + (els**2/elt**2) +(els**2/elb**2))) + el(k) = sqrt( els**2/(1. + (els**2/elt**2))) + el(k) = min(el(k), elb) el(k) = MIN (el(k), elf) el(k) = el(k)*(1.-wt) + alp5*elBLavg(k)*wt @@ -3633,13 +3635,13 @@ SUBROUTINE mym_condensation (kts,kte, & real(kind_phys):: qsl,esat,qsat,dqsl,cld0,q1k,qlk,eq1,qll, & &q2p,pt,rac,qt,t,xl,rsl,cpm,Fng,qww,alpha,beta,bb, & - &ls,wt,qpct,cld_factor,fac_damp,liq_frac,ql_ice,ql_water, & + &ls,wt,wt2,qpct,cld_factor,fac_damp,liq_frac,ql_ice,ql_water, & &qmq,qsat_tk,q1_rh,rh_hack,dzm1,zsl,maxqc real(kind_phys), parameter :: qpct_sfc=0.025 real(kind_phys), parameter :: qpct_pbl=0.030 real(kind_phys), parameter :: qpct_trp=0.040 real(kind_phys), parameter :: rhcrit =0.83 !for cloudpdf = 2 - real(kind_phys), parameter :: rhmax =1.01 !for cloudpdf = 2 + real(kind_phys), parameter :: rhmax =1.02 !for cloudpdf = 2 integer :: i,j,k real(kind_phys):: erf @@ -3864,25 +3866,18 @@ SUBROUTINE mym_condensation (kts,kte, & !Add condition for falling/settling into low-RH layers, so at least !some cloud fraction is applied for all qc, qs, and qi. rh_hack= rh(k) + wt2 = min(max( zagl - pblh2, 0.0 )/300., 1.0) !ensure adequate RH & q1 when qi is at least 1e-9 (above the PBLH) - if (qi(k)>1.e-9 .and. zagl .gt. pblh2) then - rh_hack =min(rhmax, rhcrit + 0.07*(9.0 + log10(qi(k)))) + if ((qi(k)+qs(k))>1.e-9 .and. (zagl .gt. pblh2)) then + rh_hack =min(rhmax, rhcrit + wt2*0.045*(9.0 + log10(qi(k)+qs(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 q1_rh =-3. + 3.*(rh(k)-rhcrit)/(1.-rhcrit) q1(k) =max(q1_rh, q1(k) ) endif - !ensure adequate RH & q1 when qc is at least 1e-6 - if (qc(k)>1.e-6) then - rh_hack =min(rhmax, rhcrit + 0.09*(6.0 + log10(qc(k)))) - rh(k) =max(rh(k), rh_hack) - !add rh-based q1 - q1_rh =-3. + 3.*(rh(k)-rhcrit)/(1.-rhcrit) - q1(k) =max(q1_rh, q1(k) ) - endif - !ensure adequate RH & q1 when qs is at least 1e-8 (above the PBLH) - if (qs(k)>1.e-8 .and. zagl .gt. pblh2) then - rh_hack =min(rhmax, rhcrit + 0.07*(8.0 + log10(qs(k)))) + !ensure adequate rh & q1 when qc is at least 1e-6 (above the PBLH) + if (qc(k)>1.e-6 .and. (zagl .gt. pblh2)) then + rh_hack =min(rhmax, rhcrit + wt2*0.08*(6.0 + log10(qc(k)))) rh(k) =max(rh(k), rh_hack) !add rh-based q1 q1_rh =-3. + 3.*(rh(k)-rhcrit)/(1.-rhcrit) @@ -3994,7 +3989,7 @@ SUBROUTINE mym_condensation (kts,kte, & fac_damp = min(zagl * 0.0025, 1.0) !cld_factor = 1.0 + fac_damp*MAX(0.0, ( RH(k) - 0.75 ) / 0.26 )**1.9 !HRRRv4 !cld_factor = 1.0 + fac_damp*min((max(0.0, ( RH(k) - 0.92 )) / 0.25 )**2, 0.3) - cld_factor = 1.0 + fac_damp*min((max(0.0, ( RH(k) - 0.92 )) / 0.145)**2, 0.35) + cld_factor = 1.0 + fac_damp*min((max(0.0, ( RH(k) - 0.92 )) / 0.145)**2, 0.37) cldfra_bl1D(K) = min( 1., cld_factor*cldfra_bl1D(K) ) enddo @@ -4181,38 +4176,33 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & k=kts -!original approach (drag in b-vector): -! a(1)=0. -! b(1)=1. + dtz(k)*(dfm(k+1)+ust**2/wspd) - 0.5*dtz(k)*s_aw(k+1)*onoff -! c(1)=-dtz(k)*dfm(k+1) - 0.5*dtz(k)*s_aw(k+1)*onoff -! d(1)=u(k) + dtz(k)*uoce*ust**2/wspd - dtz(k)*s_awu(k+1)*onoff + & -! sub_u(k)*delt + det_u(k)*delt - !rho-weighted (drag in b-vector): a(k)= -dtz(k)*kmdz(k)*rhoinv(k) - b(k)=1.+dtz(k)*(kmdz(k+1)+rhosfc*ust**2/wspd)*rhoinv(k) & - & - 0.5*dtz(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff + b(k)=1.+dtz(k)*(kmdz(k+1)+rhosfc*ust**2/wspd)*rhoinv(k) & + & - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff & + & - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) & - & - 0.5*dtz(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff - d(k)=u(k) + dtz(k)*uoce*ust**2/wspd - dtz(k)*s_awu(k+1)*onoff - & - & dtz(k)*rhoinv(k)*sd_awu(k+1)*onoff + sub_u(k)*delt + det_u(k)*delt - -!rho-weighted with drag term moved out of b-array -! a(k)= -dtz(k)*kmdz(k)*rhoinv(k) -! b(k)=1.+dtz(k)*(kmdz(k+1))*rhoinv(k) - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff -! c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff -! d(k)=u(k)*(1.-ust**2/wspd*dtz(k)*rhosfc/rho(k)) + dtz(k)*uoce*ust**2/wspd - & -! !!!d(k)=u(k)*(1.-ust**2/wspd*dtz(k)) + dtz(k)*uoce*ust**2/wspd - & -! & dtz(k)*rhoinv(k)*s_awu(k+1)*onoff - dtz(k)*rhoinv(k)*sd_awu(k+1)*onoff + sub_u(k)*delt + det_u(k)*delt - - DO k=kts+1,kte-1 - a(k)= -dtz(k)*kmdz(k)*rhoinv(k) + 0.5*dtz(k)*rhoinv(k)*s_aw(k)*onoff + 0.5*dtz(k)*rhoinv(k)*sd_aw(k)*onoff - b(k)=1.+dtz(k)*(kmdz(k)+kmdz(k+1))*rhoinv(k) + & - & 0.5*dtz(k)*rhoinv(k)*(s_aw(k)-s_aw(k+1))*onoff + 0.5*dtz(k)*rhoinv(k)*(sd_aw(k)-sd_aw(k+1))*onoff - c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff - d(k)=u(k) + dtz(k)*rhoinv(k)*(s_awu(k)-s_awu(k+1))*onoff + dtz(k)*rhoinv(k)*(sd_awu(k)-sd_awu(k+1))*onoff + & - & sub_u(k)*delt + det_u(k)*delt - ENDDO + & - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff & + & - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff + d(k)=u(k) + dtz(k)*uoce*ust**2/wspd & + & - dtz(k)*rhoinv(k)*s_awu(k+1)*onoff & + & + dtz(k)*rhoinv(k)*sd_awu(k+1)*onoff & + & + sub_u(k)*delt + det_u(k)*delt + + do k=kts+1,kte-1 + a(k)= -dtz(k)*kmdz(k)*rhoinv(k) & + & + 0.5*dtz(k)*rhoinv(k)*s_aw(k)*onoff & + & + 0.5*dtz(k)*rhoinv(k)*sd_aw(k)*onoff + b(k)=1.+ dtz(k)*(kmdz(k)+kmdz(k+1))*rhoinv(k) & + & + 0.5*dtz(k)*rhoinv(k)*(s_aw(k)-s_aw(k+1))*onoff & + & + 0.5*dtz(k)*rhoinv(k)*(sd_aw(k)-sd_aw(k+1))*onoff + c(k)= - dtz(k)*kmdz(k+1)*rhoinv(k) & + & - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff & + & - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff + d(k)=u(k) + dtz(k)*rhoinv(k)*(s_awu(k)-s_awu(k+1))*onoff & + & - dtz(k)*rhoinv(k)*(sd_awu(k)-sd_awu(k+1))*onoff & + & + sub_u(k)*delt + det_u(k)*delt + enddo !! no flux at the top ! a(kte)=-1. @@ -4247,37 +4237,33 @@ SUBROUTINE mynn_tendencies(kts,kte,i, & k=kts -!original approach (drag in b-vector): -! a(1)=0. -! b(1)=1. + dtz(k)*(dfm(k+1)+ust**2/wspd) - 0.5*dtz(k)*s_aw(k+1)*onoff -! c(1)= - dtz(k)*dfm(k+1) - 0.5*dtz(k)*s_aw(k+1)*onoff -! d(1)=v(k) + dtz(k)*voce*ust**2/wspd - dtz(k)*s_awv(k+1)*onoff + & -! sub_v(k)*delt + det_v(k)*delt - !rho-weighted (drag in b-vector): a(k)= -dtz(k)*kmdz(k)*rhoinv(k) - b(k)=1.+dtz(k)*(kmdz(k+1) + rhosfc*ust**2/wspd)*rhoinv(k) & - & - 0.5*dtz(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff - c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) - 0.5*dtz(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff - d(k)=v(k) + dtz(k)*voce*ust**2/wspd - dtz(k)*s_awv(k+1)*onoff - dtz(k)*rhoinv(k)*sd_awv(k+1)*onoff + & - & sub_v(k)*delt + det_v(k)*delt - -!rho-weighted with drag term moved out of b-array -! a(k)= -dtz(k)*kmdz(k)*rhoinv(k) -! b(k)=1.+dtz(k)*(kmdz(k+1))*rhoinv(k) - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff -! c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff -! d(k)=v(k)*(1.-ust**2/wspd*dtz(k)*rhosfc/rho(k)) + dtz(k)*voce*ust**2/wspd - & -! !!!d(k)=v(k)*(1.-ust**2/wspd*dtz(k)) + dtz(k)*voce*ust**2/wspd - & -! & dtz(k)*rhoinv(k)*s_awv(k+1)*onoff - dtz(k)*rhoinv(k)*sd_awv(k+1)*onoff + sub_v(k)*delt + det_v(k)*delt - - DO k=kts+1,kte-1 - a(k)= -dtz(k)*kmdz(k)*rhoinv(k) + 0.5*dtz(k)*rhoinv(k)*s_aw(k)*onoff + 0.5*dtz(k)*rhoinv(k)*sd_aw(k)*onoff - b(k)=1.+dtz(k)*(kmdz(k)+kmdz(k+1))*rhoinv(k) + & - & 0.5*dtz(k)*rhoinv(k)*(s_aw(k)-s_aw(k+1))*onoff + 0.5*dtz(k)*rhoinv(k)*(sd_aw(k)-sd_aw(k+1))*onoff - c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff - d(k)=v(k) + dtz(k)*rhoinv(k)*(s_awv(k)-s_awv(k+1))*onoff + dtz(k)*rhoinv(k)*(sd_awv(k)-sd_awv(k+1))*onoff + & - & sub_v(k)*delt + det_v(k)*delt - ENDDO + b(k)=1.+dtz(k)*(kmdz(k+1) + rhosfc*ust**2/wspd)*rhoinv(k) & + & - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff & + & - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff + c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) & + & - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff & + & - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff + d(k)=v(k) + dtz(k)*voce*ust**2/wspd & + & - dtz(k)*rhoinv(k)*s_awv(k+1)*onoff & + & + dtz(k)*rhoinv(k)*sd_awv(k+1)*onoff & + & + sub_v(k)*delt + det_v(k)*delt + + do k=kts+1,kte-1 + a(k)= -dtz(k)*kmdz(k)*rhoinv(k) & + & + 0.5*dtz(k)*rhoinv(k)*s_aw(k)*onoff & + & + 0.5*dtz(k)*rhoinv(k)*sd_aw(k)*onoff + b(k)=1.+dtz(k)*(kmdz(k)+kmdz(k+1))*rhoinv(k) & + & + 0.5*dtz(k)*rhoinv(k)*(s_aw(k)-s_aw(k+1))*onoff & + & + 0.5*dtz(k)*rhoinv(k)*(sd_aw(k)-sd_aw(k+1))*onoff + c(k)= -dtz(k)*kmdz(k+1)*rhoinv(k) & + & - 0.5*dtz(k)*rhoinv(k)*s_aw(k+1)*onoff & + & - 0.5*dtz(k)*rhoinv(k)*sd_aw(k+1)*onoff + d(k)=v(k) + dtz(k)*rhoinv(k)*(s_awv(k)-s_awv(k+1))*onoff & + & - dtz(k)*rhoinv(k)*(sd_awv(k)-sd_awv(k+1))*onoff & + & + sub_v(k)*delt + det_v(k)*delt + enddo !! no flux at the top ! a(kte)=-1. diff --git a/physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90 b/physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90 index b15592052..2d01f96c9 100644 --- a/physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90 +++ b/physics/SFC_Models/Land/RUC/module_sf_ruclsm.F90 @@ -1687,7 +1687,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia endif if(newsn > zero ) then - SNOWFRACnewsn=MIN(one,SNHEI/SNHEI_CRIT_newsn) + SNOWFRACnewsn=MIN(one,snowfallac*1.e-3_kind_phys/SNHEI_CRIT_newsn) endif !-- due to steep slopes and blown snow, limit snow fraction in the @@ -1700,7 +1700,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia if(snowfrac < 0.75_kind_phys) snow_mosaic = one KEEP_SNOW_ALBEDO = zero - IF (NEWSN > zero .and. snowfracnewsn > 0.99_kind_phys .and. rhosnfall < 450._kind_phys) THEN + IF (snowfracnewsn > 0.99_kind_phys .and. rhosnfall < 450._kind_phys) THEN ! new snow KEEP_SNOW_ALBEDO = one ! turn off separate treatment of snow covered and snow-free portions of the grid cell @@ -1735,7 +1735,7 @@ SUBROUTINE SFCTMP (debug_print, delt,ktau,conflx,i,j, & !--- input varia ! hwlps with these biases.. if( snow_mosaic == one) then ALBsn=alb_snow - if(newsn > zero .and. KEEP_SNOW_ALBEDO > 0.9_kind_phys .and. albsn < 0.4_kind_phys) then + if(KEEP_SNOW_ALBEDO > 0.9_kind_phys .and. albsn < 0.4_kind_phys) then !-- Albedo correction with fresh snow and deep snow pack !-- will reduce warm bias in western Canada !-- and US West coast, where max snow albedo is low (0.3-0.5). diff --git a/physics/smoke_dust/dep_dry_mod_emerson.F90 b/physics/smoke_dust/dep_dry_mod_emerson.F90 index 76fdc2411..771801c44 100755 --- a/physics/smoke_dust/dep_dry_mod_emerson.F90 +++ b/physics/smoke_dust/dep_dry_mod_emerson.F90 @@ -9,7 +9,7 @@ module dep_dry_emerson_mod use machine , only : kind_phys use dep_data_mod ! JLS - use rrfs_smoke_config, only : num_chem, p_smoke, p_dust_1, p_coarse_pm + use rrfs_smoke_config, only : num_chem, p_smoke, p_dust_1, p_coarse_pm, n_dbg_lines implicit none @@ -23,7 +23,7 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & settling_flag,drydep_flux,settling_flux,dbg_opt, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) + its,ite, jts,jte, kts,kte, curr_secs, mpiid, xlat, xlong ) ! ! compute dry deposition velocity for aerosol particles ! Based on Emerson et al. (2020), PNAS, @@ -37,6 +37,9 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte + + REAL(kind_phys) :: curr_secs + REAL(kind_phys), DIMENSION( ims:ime , jms:jme ) , & INTENT(IN) :: ustar, rmol, znt, snowh REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), & @@ -80,6 +83,9 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & real(kind_phys), dimension( kts:kte, ndvel ) :: cblk_col, vg_col integer, dimension(ndvel) :: ndt_settl integer :: i, j, k, ntdt, nv + integer :: icall=0 + integer, INTENT(IN) :: mpiid + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: xlat,xlong ! chem pointers (p_*) are not sequentially numbered, need to define so nv loops work integer, dimension(ndvel) :: chem_pointers !> -- Gas constant @@ -87,11 +93,15 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & chem_pointers(1) = p_smoke chem_pointers(2) = p_dust_1 chem_pointers(3) = p_coarse_pm - + growth_fac = 1.0 conver=1.e-9 converi=1.e9 + if (mod(int(curr_secs),1800) .eq. 0) then + icall = 0 + endif + do j = jts, jte do i = its, ite aer_res(i,j) = 0.0 @@ -116,7 +126,7 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & aer_res(i,j) = max(aer_res(i,j)/100._kind_phys,0._kind_phys) ! Air kinematic viscosity (cm^2/s) airkinvisc = ( 1.8325e-4 * ( 416.16 / ( t_phy(i,k,j) + 120.0 ) ) * & - ( ( t_phy(i,k,j) / 296.16 )**1.5 ) ) / ( rho_phy(i,k,j) / 28.966e3 ) ! Convert density to mol/cm^3 + ( ( t_phy(i,k,j) / 296.16 )**1.5 ) ) / ( rho_phy(i,k,j) / 1.e3 ) ! Convert density to mol/cm^3 ! Air molecular freepath (cm) ! Check against XLM from above freepath = 7.39758e-4 * airkinvisc / sqrt( t_phy(i,k,j) ) do nv = 1, ndvel @@ -141,11 +151,11 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & amu_corrected = amu / Cc ! Gravitational Settling vg = aerodens * dp * dp * gravity * 100. * Cc / & ! Convert gravity to cm/s^2 - ( 18. * airkinvisc * ( rho_phy(i,k,j) / 28.966e3 ) ) ! Convert density to mol/cm^3 + ( 18. * airkinvisc * ( rho_phy(i,k,j) / 1.e3 ) ) ! Convert density to mol/cm^3 ! -- Rest of loop for the surface when deposition velocity needs to be cacluated if ( k == kts ) then ! Brownian Diffusion - DDp = ( boltzmann * t_phy(i,k,j) ) * Cc / (3. * pi * airkinvisc * ( rho_phy(i,k,j) / 28.966e3 ) * dp) ! Convert density to mol/cm^3 + DDp = ( boltzmann * t_phy(i,k,j) ) * Cc / (3. * pi * airkinvisc * ( rho_phy(i,k,j) / 1.e3 ) * dp) ! Convert density to mol/cm^3 ! Schmit number Sc = airkinvisc / DDp ! Brownian Diffusion @@ -179,13 +189,17 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & Rs = 1. / ( ( ustar(i,j) * 100.) * ( Eb + Eim + Ein) * eps0 ) ! Convert ustar to cm/s ! Compute final ddvel = aer_res + RS, set max at max_dep_vel in dep_data_mod.F[ m/s] ! The /100. term converts from cm/s to m/s, required for MYNN. - ddvel(i,j,nv) = min( (1. / (aer_res(i,j) + Rs ))/100., max_dep_vel) - if ( dbg_opt ) then - WRITE(6,*) 'dry_dep_mod_emerson: i,j,nv',i,j,nv - WRITE(6,*) 'dry_dep_mod_emerson: deposition velocity (m/s) ',ddvel(i,j,nv) + if ( settling_flag == 1 ) then + ddvel(i,j,nv) = max(min( ( vg + 1./(aer_res(i,j)+Rs) )/100., max_dep_vel),0._kind_phys) + else + ddvel(i,j,nv) = max(min( ( 1./(aer_res(i,j)+Rs) )/100., max_dep_vel),0._kind_phys) endif - drydep_flux(i,j,nv) = chem(i,kts,j,chem_pointers(nv))*p_phy(i,kts,j) / & - (RSI*t_phy(i,kts,j))*ddvel(i,j,nv)*dt*1.E-6 + if ( dbg_opt .and. (icall .le. n_dbg_lines) ) then + WRITE(1000+mpiid,*) 'dry_dep_mod_emer:xlat,xlong,curr_secs,nv',xlat(i,j),xlong(i,j),int(curr_secs),nv + WRITE(1000+mpiid,*) 'dry_dep_mod_emer:xlat,xlong,curr_secs,deposition velocity (m/s)',xlat(i,j),xlong(i,j),int(curr_secs),ddvel(i,j,nv) + icall = icall + 1 + endif + drydep_flux(i,j,nv) = chem(i,kts,j,chem_pointers(nv))*rho_phy(i,k,j)*ddvel(i,j,nv)/100.0*dt endif ! k == kts vgrav(i,k,j,nv) = vg ! Fill column variables @@ -220,25 +234,25 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & IF (ndt_settl(nv) > 12) ndt_settl(nv) = 12 dt_settl(nv) = REAL(ntdt,kind=kind_phys) /REAL(ndt_settl(nv),kind=kind_phys) enddo - do nv = 1, ndvel - chem_before(nv) = 0._kind_phys - do k = kts, kte - chem_before(nv) = chem_before(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 - enddo - enddo + !do nv = 1, ndvel + ! chem_before(nv) = 0._kind_phys + ! do k = kts, kte + ! chem_before(nv) = chem_before(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 + ! enddo + !enddo ! Perform gravitational settling if desired if ( settling_flag == 1 ) then call particle_settling(cblk_col,rho_col,delz_col,vg_col,dt_settl,ndt_settl,ndvel,kts,kte) endif ! Put cblk back into chem array do nv= 1, ndvel - chem_after(nv) = 0._kind_phys - settling_flux(i,j,nv) = 0._kind_phys + !chem_after(nv) = 0._kind_phys + !settling_flux(i,j,nv) = 0._kind_phys do k = kts, kte chem(i,k,j,chem_pointers(nv)) = cblk_col(k,nv) - chem_after(nv) = chem_after(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 + !chem_after(nv) = chem_after(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 enddo ! k - settling_flux(i,j,nv) = settling_flux(i,j,nv) + (chem_before(nv) - chem_after(nv)) ! ug/m2 + !settling_flux(i,j,nv) = settling_flux(i,j,nv) + (chem_before(nv) - chem_after(nv)) ! ug/m2 enddo ! nv end do ! j end do ! i diff --git a/physics/smoke_dust/dust_fengsha_mod.F90 b/physics/smoke_dust/dust_fengsha_mod.F90 index 54e66712d..6ec8f8d4a 100755 --- a/physics/smoke_dust/dust_fengsha_mod.F90 +++ b/physics/smoke_dust/dust_fengsha_mod.F90 @@ -21,8 +21,8 @@ module dust_fengsha_mod contains subroutine gocart_dust_fengsha_driver(dt, & - chem,rho_phy,smois,p8w,ssm, & - isltyp,snowh,xland,area,g,emis_dust, & + chem,rho_phy,smois,stemp,p8w,ssm, & + isltyp,snowh,xland,area,g,emis_dust, & ust,znt,clay,sand,rdrag,uthr, & num_emis_dust,num_chem,num_soil_layers, & ids,ide, jds,jde, kds,kde, & @@ -54,7 +54,7 @@ subroutine gocart_dust_fengsha_driver(dt, & REAL(kind_phys), DIMENSION( ims:ime , kms:kme , jms:jme ), INTENT(IN) :: rho_phy REAL(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), INTENT(INOUT) :: chem REAL(kind_phys), DIMENSION( ims:ime, 1, jms:jme,num_emis_dust),OPTIONAL, INTENT(INOUT) :: emis_dust - REAL(kind_phys), DIMENSION( ims:ime, num_soil_layers, jms:jme ), INTENT(IN) :: smois + REAL(kind_phys), DIMENSION( ims:ime, num_soil_layers, jms:jme ), INTENT(IN) :: smois, stemp !0d input variables REAL(kind_phys), INTENT(IN) :: dt ! time step @@ -146,6 +146,11 @@ subroutine gocart_dust_fengsha_driver(dt, & ilwi = 0 endif + ! Don't emit over frozen soil + if (stemp(i,1,j) < 268.0) then ! -5C + ilwi = 0 + endif + ! Do not allow areas with bedrock, lava, or land-ice to loft IF (isltyp(i,j) .eq. 15 .or. isltyp(i,j) .eq. 16. .or. & diff --git a/physics/smoke_dust/module_add_emiss_burn.F90 b/physics/smoke_dust/module_add_emiss_burn.F90 index 95005b973..0a22fcfd7 100755 --- a/physics/smoke_dust/module_add_emiss_burn.F90 +++ b/physics/smoke_dust/module_add_emiss_burn.F90 @@ -9,11 +9,11 @@ module module_add_emiss_burn subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & chem,julday,gmt,xlat,xlong, & fire_end_hr, peak_hr,time_int, & - coef_bb_dc, fhist, hwp, hwp_prevd, & + coef_bb_dc, fire_hist, hwp, hwp_prevd, & swdown,ebb_dcycle, ebu_in, ebu,fire_type,& ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) + its,ite, jts,jte, kts,kte,mpiid ) IMPLICIT NONE @@ -22,6 +22,7 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte + INTEGER, INTENT(IN) :: mpiid real(kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_chem ), & INTENT(INOUT ) :: chem ! shall we set num_chem=1 here? @@ -29,7 +30,7 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & INTENT(INOUT ) :: ebu real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: xlat,xlong, swdown - real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: hwp, peak_hr, fire_end_hr, ebu_in !, vfrac + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: hwp, peak_hr, fire_end_hr, ebu_in !RAR: Shall we make fire_end integer? real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: coef_bb_dc ! RAR: real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: hwp_prevd @@ -38,17 +39,17 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & real(kind_phys), INTENT(IN) :: time_int,pi ! RAR: time in seconds since start of simulation INTEGER, DIMENSION(ims:ime,jms:jme), INTENT(IN) :: fire_type integer, INTENT(IN) :: ebb_dcycle ! RAR: this is going to be namelist dependent, ebb_dcycle=means - real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: fhist + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(INOUT) :: fire_hist !>--local integer :: i,j,k,n,m + integer :: icall=0 real(kind_phys) :: conv_rho, conv, dm_smoke, dc_hwp, dc_gp, dc_fn !daero_num_wfa, daero_num_ifa !, lu_sum1_5, lu_sum12_14 INTEGER, PARAMETER :: kfire_max=51 ! max vertical level for BB plume rise - ! real, parameter :: cx = 2.184936 * 3600., rinti = 2.1813936e-8 , ax = 2000.6038 - ! bx_bburn = 20.041288 * 3600., RAR: this depends on the vegetation class, location (local time) etc. real(kind_phys) :: timeq, fire_age, age_hr, dt1,dt2,dtm ! For BB emis. diurnal cycle calculation - ! For Gaussian diurnal cycle + +! For Gaussian diurnal cycle real(kind_phys), PARAMETER :: sc_factor=1. ! to scale up the wildfire emissions, TBD later real(kind_phys), PARAMETER :: rinti=2.1813936e-8, ax2=3400., const2=130., & coef2=10.6712963e-4, cx2=7200., timeq_max=3600.*24. @@ -90,32 +91,39 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & ! Constants for the fire diurnal cycle calculation do j=jts,jte do i=its,ite - fire_age= time_int + (fire_end_hr(i,j))*3600. + fire_age= time_int + (fire_end_hr(i,j)-1._kind_phys)*3600._kind_phys !One hour delay is due to the latency of the RAVE files + fire_age= MAX(0._kind_phys,fire_age) SELECT CASE ( fire_type(i,j) ) !Ag, urban fires, bare land etc. CASE (1) ! these fires will have exponentially decreasing diurnal cycle, - ! We assume 1hr latency in ingesting the sat. data - coef_bb_dc(i,j) = 1._kind_phys/((2*pi)**0.5_kind_phys * sigma_fire_dur(1) *fire_age) * & - exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2*sigma_fire_dur(1)**2 )) + coef_bb_dc(i,j) = 1._kind_phys/((2._kind_phys*pi)**0.5_kind_phys * sigma_fire_dur(1) *fire_age) * & + exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2._kind_phys*sigma_fire_dur(1)**2 )) + + ! IF ( dbg_opt .AND. time_int<5000.) then + ! WRITE(6,*) 'i,j,peak_hr(i,j) ',i,j,peak_hr(i,j) + ! WRITE(6,*) 'coef_bb_dc(i,j) ',coef_bb_dc(i,j) + ! END IF + CASE (3) age_hr= fire_age/3600._kind_phys - IF (swdown(i,j)<.1 .AND. age_hr> 12. .AND. fhist(i,j)>0.75) THEN - fhist(i,j)= 0.75_kind_phys + IF (swdown(i,j)<.1 .AND. age_hr> 12. .AND. fire_hist(i,j)>0.75) THEN + fire_hist(i,j)= 0.75_kind_phys ENDIF - IF (swdown(i,j)<.1 .AND. age_hr> 24. .AND. fhist(i,j)>0.5) THEN - fhist(i,j)= 0.5_kind_phys + IF (swdown(i,j)<.1 .AND. age_hr> 24. .AND. fire_hist(i,j)>0.5) THEN + fire_hist(i,j)= 0.5_kind_phys ENDIF - IF (swdown(i,j)<.1 .AND. age_hr> 48. .AND. fhist(i,j)>0.25) THEN - fhist(i,j)= 0.25_kind_phys + IF (swdown(i,j)<.1 .AND. age_hr> 48. .AND. fire_hist(i,j)>0.25) THEN + fire_hist(i,j)= 0.25_kind_phys ENDIF ! this is based on hwp, hourly or instantenous TBD - dc_hwp= ebu_in(i,j)* hwp(i,j)/ MAX(1._kind_phys,hwp_prevd(i,j)) + dc_hwp= hwp(i,j)/ MAX(5._kind_phys,hwp_prevd(i,j)) dc_hwp= MAX(0._kind_phys,dc_hwp) + dc_hwp= MIN(25._kind_phys,dc_hwp) - !coef_bb_dc(i,j)= sc_factor* fhist(i,j)* rate_ebb2(i,j)* (1. + log( + !coef_bb_dc(i,j)= sc_factor* fire_hist(i,j)* rate_ebb2(i,j)* (1. + log( !hwp_(i,j)/ hwp_day_avg(i,j))) ! RAR: Gaussian profile for wildfires @@ -125,17 +133,30 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & dc_gp = rinti*( ax2 * exp(- dtm**2/(2._kind_phys*cx2**2) ) + const2 - coef2*timeq ) dc_gp = MAX(0._kind_phys,dc_gp) - dc_fn = MAX(dc_hwp/dc_gp,3._kind_phys) - coef_bb_dc(i,j) = fhist(i,j)* dc_fn + dc_fn = MIN(dc_hwp/dc_gp,3._kind_phys) + !coef_bb_dc(i,j) = fire_hist(i,j)* dc_fn + coef_bb_dc(i,j) = fire_hist(i,j)* dc_hwp + + ! IF ( dbg_opt .AND. time_int<5000.) then + ! WRITE(6,*) 'i,j,fire_hist(i,j),peak_hr(i,j) ', i,j,fire_hist(i,j),peak_hr(i,j) + ! WRITE(6,*) 'dc_gp,dc_hwp,dc_fn,coef_bb_dc(i,j) ',dc_gp,dc_hwp,dc_fn,coef_bb_dc(i,j) + ! END IF + CASE DEFAULT END SELECT enddo enddo endif + if (mod(int(time_int),1800) .eq. 0) then + icall = 0 + endif + do j=jts,jte do i=its,ite do k=kts,kfire_max + if (ebu(i,k,j)<0.001_kind_phys) cycle + if (ebb_dcycle==1) then conv= dtstep/(rho_phy(i,k,j)* dz8w(i,k,j)) elseif (ebb_dcycle==2) then @@ -143,14 +164,14 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & endif dm_smoke= conv*ebu(i,k,j) chem(i,k,j,p_smoke) = chem(i,k,j,p_smoke) + dm_smoke - chem(i,k,j,p_smoke) = MIN(chem(i,k,j,p_smoke),5.e+3) + chem(i,k,j,p_smoke) = MIN(MAX(chem(i,k,j,p_smoke),0._kind_phys),5.e+3_kind_phys) - if ( dbg_opt .and. (k==kts .OR. k==kfire_max) ) then - WRITE(6,*) 'add_emiss_burn: i,j,k ',i,j,k - WRITE(6,*) 'add_emiss_burn: rho_phy(i,k,j),dz8w(i,k,j),conv',rho_phy(i,k,j),dz8w(i,k,j),conv - WRITE(6,*) 'add_emiss_burn: ebu(i,k,j),dm_smoke ', ebu(i,k,j),dm_smoke - endif + if ( dbg_opt .and. (k==kts .OR. k==kfire_max) .and. (icall .le. n_dbg_lines) ) then + WRITE(1000+mpiid,*) 'add_emiss_burn:xlat,xlong,curr_secs,fire_type,fire_hist,peak_hr', xlat(i,j),xlong(i,j),int(time_int),fire_type(i,j),fire_hist(i,j),peak_hr(i,j) + WRITE(1000+mpiid,*) 'add_emiss_burn:xlat,xlong,curr_secs,coef_bb_dc,ebu',xlat(i,j),xlong(i,j),int(time_int),coef_bb_dc(i,j),ebu(i,k,j) + endif enddo + icall = icall + 1 enddo enddo diff --git a/physics/smoke_dust/module_plumerise.F90 b/physics/smoke_dust/module_plumerise.F90 index 8a1d6ab25..5f7ef2a0e 100755 --- a/physics/smoke_dust/module_plumerise.F90 +++ b/physics/smoke_dust/module_plumerise.F90 @@ -24,10 +24,11 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & kpbl_thetav, & ! SRB: added kpbl_thetav ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte, errmsg, errflg) + its,ite, jts,jte, kts,kte, errmsg, errflg,curr_secs, & + xlat, xlong , uspdavg2, hpbl_thetav2, mpiid) use rrfs_smoke_config - use plume_data_mod + !use plume_data_mod USE module_zero_plumegen_coms USE module_smoke_plumerise IMPLICIT NONE @@ -40,6 +41,8 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & real(kind=kind_phys), DIMENSION( ims:ime, jms:jme), INTENT(IN ) :: frp_inst ! RAR: FRP array + real(kind_phys), DIMENSION(ims:ime,jms:jme), INTENT(IN) :: xlat,xlong ! SRB + real(kind_phys), DIMENSION(ims:ime, jms:jme), INTENT(IN) :: kpbl_thetav ! SRB character(*), intent(inout) :: errmsg @@ -47,6 +50,7 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte + real(kind_phys) :: curr_secs INTEGER, INTENT(IN ) :: wind_eff_opt real(kind=kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT ) :: ebu real(kind=kind_phys), INTENT(IN ) :: g, con_cp, con_rd @@ -57,23 +61,32 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & ! Local variables... INTEGER :: nv, i, j, k, kp1, kp2 + INTEGER :: icall=0 INTEGER, DIMENSION(ims:ime, jms:jme), INTENT (OUT) :: k_min, k_max ! Min and max ver. levels for BB injection spread + REAL, DIMENSION(ims:ime, jms:jme), INTENT (OUT) :: uspdavg2, hpbl_thetav2 ! SRB real(kind_phys), dimension (kte) :: u_in ,v_in ,w_in ,theta_in ,pi_in, rho_phyin ,qv_in ,zmid, z_lev, uspd ! SRB real(kind=kind_phys) :: dz_plume, cpor, con_rocp, uspdavg ! SRB +! MPI variables + INTEGER, INTENT(IN) :: mpiid + cpor =con_cp/con_rd con_rocp=con_rd/con_cp - IF ( dbg_opt ) then - WRITE(*,*) 'module_plumerise: its,ite,jts,jte ', its,ite,jts,jte - WRITE(*,*) 'module_plumerise: ims,ime,jms,jme ', ims,ime,jms,jme - WRITE(*,*) 'module_plumerise: maxval(ebu(:,kts,:)) ', maxval(ebu(:,kts,:)) + if (mod(int(curr_secs),1800) .eq. 0) then + icall = 0 + endif + + IF ( dbg_opt .and. icall .le. n_dbg_lines) then + WRITE(1000+mpiid,*) 'module_plumerise: its,ite,jts,jte ', its,ite,jts,jte + WRITE(1000+mpiid,*) 'module_plumerise: ims,ime,jms,jme ', ims,ime,jms,jme + WRITE(1000+mpiid,*) 'module_plumerise: maxval(ebu(:,kts,:)) ', maxval(ebu(:,kts,:)) END IF ! RAR: setting to zero the ebu emissions at the levels k>1, this is necessary when the plumerise is called, so the emissions at k>1 are updated !do nv=1,num_ebu do j=jts,jte - do k=kts+1,kte + do k=kts,kte do i=its,ite ebu(i,k,j)=0. enddo @@ -112,12 +125,10 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & uspd(k)= wind_phy(i,k,j) ! SRB enddo - IF (dbg_opt) then - WRITE(*,*) 'module_plumerise: i,j ',i,j - WRITE(*,*) 'module_plumerise: frp_inst(i,j) ',frp_inst(i,j) - WRITE(*,*) 'module_plumerise: ebu(i,kts,j) ',ebu(i,kts,j) - WRITE(*,*) 'module_plumerise: u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) ',u_in(10),v_in(10),w_in(kte),qv_in(10),pi_in(10) - WRITE(*,*) 'module_plumerise: zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) ',zmid(kte),z_lev(kte),rho_phyin(kte),theta_in(kte) + + IF (dbg_opt .and. (icall .le. n_dbg_lines) .and. (frp_inst(i,j) .ge. frp_threshold) ) then + WRITE(1000+mpiid,*) 'module_plumerise_before:xlat,xlong,curr_secs,ebu(kts),frp_inst',xlat(i,j), xlong(i,j), int(curr_secs),ebu(i,kts,j),frp_inst(i,j) + WRITE(1000+mpiid,*) 'module_plumerise_before:xlat,xlong,curr_secs,u(10),v(10),w(10),qv(10)',xlat(i,j), xlong(i,j),int(curr_secs), u_in(10),v_in(10),w_in(kte),qv_in(10) END IF ! RAR: the plume rise calculation step: @@ -127,7 +138,8 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & wind_eff_opt, & frp_inst(i,j), k_min(i,j), & k_max(i,j), dbg_opt, g, con_cp, & - con_rd, cpor, errmsg, errflg ) + con_rd, cpor, errmsg, errflg, & + icall, mpiid, xlat(i,j), xlong(i,j), curr_secs ) if(errflg/=0) return kp1= k_min(i,j) @@ -136,9 +148,13 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & ! SRB: Adding condition for overwriting plumerise levels uspdavg=SUM(uspd(kts:kpbl_thetav(i,j)))/kpbl_thetav(i,j) !Average wind speed within the boundary layer + +! SRB: Adding output + uspdavg2(i,j) = uspdavg + hpbl_thetav2(i,j) = z_lev(kpbl_thetav(i,j)) IF ((frp_inst(i,j) .gt. frp_threshold) .AND. (frp_inst(i,j) .le. frp_threshold500) .AND. & - (z_at_w(i,kpbl_thetav(i,j),j) .gt. zpbl_threshold) .AND. (wind_eff_opt .eq. 1)) THEN + (z_lev(kpbl_thetav(i,j)) .gt. zpbl_threshold) .AND. (wind_eff_opt .eq. 1)) THEN kp1=1 IF (uspdavg .ge. uspd_threshold) THEN ! Too windy kp2=kpbl_thetav(i,j)/3 @@ -157,11 +173,18 @@ subroutine ebu_driver ( flam_frac,ebu_in,ebu, & END IF ! SRB: End modification - IF ( dbg_opt ) then - WRITE(*,*) 'module_plumerise: i,j ',i,j - WRITE(*,*) 'module_plumerise: k_min(i,j), k_max(i,j) ',kp1, kp2 ! SRB: replaced k_min, k_max with kp1, kp2 + IF ( dbg_opt .and. (icall .le. n_dbg_lines) .and. (frp_inst(i,j) .ge. frp_threshold) ) then + WRITE(1000+mpiid,*) 'mod_plumerise_after:xlat,xlong,curr_secs,k_min(i,j), k_max(i,j) ',xlat(i,j),xlong(i,j),int(curr_secs),kp1,kp2 + WRITE(1000+mpiid,*) 'mod_plumerise_after:xlat,xlong,curr_secs,ebu(kts),frp_inst',xlat(i,j),xlong(i,j),int(curr_secs),ebu(i,kts,j),frp_inst(i,j) + WRITE(1000+mpiid,*) 'mod_plumerise_after:xlat,xlong,curr_secs,u(10),v(10),w(10),qv(10)',xlat(i,j),xlong(i,j),int(curr_secs),u_in(10),v_in(10),w_in(kte),qv_in(10) + WRITE(1000+mpiid,*) 'mod_plumerise_after:xlat,xlong,curr_secs,uspdavg,kpbl_thetav',xlat(i,j),xlong(i,j),int(curr_secs),uspdavg,kpbl_thetav(i,j) + IF ( frp_inst(i,j) .ge. 3.e+9 ) then + WRITE(1000+mpiid,*) 'mod_plumerise_after:High FRP at : xlat,xlong,curr_secs,frp_inst',xlat(i,j),xlong(i,j),int(curr_secs),frp_inst(i,j) + END IF + icall = icall + 1 END IF -! endif check_frp +! endif check_frp +! icall = icall + 1 enddo enddo diff --git a/physics/smoke_dust/module_smoke_plumerise.F90 b/physics/smoke_dust/module_smoke_plumerise.F90 index 0fca91de4..aa45890f4 100755 --- a/physics/smoke_dust/module_smoke_plumerise.F90 +++ b/physics/smoke_dust/module_smoke_plumerise.F90 @@ -14,10 +14,11 @@ module module_smoke_plumerise use machine , only : kind_phys - use plume_data_mod, only : num_frp_plume, p_frp_hr, p_frp_std + !use plume_data_mod, only : num_frp_plume, p_frp_hr, p_frp_std !tropical_forest, boreal_forest, savannah, grassland, & ! wind_eff USE module_zero_plumegen_coms + USE rrfs_smoke_config, only : n_dbg_lines !real(kind=kind_phys),parameter :: rgas=r_d !real(kind=kind_phys),parameter :: cpor=cp/r_d @@ -28,12 +29,13 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & up,vp,wp,theta,pp,dn0,rv,zt_rams,zm_rams, & wind_eff_opt, & frp_inst,k1,k2, dbg_opt, g, cp, rgas, & - cpor, errmsg, errflg ) + cpor, errmsg, errflg, icall, mpiid, lat, long, curr_secs ) implicit none LOGICAL, INTENT (IN) :: dbg_opt - INTEGER, INTENT (IN) :: wind_eff_opt + INTEGER, INTENT (IN) :: wind_eff_opt, mpiid + real(kind_phys), INTENT(IN) :: lat,long, curr_secs ! SRB ! INTEGER, PARAMETER :: ihr_frp=1, istd_frp=2!, imean_fsize=3, istd_fsize=4 ! RAR: @@ -70,7 +72,7 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & ! real(kind=kind_phys), dimension(nveg_agreg) :: firesize,mean_fct INTEGER :: wind_eff - + INTEGER, INTENT(IN) :: icall type(plumegen_coms), pointer :: coms ! Set wind effect from namelist @@ -162,19 +164,11 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & endif burnt_area= max(1.0e4,burnt_area) - IF (dbg_opt) THEN - WRITE(*,*) 'plumerise: m1 ', m1 - WRITE(*,*) 'plumerise: imm, FRP,burnt_area ', imm, FRP,burnt_area - ! WRITE(*,*) 'convert_smold_to_flam ',convert_smold_to_flam - WRITE(*,*) 'plumerise: zcon ', coms%zcon - WRITE(*,*) 'plumerise: zzcon ', coms%zzcon - END IF - - IF (dbg_opt) then - WRITE(*,*) 'plumerise: imm ', imm - WRITE(*,*) 'plumerise: burnt_area ',burnt_area - END IF - + IF ( dbg_opt .and. (icall .le. n_dbg_lines) .and. (frp_inst .ge. frp_threshold) ) THEN + WRITE(1000+mpiid,*) 'inside plumerise: xlat,xlong,curr_secs, m1 ', lat,long, int(curr_secs), m1 + WRITE(1000+mpiid,*) 'inside plumerise: xlat,xlong,curr_secs,imm,FRP,burnt_area ', lat, long, int(curr_secs), imm, FRP,burnt_area + END IF + !- get fire properties (burned area, plume radius, heating rates ...) call get_fire_properties(coms,imm,iveg_ag,burnt_area,FRP,errmsg,errflg) if(errflg/=0) return @@ -182,8 +176,8 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & !------ generates the plume rise ------ call makeplume (coms,kmt,ztopmax(imm),ixx,imm) - IF (dbg_opt) then - WRITE(*,*) 'plumerise after makeplume: imm,kmt,ztopmax(imm) ',imm,kmt,ztopmax(imm) + IF ( dbg_opt .and. (icall .le. n_dbg_lines) .and. (frp_inst .ge. frp_threshold) ) then + WRITE(1000+mpiid,*) 'inside plumerise after makeplume:xlat,xlong,curr_secs,imm,kmt,ztopmax(imm) ', lat, long, int(curr_secs), imm,kmt, ztopmax(imm) END IF enddo lp_minmax @@ -203,12 +197,12 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & ! enddo !enddo - IF (dbg_opt) then - WRITE(*,*) 'plumerise after set_flam_vert: nkp,k1,k2, ', nkp,k1,k2 - WRITE(*,*) 'plumerise after set_flam_vert: dzi ', dzi + !IF (dbg_opt) then + ! WRITE(*,*) 'plumerise after set_flam_vert: nkp,k1,k2, ', nkp,k1,k2 + ! WRITE(*,*) 'plumerise after set_flam_vert: dzi ', dzi !WRITE(*,*) 'plumerise after set_flam_vert: eburn_in(2) ', eburn_in(2) !WRITE(*,*) 'plumerise after set_flam_vert: eburn_out(:,2) ',eburn_out(:,2) - END IF + !END IF ! enddo lp_veg ! sub-grid vegetation, currently it's aggregated diff --git a/physics/smoke_dust/module_wetdep_ls.F90 b/physics/smoke_dust/module_wetdep_ls.F90 index 8ba8f67d9..2ef07e38c 100755 --- a/physics/smoke_dust/module_wetdep_ls.F90 +++ b/physics/smoke_dust/module_wetdep_ls.F90 @@ -31,11 +31,18 @@ subroutine wetdep_ls(dt,var,rain,moist, real(kind_phys) :: dvar,factor,clsum integer :: nv,i,j,k,km,kb,kbeg !real(kind_phys), parameter :: alpha = .5 ! scavenging factor + integer, save :: print_alpha = 0 wetdpr_smoke =0. wetdpr_dust =0. wetdpr_coarsepm=0. + !if ( print_alpha == 0 ) then + ! write(*,*) 'wetdep_ls, alpha = ',alpha + ! print_alpha = print_alpha + 1 + !endif + + do nv=1,nchem do i=its,ite do j=jts,jte @@ -76,11 +83,11 @@ subroutine wetdep_ls(dt,var,rain,moist, dvar=alpha*factor/(1+factor)*var(i,k,j,nv) ! Accumulate diags if (nv .eq. p_smoke ) then - wetdpr_smoke(i,j) = wetdpr_smoke(i,j) + dvar * rho(i,k,j) * dt * 1.E-6 + wetdpr_smoke(i,j) = wetdpr_smoke(i,j) + dvar * rho(i,k,j) / dt elseif (nv .eq. p_dust_1 ) then - wetdpr_dust(i,j) = wetdpr_dust(i,j) + dvar * rho(i,k,j) * dt * 1.E-6 + wetdpr_dust(i,j) = wetdpr_dust(i,j) + dvar * rho(i,k,j) / dt elseif (nv .eq. p_coarse_pm ) then - wetdpr_coarsepm(i,j) = wetdpr_coarsepm(i,j) + dvar * rho(i,k,j) * dt * 1.E-6 + wetdpr_coarsepm(i,j) = wetdpr_coarsepm(i,j) + dvar * rho(i,k,j) / dt endif var(i,k,j,nv)=max(1.e-16,var(i,k,j,nv)-dvar) endif diff --git a/physics/smoke_dust/plume_data_mod.F90 b/physics/smoke_dust/plume_data_mod.F90 deleted file mode 100755 index 3f0bcdecd..000000000 --- a/physics/smoke_dust/plume_data_mod.F90 +++ /dev/null @@ -1,51 +0,0 @@ -!>\file plume_data_mod.F90 -!! This file contains data for the fire plume rise module. - -module plume_data_mod - - use machine , only : kind_phys - - implicit none - - ! -- FRP parameters - integer, dimension(0:20), parameter :: & - catb = (/ & - 0, & - 2, 1, 2, 1, & !floresta tropical 2 and 4 / extra trop fores 1,3,5 - 2, 3, 3, 3, 3, & !cerrado/woody savanna :6 a 9 - 4, 4, 4, 4, 4, 0, 4, 0, 0, 0, 0 & !pastagem/lavouras: 10 ... - /) - - real(kind=kind_phys), dimension(0:4), parameter :: & - flaming = (/ & - 0.00, & ! - 0.45, & ! % biomass burned at flaming phase : tropical forest igbp 2 and 4 - 0.45, & ! % biomass burned at flaming phase : extratropical forest igbp 1 , 3 and 5 - 0.75, & ! % biomass burned at flaming phase : cerrado/woody savanna igbp 6 to 9 - 0.00 & ! % biomass burned at flaming phase : pastagem/lavoura: igbp 10 a 17 - /) - - real(kind=kind_phys), dimension(0:20), parameter :: & - msize= (/ & - 0.00021, & !0near water,1Evergreen needleleaf,2EvergreenBroadleaf,!3Deciduous Needleleaf,4Deciduous Broadleaf - 0.00021, 0.00021, 0.00021, 0.00021, & !5Mixed forest,6Closed shrublands,7Open shrublands,8Woody savannas,9Savannas, - 0.00023, 0.00022, 0.00022, 0.00022, 0.00029, &! 10Grassland,11Permanent wetlands,12cropland,13'Urban and Built-Up' - 0.00029, 0.00021, 0.00026, 0.00021, 0.00026, &!14cropland/natural vegetation mosaic,15Snow and ice,16Barren or sparsely vegetated - 0.00021, 0.00021, 0.00021, 0.00021, 0.00021, 0.00021 & !17Water,18Wooded Tundra,19Mixed Tundra,20Bare Ground Tundra - /) - - ! -- FRP buffer indices - integer, parameter :: p_frp_hr = 1 - integer, parameter :: p_frp_std = 2 - integer, parameter :: num_frp_plume = 2 - - ! -- plumerise parameters - integer, parameter :: tropical_forest = 1 - integer, parameter :: boreal_forest = 2 - integer, parameter :: savannah = 3 - integer, parameter :: grassland = 4 - integer, parameter :: nveg_agreg = 4 - - public - -end module plume_data_mod diff --git a/physics/smoke_dust/rrfs_smoke_config.F90 b/physics/smoke_dust/rrfs_smoke_config.F90 index d7478986b..dae4338bb 100755 --- a/physics/smoke_dust/rrfs_smoke_config.F90 +++ b/physics/smoke_dust/rrfs_smoke_config.F90 @@ -24,6 +24,7 @@ module rrfs_smoke_config integer :: addsmoke_flag = 1 integer :: smoke_forecast = 1 integer :: plumerisefire_frq=60 + integer :: n_dbg_lines = 3 integer :: wetdep_ls_opt = 1 integer :: drydep_opt = 1 integer :: pm_settling = 1 @@ -39,7 +40,7 @@ module rrfs_smoke_config ! -- integer, parameter :: CHEM_OPT_GOCART= 1 - integer, parameter :: num_moist=2, num_chem=20, num_emis_seas=5, num_emis_dust=5 + integer, parameter :: num_moist=3, num_chem=20, num_emis_seas=5, num_emis_dust=5 ! -- hydrometeors integer, parameter :: p_qv=1 diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.meta b/physics/smoke_dust/rrfs_smoke_postpbl.meta index 50fbb4e03..8d7481ec4 100755 --- a/physics/smoke_dust/rrfs_smoke_postpbl.meta +++ b/physics/smoke_dust/rrfs_smoke_postpbl.meta @@ -1,8 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_postpbl type = scheme - dependencies = ../hooks/machine.F,dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,dep_dry_mod_emerson.F90,dep_data_mod.F90 - + dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,dep_dry_mod_emerson.F90,dep_data_mod.F90 ######################################################################## [ccpp-arg-table] name = rrfs_smoke_postpbl_run diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index eb7f83af6..4daad7168 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -12,7 +12,7 @@ module rrfs_smoke_wrapper ebb_dcycle, extended_sd_diags,add_fire_heat_flux, & num_moist, num_chem, num_emis_seas, num_emis_dust, & p_qv, p_atm_shum, p_atm_cldq, & - p_smoke, p_dust_1, p_coarse_pm, epsilc + p_smoke, p_dust_1, p_coarse_pm, epsilc, n_dbg_lines use dust_data_mod, only : dust_alpha, dust_gamma, dust_moist_opt, & dust_moist_correction, dust_drylimit_factor use seas_mod, only : gocart_seasalt_driver @@ -52,7 +52,7 @@ subroutine rrfs_smoke_wrapper_init( seas_opt_in, dust_moist_correction_in, dust_drylimit_factor_in, & ! Dust namelist aero_ind_fdb_in, & ! Feedback namelist extended_sd_diags_in,dbg_opt_in, & ! Other namelist - errmsg, errflg ) + errmsg, errflg, n_dbg_lines_in ) !>-- Namelist @@ -62,7 +62,7 @@ subroutine rrfs_smoke_wrapper_init( seas_opt_in, integer, intent(in) :: dust_opt_in,dust_moist_opt_in, wetdep_ls_opt_in, pm_settling_in, seas_opt_in integer, intent(in) :: drydep_opt_in logical, intent(in) :: aero_ind_fdb_in,dbg_opt_in, extended_sd_diags_in, add_fire_heat_flux_in - integer, intent(in) :: smoke_forecast_in, plume_wind_eff_in, plumerisefire_frq_in + integer, intent(in) :: smoke_forecast_in, plume_wind_eff_in, plumerisefire_frq_in, n_dbg_lines_in integer, intent(in) :: addsmoke_flag_in, ebb_dcycle_in logical, intent(in) :: do_plumerise_in, rrfs_sd character(len=*),intent(out):: errmsg @@ -100,6 +100,7 @@ subroutine rrfs_smoke_wrapper_init( seas_opt_in, !>-Other extended_sd_diags = extended_sd_diags_in dbg_opt = dbg_opt_in + n_dbg_lines = n_dbg_lines_in end subroutine rrfs_smoke_wrapper_init @@ -111,17 +112,19 @@ end subroutine rrfs_smoke_wrapper_init subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, & u10m, v10m, ustar, rlat, rlon, tskin, pb2d, t2m, dpt2m, & pr3d, ph3d,phl3d, prl3d, tk3d, us3d, vs3d, spechum, w, & - nsoil, smc, vegtype_dom, vegtype_frac, soiltyp, nlcat, & + nsoil, smc, tslb, vegtype_dom, vegtype_frac, soiltyp, nlcat, & dswsfc, zorl, snow, julian,recmol, & idat, rain_cpl, rainc_cpl, hf2d, g, pi, con_cp, con_rd, con_fv, & dust12m_in, emi_ant_in, smoke_RRFS, smoke2d_RRFS, & ntrac, qgrs, gq0, chem3d, tile_num, & ntsmoke, ntdust, ntcoarsepm, imp_physics, imp_physics_thompson, & nwfa, nifa, emanoc, emdust, emseas, drydep_flux_out, wetdpr, & - ebb_smoke_in, frp_output, coef_bb, ebu_smoke,fhist,min_fplume, & + ebb_smoke_in, frp_output, coef_bb, fire_type_out, & + ebu_smoke,fhist,min_fplume, & max_fplume, hwp, hwp_ave, wetness, ndvel, ddvel_inout,fire_in, & + peak_hr_out,lu_nofire_out,lu_qfire_out, & fire_heat_flux_out, frac_grid_burned_out, kpbl,oro, & - errmsg,errflg ) + uspdavg, hpbl_thetav, mpicomm, mpirank, mpiroot, errmsg,errflg ) implicit none @@ -135,7 +138,7 @@ 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 + 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 @@ -153,14 +156,16 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, real(kind_phys), dimension(:,:), intent(inout) :: ebu_smoke real(kind_phys), dimension(:,:), intent(inout) :: fire_in real(kind_phys), dimension(:), intent(out) :: fire_heat_flux_out, frac_grid_burned_out - real(kind_phys), dimension(:), intent(inout) :: max_fplume, min_fplume - real(kind_phys), dimension(:), intent( out) :: hwp + 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 integer, intent(in) :: imp_physics, imp_physics_thompson integer, dimension(:), intent(in) :: kpbl real(kind_phys), dimension(:), intent(in) :: oro @@ -187,16 +192,17 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, real(kind_phys), dimension(ims:im, jms:jme) :: ssm, rdrag, uthr, snowh ! fengsha dust real(kind_phys), dimension(ims:im, jms:jme) :: rmol, swdown, znt, clayf, sandf real(kind_phys), dimension(ims:im, nlcat, jms:jme) :: vegfrac - real(kind_phys), dimension(ims:im, nsoil, jms:jme) :: smois + real(kind_phys), dimension(ims:im, nsoil, jms:jme) :: smois, stemp real(kind_phys), dimension(ims:im, 1:1, jms:jme, 1:num_emis_dust) :: emis_dust integer, dimension(ims:im, jms:jme) :: isltyp, ivgtyp !>- plume variables ! -- buffers real(kind_phys), dimension(ims:im, jms:jme ) :: coef_bb_dc, flam_frac, frp_in, & fire_hist, peak_hr, lu_nofire, lu_qfire, ebu_in, & - fire_end_hr, hwp_day_avg, kpbl_thetav + fire_end_hr, hwp_day_avg, kpbl_thetav,& + uspdavg2, hpbl_thetav2 integer, dimension(ims:im, jms:jme ) :: min_fplume2, max_fplume2, fire_type - logical :: call_plume, reset_hwp_ave + logical :: call_plume, reset_hwp_ave, avg_hwp_ave !>- optical variables real(kind_phys), dimension(ims:im, jms:jme, ndvel) :: ddvel, settling_flux, drydep_flux_local real(kind_phys), dimension(ims:im, kms:kme, jms:jme, ndvel) :: vgrav @@ -218,6 +224,13 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, real(kind_phys) :: factor, factor2, factor3 integer :: nbegin, nv integer :: i, j, k, kp, n +! MPI variables + integer :: mpiid + integer, intent(in) :: mpicomm + integer, intent(in) :: mpirank + integer, intent(in) :: mpiroot + + mpiid = mpirank errmsg = '' errflg = 0 @@ -232,6 +245,8 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, min_fplume2 = 0 max_fplume2 = 0 + uspdavg2 = 0. + hpbl_thetav2 = 0. emis_seas = 0. emis_dust = 0. peak_hr = 0. @@ -260,12 +275,17 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ! -- compute incremental convective and large-scale rainfall do i=its,ite rnav(i,1)=max((rain_cpl(i)-rainc_cpl(i))*1000., 0.) ! meter to mm +! coef_bb initializes as clear_val (from GFS_typedefs.F90) +! at ktau = 1, coef_bb_dc is set = 1.0 coef_bb_dc(i,1) = coef_bb(i) +! fhist initializes as 1. (from GFS_typedefs.F90) fire_hist (i,1) = fhist (i) + peak_hr (i,1) = peak_hr_out(i) enddo ! Is this a reset timestep (00:00 + dt)? reset_hwp_ave = mod(int(curr_secs-dt),3600) == 0 + avg_hwp_ave = mod(int(curr_secs),3600) == 0 ! plumerise frequency in minutes set up by the namelist input call_plume = (do_plumerise .and. (plumerisefire_frq > 0)) @@ -276,7 +296,8 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ktau,current_month, current_hour, gmt, con_rd, con_fv, con_cp, & u10m,v10m,ustar,land,garea,rlat,rlon,tskin, & pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,w, & - nsoil,smc,vegtype_dom,soiltyp,nlcat,vegtype_frac,dswsfc,zorl, & + nsoil,smc,tslb,vegtype_dom,soiltyp, & + nlcat,vegtype_frac,dswsfc,zorl, & snow,dust12m_in,emi_ant_in,smoke_RRFS,smoke2d_RRFS,coef_bb_dc, & hf2d, pb2d, g, pi, hour_int, peak_hr, & u10,v10,ust,tsk,xland,xlat,xlong,dxy, & @@ -287,20 +308,14 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, num_chem,num_moist, & ntsmoke, ntdust,ntcoarsepm, & moist,chem,ebu_in,kpbl_thetav,ebb_smoke_in, & - fhist,frp_in, hwp_day_avg, fire_end_hr, & - emis_anoc,smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & - snowh,clayf,rdrag,sandf,ssm,uthr,oro, hwp_local, & + fire_hist,frp_in, hwp_day_avg, fire_end_hr, & + emis_anoc,smois,stemp,ivgtyp,isltyp,vegfrac,rmol,swdown,znt, & + hfx,pbl,snowh,clayf,rdrag,sandf,ssm,uthr,oro, hwp_local, & t2m,dpt2m,wetness,kpbl, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) - do j=jts,jte - do i=its,ite - peak_hr(i,j)= fire_in(i,1) - enddo - enddo - IF (ktau==1) THEN ebu = 0. do j=jts,jte @@ -311,6 +326,13 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, enddo enddo enddo + ELSE + do k=kts,kte + do i=its,ite + ! ebu is divided by coef_bb_dc since it is applied in the output + ebu(i,k,1)=ebu_smoke(i,k) / coef_bb_dc(i,1) + enddo + enddo ENDIF !RAR: change this to the fractional LU type; fire_type: 0- no fires, 1- Ag @@ -320,6 +342,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, do i=its,ite if (ebu_in(i,j)<0.01) then fire_type(i,j) = 0 + lu_nofire(i,j) = 1.0 else ! Permanent wetlands, snow/ice, water, barren tundra lu_nofire(i,j) = vegfrac(i,11,j) + vegfrac(i,15,j) + vegfrac(i,17,j) + vegfrac(i,20,j) @@ -350,9 +373,10 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, endif !-- compute dust (opt=5) - if (dust_opt==5) then - call gocart_dust_fengsha_driver(dt,chem,rho_phy,smois,p8w,ssm, & - isltyp,snowh,xland,dxy,g,emis_dust,ust,znt, & + if (dust_opt==1) then + call gocart_dust_fengsha_driver(dt,chem,rho_phy, & + smois,stemp,p8w,ssm, & + isltyp,snowh,xland,dxy,g,emis_dust,ust,znt, & clayf,sandf,rdrag,uthr, & num_emis_dust,num_chem,nsoil, & ids,ide, jds,jde, kds,kde, & @@ -367,6 +391,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ! Every hour (per namelist) the ebu_driver is called to calculate ebu, but ! the plumerise is controlled by the namelist option of plumerise_flag if (add_fire_heat_flux) then + WRITE(1000+mpiid,*) 'Entered add_fire_heat_flux at timestep:',ktau do i = its,ite if ( coef_bb_dc(i,1)*frp_in(i,1) .ge. 1.E7 ) then fire_heat_flux_out(i) = min(max(0.,0.88*coef_bb_dc(i,1)*frp_in(i,1) / & @@ -396,7 +421,8 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, kpbl_thetav, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte, errmsg, errflg ) + its,ite, jts,jte, kts,kte, errmsg, errflg, curr_secs, & + xlat, xlong, uspdavg2, hpbl_thetav2, mpiid ) if(errflg/=0) return end if @@ -409,7 +435,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, swdown,ebb_dcycle,ebu_in,ebu,fire_type, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) + its,ite, jts,jte, kts,kte , mpiid ) endif !>-- compute coarsepm setting if using simple dry dep option and @@ -431,7 +457,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, pm_settling,drydep_flux_local,settling_flux,dbg_opt, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & - its,ite, jts,jte, kts,kte ) + its,ite, jts,jte, kts,kte, curr_secs, mpiid, xlat, xlong ) do nv=1,ndvel do i=its,ite ddvel_inout(i,nv)=ddvel(i,1,nv) @@ -470,10 +496,12 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, endif endif -! Smoke emisisons diagnostic +! Smoke emisisons diagnostic, RAR: let's multiply by coef_bb_dc before output +! Since ebu_smoke includes coef_bb_dc, we need to divide by coef_bb_dc when it +! comes back into the wrapper. do k=kts,kte do i=its,ite - ebu_smoke(i,k)=ebu(i,k,1) + ebu_smoke(i,k)=ebu(i,k,1) * coef_bb_dc(i,1) enddo enddo @@ -485,15 +513,21 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, do i=its,ite hwp(i)=hwp_local(i,1) hwp_ave(i) = hwp_ave(i) + hwp(i)*dt + if ( ktau == 1) then + hwp_ave(i) = hwp_ave(i) / dt + elseif ( avg_hwp_ave ) then + hwp_ave(i) = hwp_ave(i) / 3600._kind_phys + endif enddo - + + !---- diagnostic output of dry deposition & gravitational settling fluxes if ( drydep_opt == 1 .and. (extended_sd_diags .or. dbg_opt) ) then do nv = 1, ndvel do i=its,ite drydep_flux_out(i,nv) = drydep_flux_out(i,nv) + & - drydep_flux_local(i,1,nv) + & - settling_flux(i,1,nv) + drydep_flux_local(i,1,nv) !+ & + !settling_flux(i,1,nv) enddo enddo endif @@ -520,6 +554,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !------------------------------------- !-- to output for diagnostics do i = 1, im +! RAR: let's remove the seas and ant. OC emseas (i) = emis_seas(i,1,1,1)*1.e+9 ! size bin 1 sea salt emission: ug/m2/s emanoc (i) = emis_anoc (i) ! anthropogenic organic carbon: ug/m2/s emdust (i) = emis_dust(i,1,1,1) + emis_dust(i,1,1,2) + & @@ -529,10 +564,13 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, fhist (i) = fire_hist (i,1) min_fplume (i) = real(min_fplume2(i,1)) max_fplume (i) = real(max_fplume2(i,1)) + fire_type_out(i)=fire_type(i,1) + lu_nofire_out(i)=lu_nofire(i,1) + lu_qfire_out (i)=lu_qfire(i,1) enddo do i = 1, im - fire_in(i,1) = peak_hr(i,1) + peak_hr_out(i) = peak_hr(i,1) enddo !-- to provide real aerosol emission for Thompson MP @@ -568,7 +606,7 @@ subroutine rrfs_smoke_prep( & ktau,current_month,current_hour,gmt,con_rd,con_fv,con_cp, & u10m,v10m,ustar,land,garea,rlat,rlon,ts2d, & pr3d,ph3d,phl3d,tk3d,prl3d,us3d,vs3d,spechum,w, & - nsoil,smc,vegtype_dom,soiltyp,nlcat,vegtype_frac,dswsfc,zorl, & + nsoil,smc,tslb,vegtype_dom,soiltyp,nlcat,vegtype_frac,dswsfc,zorl, & snow_cpl,dust12m_in,emi_ant_in,smoke_RRFS,smoke2d_RRFS,coef_bb_dc, & hf2d, pb2d, g, pi, hour_int, peak_hr, & u10,v10,ust,tsk,xland,xlat,xlong,dxy, & @@ -579,9 +617,9 @@ subroutine rrfs_smoke_prep( & num_chem, num_moist, & ntsmoke, ntdust, ntcoarsepm, & moist,chem,ebu_in,kpbl_thetav,ebb_smoke_in, & - fhist,frp_in, hwp_day_avg, fire_end_hr, & - emis_anoc,smois,ivgtyp,isltyp,vegfrac,rmol,swdown,znt,hfx,pbl, & - snowh,clayf,rdrag,sandf,ssm,uthr,oro,hwp_local, & + fire_hist,frp_in, hwp_day_avg, fire_end_hr, & + emis_anoc,smois,stemp,ivgtyp,isltyp,vegfrac,rmol,swdown, & + znt,hfx,pbl,snowh,clayf,rdrag,sandf,ssm,uthr,oro,hwp_local, & t2m,dpt2m,wetness,kpbl, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & @@ -599,7 +637,7 @@ subroutine rrfs_smoke_prep( & u10m, v10m, ustar, garea, rlat, rlon, ts2d, dswsfc, & zorl, snow_cpl, pb2d, hf2d, oro, t2m, dpt2m, wetness, recmol real(kind=kind_phys), dimension(ims:ime, nlcat), intent(in) :: vegtype_frac - real(kind=kind_phys), dimension(ims:ime, nsoil), intent(in) :: smc + real(kind=kind_phys), dimension(ims:ime, nsoil), intent(in) :: smc,tslb real(kind=kind_phys), dimension(ims:ime, 12, 5), intent(in) :: dust12m_in real(kind=kind_phys), dimension(ims:ime, 24, 2), intent(in) :: smoke_RRFS ! This is a place holder for ebb_dcycle == 2, currently set to hold a single @@ -633,8 +671,8 @@ subroutine rrfs_smoke_prep( & real(kind_phys), dimension(ims:ime, kms:kme, jms:jme, num_chem), intent(out) :: chem real(kind_phys), dimension(ims:ime, kms:kme, jms:jme), intent(out) :: z_at_w - real(kind_phys), dimension(ims:ime, nsoil, jms:jme), intent(out) :: smois - real(kind_phys), dimension(ims:ime,jms:jme), intent(inout) :: frp_in, fire_end_hr, fhist, coef_bb_dc + real(kind_phys), dimension(ims:ime, nsoil, jms:jme), intent(out) :: smois,stemp + real(kind_phys), dimension(ims:ime,jms:jme), intent(inout) :: frp_in, fire_end_hr, fire_hist, coef_bb_dc real(kind_phys), dimension(ims:ime,jms:jme), intent(inout) :: hwp_day_avg, peak_hr real(kind_phys), dimension(ims:ime), intent(inout) :: emis_anoc,ebb_smoke_in real(kind_phys), parameter :: conv_frp = 1.e+06_kind_phys ! FRP conversion factor, MW to W @@ -730,6 +768,7 @@ subroutine rrfs_smoke_prep( & do j=jts,jte do i=its,ite smois(i,k,j)=smc(i,k) + stemp(i,k,j)=tslb(i,k) enddo enddo enddo @@ -776,13 +815,14 @@ subroutine rrfs_smoke_prep( & rri(i,k,j)=1./rho_phy(i,k,j) vvel(i,k,j)=-w(i,kkp)*rri(i,k,j)/g moist(i,k,j,:)=0. - moist(i,k,j,1)=gq0(i,kkp,p_atm_shum) - if (t_phy(i,k,j) > 265.) then - moist(i,k,j,2)=gq0(i,kkp,p_atm_cldq) + moist(i,k,j,1)=gq0(i,kkp,1) + !if (t_phy(i,k,j) > 265.) then + moist(i,k,j,2)=gq0(i,kkp,2) if (moist(i,k,j,2) < 1.e-8) moist(i,k,j,2)=0. - else - moist(i,k,j,2)=0. - endif + !else + ! moist(i,k,j,2)=0. + if(moist(i,k,j,3) < 1.e-8)moist(i,k,j,3)=0. + !endif !-- zmid(i,k,j)=phl3d(i,kkp)/g enddo @@ -862,11 +902,11 @@ subroutine rrfs_smoke_prep( & if (hour_int .le. 24) then do j=jts,jte do i=its,ite - ebu_in (i,j) = smoke_RRFS(i,hour_int+1,1) ! smoke frp_in (i,j) = smoke_RRFS(i,hour_int+1,2)*conv_frp ! frp - fire_end_hr(i,j) = 0.0 - hwp_day_avg(i,j) = 0.0 + ! These 2 arrays aren't needed for this option + ! fire_end_hr(i,j) = 0.0 + ! hwp_day_avg(i,j) = 0.0 ebb_smoke_in (i) = ebu_in(i,j) enddo enddo @@ -890,7 +930,8 @@ subroutine rrfs_smoke_prep( & if (ktau==1) then do j=jts,jte do i=its,ite - fhist (i,j) = 1. + ! GFS_typedefs.F90 initializes this = 1, but should be OK to duplicate, RAR?? + fire_hist (i,j) = 1. coef_bb_dc (i,j) = 1. if (xlong(i,j)<230.) then peak_hr(i,j)= 0.0* 3600. ! peak at 24 UTC, fires in Alaska @@ -909,7 +950,7 @@ subroutine rrfs_smoke_prep( & enddo endif - ! We will add a namelist variable, real :: flam_frac_global + ! We will add a namelist variable, real :: flam_frac_global, RAR?? do k=kms,kte do i=ims,ime chem(i,k,jts,p_smoke )=max(epsilc,gq0(i,k,ntsmoke )) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index af61ac05e..fc3aa9fe6 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -1,7 +1,7 @@ [ccpp-table-properties] name = rrfs_smoke_wrapper type = scheme - dependencies = ../hooks/machine.F,dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,plume_data_mod.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90, dep_dry_mod_emerson.F90,dep_data_mod.F90 + dependencies = dep_dry_simple_mod.F90,module_wetdep_ls.F90,dust_data_mod.F90,dust_fengsha_mod.F90,module_add_emiss_burn.F90,module_plumerise.F90,module_smoke_plumerise.F90,module_zero_plumegen_coms.F90,rrfs_smoke_config.F90,seas_data_mod.F90,seas_mod.F90,seas_ngac_mod.F90,coarsepm_settling_mod.F90, dep_dry_mod_emerson.F90,dep_data_mod.F90 ######################################################################## [ccpp-arg-table] @@ -71,6 +71,13 @@ dimensions = () type = integer intent = in +[n_dbg_lines_in] + standard_name = smoke_debug_lines + long_name = rrfs smoke add smoke option + units = index + dimensions = () + type = integer + intent = in [plume_wind_eff_in] standard_name = option_for_wind_effects_on_smoke_plumerise long_name = wind effect plumerise option @@ -406,6 +413,14 @@ type = real kind = kind_phys intent = inout +[tslb] + standard_name = soil_temperature_for_land_surface_model + long_name = soil temperature for land surface model + units = K + dimensions = (horizontal_loop_extent,vertical_dimension_of_soil_internal_to_land_surface_scheme) + type = real + kind = kind_phys + intent = in [vegtype_dom] standard_name = vegetation_type_classification long_name = vegetation type at each grid cell @@ -715,6 +730,13 @@ type = real kind = kind_phys intent = inout +[fire_type_out] + standard_name = fire_type_out + long_name = type of fire + units = none + dimensions = (horizontal_loop_extent) + type = integer + intent = out [ebu_smoke] standard_name = ebu_smoke long_name = buffer of vertical fire emission @@ -747,6 +769,43 @@ type = real kind = kind_phys intent = inout +[mpicomm] + standard_name = mpi_communicator + long_name = MPI communicator + units = index + dimensions = () + type = integer + intent = in +[mpirank] + standard_name = mpi_rank + long_name = current MPI-rank + units = index + dimensions = () + type = integer + intent = in +[mpiroot] + standard_name = mpi_root + long_name = master MPI-rank + units = index + dimensions = () + type = integer + intent = in +[uspdavg] + standard_name = bl_averaged_wind_speed + long_name = average wind speed within the boundary layer + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout +[hpbl_thetav] + standard_name = pbl_height_thetav + long_name = pbl height based on modified parcel method + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = inout [drydep_flux_out] standard_name = dry_deposition_flux long_name = rrfs dry deposition flux @@ -810,6 +869,30 @@ type = real kind = kind_phys intent = inout +[peak_hr_out] + standard_name = peak_hr_fire + long_name = hour of peak fire emissions + units = none + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[lu_nofire_out] + standard_name = lu_nofire_out + long_name = land use of no fire pixels for type + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[lu_qfire_out] + standard_name = lu_qfire_out + long_name = land use of fire pixels for type + units = frac + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [fire_heat_flux_out] standard_name = surface_fire_heat_flux long_name = heat flux of fire at the surface From c0544c218776d4a94169d45cb7dae102800594a1 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Tue, 23 Jan 2024 16:13:19 +0000 Subject: [PATCH 146/249] "update to address code reviewer's comments" --- physics/smoke_dust/dep_dry_mod_emerson.F90 | 14 ---------- physics/smoke_dust/module_add_emiss_burn.F90 | 27 +++++++++---------- physics/smoke_dust/rrfs_smoke_config.F90 | 2 +- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 14 +++------- physics/smoke_dust/rrfs_smoke_wrapper.meta | 28 +++++++------------- 5 files changed, 27 insertions(+), 58 deletions(-) diff --git a/physics/smoke_dust/dep_dry_mod_emerson.F90 b/physics/smoke_dust/dep_dry_mod_emerson.F90 index 771801c44..e69d6bc3f 100755 --- a/physics/smoke_dust/dep_dry_mod_emerson.F90 +++ b/physics/smoke_dust/dep_dry_mod_emerson.F90 @@ -179,10 +179,6 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & eps0 = eps0_grs end if ! Set if snow greater than 1 cm -! if ( snowh(i,j) .gt. 0.01 ) then ! snow -! A = A_wat -! eps0 = eps0_wat -! endif ! Interception Ein = Cin * ( dp / A )**vv ! Surface resistance @@ -234,25 +230,15 @@ subroutine dry_dep_driver_emerson(rmol,ustar,znt,ndvel,ddvel,vgrav, & IF (ndt_settl(nv) > 12) ndt_settl(nv) = 12 dt_settl(nv) = REAL(ntdt,kind=kind_phys) /REAL(ndt_settl(nv),kind=kind_phys) enddo - !do nv = 1, ndvel - ! chem_before(nv) = 0._kind_phys - ! do k = kts, kte - ! chem_before(nv) = chem_before(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 - ! enddo - !enddo ! Perform gravitational settling if desired if ( settling_flag == 1 ) then call particle_settling(cblk_col,rho_col,delz_col,vg_col,dt_settl,ndt_settl,ndvel,kts,kte) endif ! Put cblk back into chem array do nv= 1, ndvel - !chem_after(nv) = 0._kind_phys - !settling_flux(i,j,nv) = 0._kind_phys do k = kts, kte chem(i,k,j,chem_pointers(nv)) = cblk_col(k,nv) - !chem_after(nv) = chem_after(nv) + (cblk_col(k,nv) * rho_phy(i,k,j) * delz(i,k,j) ) ! ug/m2 enddo ! k - !settling_flux(i,j,nv) = settling_flux(i,j,nv) + (chem_before(nv) - chem_after(nv)) ! ug/m2 enddo ! nv end do ! j end do ! i diff --git a/physics/smoke_dust/module_add_emiss_burn.F90 b/physics/smoke_dust/module_add_emiss_burn.F90 index 0a22fcfd7..f1bbaeee9 100755 --- a/physics/smoke_dust/module_add_emiss_burn.F90 +++ b/physics/smoke_dust/module_add_emiss_burn.F90 @@ -47,7 +47,7 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & INTEGER, PARAMETER :: kfire_max=51 ! max vertical level for BB plume rise - real(kind_phys) :: timeq, fire_age, age_hr, dt1,dt2,dtm ! For BB emis. diurnal cycle calculation + real(kind_phys) :: timeq, fire_age, age_hr, dt1,dt2,dtm, coef_con ! For BB emis. diurnal cycle calculation ! For Gaussian diurnal cycle real(kind_phys), PARAMETER :: sc_factor=1. ! to scale up the wildfire emissions, TBD later @@ -89,6 +89,8 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & if (ebb_dcycle==2) then ! Constants for the fire diurnal cycle calculation + coef_con = 1._kind_phys/((2._kind_phys*pi)**0.5_kind_phys * sigma_fire_dur(1) *fire_age) * & + exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2._kind_phys*sigma_fire_dur(1)**2 )) do j=jts,jte do i=its,ite fire_age= time_int + (fire_end_hr(i,j)-1._kind_phys)*3600._kind_phys !One hour delay is due to the latency of the RAVE files @@ -97,13 +99,12 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & SELECT CASE ( fire_type(i,j) ) !Ag, urban fires, bare land etc. CASE (1) ! these fires will have exponentially decreasing diurnal cycle, - coef_bb_dc(i,j) = 1._kind_phys/((2._kind_phys*pi)**0.5_kind_phys * sigma_fire_dur(1) *fire_age) * & - exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2._kind_phys*sigma_fire_dur(1)**2 )) + coef_bb_dc(i,j) = coef_con - ! IF ( dbg_opt .AND. time_int<5000.) then - ! WRITE(6,*) 'i,j,peak_hr(i,j) ',i,j,peak_hr(i,j) - ! WRITE(6,*) 'coef_bb_dc(i,j) ',coef_bb_dc(i,j) - ! END IF + IF ( dbg_opt .AND. time_int<5000.) then + WRITE(6,*) 'i,j,peak_hr(i,j) ',i,j,peak_hr(i,j) + WRITE(6,*) 'coef_bb_dc(i,j) ',coef_bb_dc(i,j) + END IF CASE (3) age_hr= fire_age/3600._kind_phys @@ -123,9 +124,6 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & dc_hwp= MAX(0._kind_phys,dc_hwp) dc_hwp= MIN(25._kind_phys,dc_hwp) - !coef_bb_dc(i,j)= sc_factor* fire_hist(i,j)* rate_ebb2(i,j)* (1. + log( - !hwp_(i,j)/ hwp_day_avg(i,j))) - ! RAR: Gaussian profile for wildfires dt1= abs(timeq - peak_hr(i,j)) dt2= timeq_max - peak_hr(i,j) + timeq ! peak hour is always <86400. @@ -134,13 +132,12 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & dc_gp = MAX(0._kind_phys,dc_gp) dc_fn = MIN(dc_hwp/dc_gp,3._kind_phys) - !coef_bb_dc(i,j) = fire_hist(i,j)* dc_fn coef_bb_dc(i,j) = fire_hist(i,j)* dc_hwp - ! IF ( dbg_opt .AND. time_int<5000.) then - ! WRITE(6,*) 'i,j,fire_hist(i,j),peak_hr(i,j) ', i,j,fire_hist(i,j),peak_hr(i,j) - ! WRITE(6,*) 'dc_gp,dc_hwp,dc_fn,coef_bb_dc(i,j) ',dc_gp,dc_hwp,dc_fn,coef_bb_dc(i,j) - ! END IF + IF ( dbg_opt .AND. time_int<5000.) then + WRITE(6,*) 'i,j,fire_hist(i,j),peak_hr(i,j) ', i,j,fire_hist(i,j),peak_hr(i,j) + WRITE(6,*) 'dc_gp,dc_hwp,dc_fn,coef_bb_dc(i,j) ',dc_gp,dc_hwp,dc_fn,coef_bb_dc(i,j) + END IF CASE DEFAULT END SELECT diff --git a/physics/smoke_dust/rrfs_smoke_config.F90 b/physics/smoke_dust/rrfs_smoke_config.F90 index dae4338bb..c20d6e2db 100755 --- a/physics/smoke_dust/rrfs_smoke_config.F90 +++ b/physics/smoke_dust/rrfs_smoke_config.F90 @@ -40,7 +40,7 @@ module rrfs_smoke_config ! -- integer, parameter :: CHEM_OPT_GOCART= 1 - integer, parameter :: num_moist=3, num_chem=20, num_emis_seas=5, num_emis_dust=5 + integer, parameter :: num_moist=2, num_chem=20, num_emis_seas=5, num_emis_dust=5 ! -- hydrometeors integer, parameter :: p_qv=1 diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index 4daad7168..3842cba54 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -121,7 +121,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, nwfa, nifa, emanoc, emdust, emseas, drydep_flux_out, wetdpr, & ebb_smoke_in, frp_output, coef_bb, fire_type_out, & ebu_smoke,fhist,min_fplume, & - max_fplume, hwp, hwp_ave, wetness, ndvel, ddvel_inout,fire_in, & + max_fplume, hwp, hwp_ave, wetness, ndvel, ddvel_inout, & peak_hr_out,lu_nofire_out,lu_qfire_out, & fire_heat_flux_out, frac_grid_burned_out, kpbl,oro, & uspdavg, hpbl_thetav, mpicomm, mpirank, mpiroot, errmsg,errflg ) @@ -154,8 +154,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, 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(inout) :: fire_in - real(kind_phys), dimension(:), intent(out) :: fire_heat_flux_out, frac_grid_burned_out + 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 @@ -816,13 +815,8 @@ subroutine rrfs_smoke_prep( & vvel(i,k,j)=-w(i,kkp)*rri(i,k,j)/g moist(i,k,j,:)=0. moist(i,k,j,1)=gq0(i,kkp,1) - !if (t_phy(i,k,j) > 265.) then - moist(i,k,j,2)=gq0(i,kkp,2) - if (moist(i,k,j,2) < 1.e-8) moist(i,k,j,2)=0. - !else - ! moist(i,k,j,2)=0. - if(moist(i,k,j,3) < 1.e-8)moist(i,k,j,3)=0. - !endif + moist(i,k,j,2)=gq0(i,kkp,2) + if (moist(i,k,j,2) < 1.e-8) moist(i,k,j,2)=0. !-- zmid(i,k,j)=phl3d(i,kkp)/g enddo diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index fc3aa9fe6..e00781ec1 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -731,9 +731,9 @@ kind = kind_phys intent = inout [fire_type_out] - standard_name = fire_type_out + standard_name = fire_type long_name = type of fire - units = none + units = 1 dimensions = (horizontal_loop_extent) type = integer intent = out @@ -791,17 +791,17 @@ type = integer intent = in [uspdavg] - standard_name = bl_averaged_wind_speed + standard_name = mean_wind_speed_in_boundary_layer long_name = average wind speed within the boundary layer - units = none + units = m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = inout [hpbl_thetav] - standard_name = pbl_height_thetav + standard_name = atmosphere_boundary_layer_thickness_from_modified_parcel long_name = pbl height based on modified parcel method - units = none + units = m dimensions = (horizontal_loop_extent) type = real kind = kind_phys @@ -861,24 +861,16 @@ type = real kind = kind_phys intent = inout -[fire_in] - standard_name = smoke_fire_auxiliary_input - long_name = smoke fire auxiliary input variables - units = various - dimensions = (horizontal_loop_extent,fire_auxiliary_data_extent) - type = real - kind = kind_phys - intent = inout [peak_hr_out] standard_name = peak_hr_fire - long_name = hour of peak fire emissions - units = none + long_name = time_of_peak_fire_emissions + units = s dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = out [lu_nofire_out] - standard_name = lu_nofire_out + standard_name = sum_of_land_use_fractions_for_no_fire_pixels long_name = land use of no fire pixels for type units = frac dimensions = (horizontal_loop_extent) @@ -886,7 +878,7 @@ kind = kind_phys intent = out [lu_qfire_out] - standard_name = lu_qfire_out + standard_name = sum_of_land_use_fractions_for_cropland_fire_pixels long_name = land use of fire pixels for type units = frac dimensions = (horizontal_loop_extent) From a0acaedeb7512f9c3cc062922b83466ffdfc2478 Mon Sep 17 00:00:00 2001 From: "Haiqin.Li" Date: Wed, 24 Jan 2024 16:35:59 +0000 Subject: [PATCH 147/249] "update to resolve code managers' comments" --- physics/smoke_dust/module_add_emiss_burn.F90 | 6 +++--- physics/smoke_dust/rrfs_smoke_wrapper.meta | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/smoke_dust/module_add_emiss_burn.F90 b/physics/smoke_dust/module_add_emiss_burn.F90 index f1bbaeee9..80d91bb0e 100755 --- a/physics/smoke_dust/module_add_emiss_burn.F90 +++ b/physics/smoke_dust/module_add_emiss_burn.F90 @@ -89,8 +89,7 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & if (ebb_dcycle==2) then ! Constants for the fire diurnal cycle calculation - coef_con = 1._kind_phys/((2._kind_phys*pi)**0.5_kind_phys * sigma_fire_dur(1) *fire_age) * & - exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2._kind_phys*sigma_fire_dur(1)**2 )) + coef_con=1._kind_phys/((2._kind_phys*pi)**0.5_kind_phys) do j=jts,jte do i=its,ite fire_age= time_int + (fire_end_hr(i,j)-1._kind_phys)*3600._kind_phys !One hour delay is due to the latency of the RAVE files @@ -99,7 +98,8 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,pi, & SELECT CASE ( fire_type(i,j) ) !Ag, urban fires, bare land etc. CASE (1) ! these fires will have exponentially decreasing diurnal cycle, - coef_bb_dc(i,j) = coef_con + coef_bb_dc(i,j) = coef_con*1._kind_phys/(sigma_fire_dur(1) *fire_age) * & + exp(- ( log(fire_age) - avg_fire_dur(1))**2 /(2._kind_phys*sigma_fire_dur(1)**2 )) IF ( dbg_opt .AND. time_int<5000.) then WRITE(6,*) 'i,j,peak_hr(i,j) ',i,j,peak_hr(i,j) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index e00781ec1..271d2dd36 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -872,7 +872,7 @@ [lu_nofire_out] standard_name = sum_of_land_use_fractions_for_no_fire_pixels long_name = land use of no fire pixels for type - units = frac + units = 1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys @@ -880,7 +880,7 @@ [lu_qfire_out] standard_name = sum_of_land_use_fractions_for_cropland_fire_pixels long_name = land use of fire pixels for type - units = frac + units = 1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys From 5fe0d63eee3eb05bb5e37b5e136229ac3d84cf98 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Thu, 25 Jan 2024 13:33:36 +0000 Subject: [PATCH 148/249] Change flag_for_air_sea_flux_computation_over_water to control_for_air_sea_flux_computation_over_water. --- physics/PBL/SATMEDMF/satmedmfvdifq.meta | 4 ++-- physics/SFC_Layer/UFS/sfc_diag.meta | 4 ++-- physics/SFC_Layer/UFS/sfc_diff.meta | 4 ++-- physics/SFC_Layer/UFS/sfc_nst.meta | 4 ++-- physics/SFC_Models/Ocean/UFS/sfc_ocean.meta | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.meta b/physics/PBL/SATMEDMF/satmedmfvdifq.meta index ec80ba422..ff570dce0 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.meta @@ -234,9 +234,9 @@ kind = kind_phys intent = in [icplocn2atm] - standard_name = flag_for_air_sea_flux_computation_over_water + standard_name = control_for_air_sea_flux_computation_over_water long_name = air-sea flux option - units = flag + units = 1 dimensions = () type = integer intent = in diff --git a/physics/SFC_Layer/UFS/sfc_diag.meta b/physics/SFC_Layer/UFS/sfc_diag.meta index b432d75b7..f5e0ab89e 100644 --- a/physics/SFC_Layer/UFS/sfc_diag.meta +++ b/physics/SFC_Layer/UFS/sfc_diag.meta @@ -141,9 +141,9 @@ kind = kind_phys intent = in [icplocn2atm] - standard_name = flag_for_air_sea_flux_computation_over_water + standard_name = control_for_air_sea_flux_computation_over_water long_name = air-sea flux option - units = flag + units = 1 dimensions = () type = integer intent = in diff --git a/physics/SFC_Layer/UFS/sfc_diff.meta b/physics/SFC_Layer/UFS/sfc_diff.meta index eae4c58b0..f2bee7d2c 100644 --- a/physics/SFC_Layer/UFS/sfc_diff.meta +++ b/physics/SFC_Layer/UFS/sfc_diff.meta @@ -258,9 +258,9 @@ type = integer intent = in [icplocn2atm] - standard_name = flag_for_air_sea_flux_computation_over_water + standard_name = control_for_air_sea_flux_computation_over_water long_name = air-sea flux option - units = flag + units = 1 dimensions = () type = integer intent = in diff --git a/physics/SFC_Layer/UFS/sfc_nst.meta b/physics/SFC_Layer/UFS/sfc_nst.meta index ba075e5ae..2181f0bf4 100644 --- a/physics/SFC_Layer/UFS/sfc_nst.meta +++ b/physics/SFC_Layer/UFS/sfc_nst.meta @@ -151,9 +151,9 @@ kind = kind_phys intent = in [icplocn2atm] - standard_name = flag_for_air_sea_flux_computation_over_water + standard_name = control_for_air_sea_flux_computation_over_water long_name = air-sea flux option - units = flag + units = 1 dimensions = () type = integer intent = in diff --git a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta index c380a7540..4672a6dc4 100644 --- a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta +++ b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta @@ -103,9 +103,9 @@ kind = kind_phys intent = in [icplocn2atm] - standard_name = flag_for_air_sea_flux_computation_over_water + standard_name = control_for_air_sea_flux_computation_over_water long_name = air-sea flux option - units = flag + units = 1 dimensions = () type = integer intent = in From 4bdf3fab29da51e487143e8b5e3ce8ed5d599127 Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Thu, 25 Jan 2024 14:49:22 +0000 Subject: [PATCH 149/249] add kind_phys to parameter in mp_nssl --- physics/MP/NSSL/mp_nssl.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/MP/NSSL/mp_nssl.F90 b/physics/MP/NSSL/mp_nssl.F90 index ad1d41090..e250527c4 100644 --- a/physics/MP/NSSL/mp_nssl.F90 +++ b/physics/MP/NSSL/mp_nssl.F90 @@ -79,7 +79,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & integer :: ims,ime, jms,jme, kms,kme, nx, nz, i,k real :: nssl_params(20) integer :: ihailv,ipc - real, parameter :: qmin = 1.e-12 + real(kind_phys), parameter :: qmin = 1.e-12 integer :: ierr logical :: missing_vars = .False. @@ -347,7 +347,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & its,ite, jts,jte, kts,kte, i,j,k integer :: itimestep ! timestep counter integer :: ntmul, n - real, parameter :: dtpmax = 60. ! allow up to dt=75 (1.25*60) + real(kind_phys), parameter :: dtpmax = 60. ! allow up to dt=75 (1.25*60) real(kind_phys) :: dtptmp integer, parameter :: ndebug = 0 logical :: invertccn From be9b2b726d5ab08a7630def5b7559d55fa6dcd1f Mon Sep 17 00:00:00 2001 From: Jili Dong Date: Thu, 25 Jan 2024 14:54:44 +0000 Subject: [PATCH 150/249] add more kind_phys to real variables in mp_nssl --- physics/MP/NSSL/mp_nssl.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/MP/NSSL/mp_nssl.F90 b/physics/MP/NSSL/mp_nssl.F90 index e250527c4..0b111f7cd 100644 --- a/physics/MP/NSSL/mp_nssl.F90 +++ b/physics/MP/NSSL/mp_nssl.F90 @@ -77,7 +77,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & ! Local variables: dimensions used in nssl_init integer :: ims,ime, jms,jme, kms,kme, nx, nz, i,k - real :: nssl_params(20) + real(kind_phys) :: nssl_params(20) integer :: ihailv,ipc real(kind_phys), parameter :: qmin = 1.e-12 integer :: ierr @@ -351,7 +351,7 @@ subroutine mp_nssl_run(ncol, nlev, con_g, con_rd, mpirank, & real(kind_phys) :: dtptmp integer, parameter :: ndebug = 0 logical :: invertccn - real :: cwmas + real(kind_phys) :: cwmas real(kind_phys), allocatable :: an(:,:,:,:) ! temporary scalar array From 51204101eeb68dcbed08d13cc0a341a25ee1a229 Mon Sep 17 00:00:00 2001 From: "Bin.Li" Date: Fri, 26 Jan 2024 09:27:17 +0000 Subject: [PATCH 151/249] Update standard_name and long_name for usfco and vsfco. --- physics/PBL/SATMEDMF/satmedmfvdifq.meta | 8 ++++---- physics/SFC_Layer/UFS/sfc_diag.meta | 8 ++++---- physics/SFC_Layer/UFS/sfc_diff.meta | 8 ++++---- physics/SFC_Layer/UFS/sfc_nst.meta | 8 ++++---- physics/SFC_Models/Ocean/UFS/sfc_ocean.meta | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.meta b/physics/PBL/SATMEDMF/satmedmfvdifq.meta index ff570dce0..e203187aa 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.meta @@ -218,16 +218,16 @@ kind = kind_phys intent = in [usfco] - standard_name = ocn_current_zonal - long_name = ocn_current_zonal + standard_name = x_ocean_current + long_name = zonal current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in [vsfco] - standard_name = ocn_current_merid - long_name = ocn_current_merid + standard_name = y_ocean_current + long_name = meridional current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real diff --git a/physics/SFC_Layer/UFS/sfc_diag.meta b/physics/SFC_Layer/UFS/sfc_diag.meta index f5e0ab89e..4fdf37916 100644 --- a/physics/SFC_Layer/UFS/sfc_diag.meta +++ b/physics/SFC_Layer/UFS/sfc_diag.meta @@ -125,16 +125,16 @@ kind = kind_phys intent = in [usfco] - standard_name = ocn_current_zonal - long_name = ocn_current_zonal + standard_name = x_ocean_current + long_name = zonal current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in [vsfco] - standard_name = ocn_current_merid - long_name = ocn_current_merid + standard_name = y_ocean_current + long_name = meridional current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real diff --git a/physics/SFC_Layer/UFS/sfc_diff.meta b/physics/SFC_Layer/UFS/sfc_diff.meta index f2bee7d2c..0964473cb 100644 --- a/physics/SFC_Layer/UFS/sfc_diff.meta +++ b/physics/SFC_Layer/UFS/sfc_diff.meta @@ -235,16 +235,16 @@ kind = kind_phys intent = in [usfco] - standard_name = ocn_current_zonal - long_name = ocn_current_zonal + standard_name = x_ocean_current + long_name = zonal current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in [vsfco] - standard_name = ocn_current_merid - long_name = ocn_current_merid + standard_name = y_ocean_current + long_name = meridional current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real diff --git a/physics/SFC_Layer/UFS/sfc_nst.meta b/physics/SFC_Layer/UFS/sfc_nst.meta index 2181f0bf4..80f468803 100644 --- a/physics/SFC_Layer/UFS/sfc_nst.meta +++ b/physics/SFC_Layer/UFS/sfc_nst.meta @@ -135,16 +135,16 @@ kind = kind_phys intent = in [usfco] - standard_name = ocn_current_zonal - long_name = ocn_current_zonal + standard_name = x_ocean_current + long_name = zonal current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in [vsfco] - standard_name = ocn_current_merid - long_name = ocn_current_merid + standard_name = y_ocean_current + long_name = meridional current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real diff --git a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta index 4672a6dc4..15d9fb5c4 100644 --- a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta +++ b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta @@ -87,16 +87,16 @@ kind = kind_phys intent = in [usfco] - standard_name = ocn_current_zonal - long_name = ocn_current_zonal + standard_name = x_ocean_current + long_name = zonal current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = in [vsfco] - standard_name = ocn_current_merid - long_name = ocn_current_merid + standard_name = y_ocean_current + long_name = meridional current at ocean surface units = m s-1 dimensions = (horizontal_loop_extent) type = real From bac19946862a08b453e94678727c868f1b60c450 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Wed, 7 Feb 2024 16:47:36 +0000 Subject: [PATCH 152/249] Change the type of mpi communicator in few more files --- physics/MP/Ferrier_Aligo/mp_fer_hires.F90 | 3 ++- physics/MP/NSSL/mp_nssl.F90 | 4 ++-- physics/MP/NSSL/mp_nssl.meta | 2 +- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 3 ++- physics/smoke_dust/rrfs_smoke_wrapper.meta | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 b/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 index 938beae5d..47e80e9d9 100644 --- a/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 +++ b/physics/MP/Ferrier_Aligo/mp_fer_hires.F90 @@ -36,6 +36,7 @@ subroutine mp_fer_hires_init(ncol, nlev, dtp, imp_physics, & mpicomm, mpirank,mpiroot, & threads, errmsg, errflg) + USE mpi_f08 USE machine, ONLY : kind_phys USE MODULE_MP_FER_HIRES, ONLY : FERRIER_INIT_HR implicit none @@ -45,7 +46,7 @@ subroutine mp_fer_hires_init(ncol, nlev, dtp, imp_physics, & real(kind_phys), intent(in) :: dtp integer, intent(in) :: imp_physics integer, intent(in) :: imp_physics_fer_hires - integer, intent(in) :: mpicomm + type(MPI_Comm), intent(in) :: mpicomm integer, intent(in) :: mpirank integer, intent(in) :: mpiroot integer, intent(in) :: threads diff --git a/physics/MP/NSSL/mp_nssl.F90 b/physics/MP/NSSL/mp_nssl.F90 index 0b111f7cd..5c47bce73 100644 --- a/physics/MP/NSSL/mp_nssl.F90 +++ b/physics/MP/NSSL/mp_nssl.F90 @@ -40,7 +40,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & use module_mp_nssl_2mom, only: nssl_2mom_init, nssl_2mom_init_const #ifdef MPI - use mpi + use mpi_f08 #endif implicit none @@ -56,7 +56,7 @@ subroutine mp_nssl_init(ncol, nlev, errflg, errmsg, threads, restart, & integer, intent(in) :: mpirank integer, intent(in) :: mpiroot - integer, intent(in) :: mpicomm + type(MPI_Comm), intent(in) :: mpicomm integer, intent(in) :: imp_physics integer, intent(in) :: imp_physics_nssl real(kind_phys), intent(in) :: nssl_cccn, nssl_alphah, nssl_alphahl diff --git a/physics/MP/NSSL/mp_nssl.meta b/physics/MP/NSSL/mp_nssl.meta index 8449f26cf..deb96569d 100644 --- a/physics/MP/NSSL/mp_nssl.meta +++ b/physics/MP/NSSL/mp_nssl.meta @@ -68,7 +68,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [qc] standard_name = cloud_liquid_water_mixing_ratio diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index 3842cba54..0ac285b23 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -4,6 +4,7 @@ module rrfs_smoke_wrapper + use mpi_f90 use machine , only : kind_phys use rrfs_smoke_config, only : kemit, dust_opt, seas_opt, do_plumerise, & addsmoke_flag, plumerisefire_frq, wetdep_ls_opt, & @@ -225,7 +226,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, integer :: i, j, k, kp, n ! MPI variables integer :: mpiid - integer, intent(in) :: mpicomm + type(MPI_comm), intent(in) :: mpicomm integer, intent(in) :: mpirank integer, intent(in) :: mpiroot diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index 271d2dd36..1f26e5a93 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -774,7 +774,7 @@ long_name = MPI communicator units = index dimensions = () - type = integer + type = MPI_Comm intent = in [mpirank] standard_name = mpi_rank From fd71b22e93ee9d168d91c39d795b6f906f1c5f59 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 7 Feb 2024 16:51:19 +0000 Subject: [PATCH 153/249] Fix .gitmodule --- .gitmodules | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 24b9cf118..b2d51bdfe 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,7 +1,4 @@ -[submodule "physics/rte-rrtmgp"] +[submodule "physics/Radiation/RRTMGP/rte-rrtmgp"] path = physics/Radiation/RRTMGP/rte-rrtmgp url = https://github.com/earth-system-radiation/rte-rrtmgp branch = main -[submodule "physics/Radiation/RRTMGP/rte-rrtmgp"] - path = physics/Radiation/RRTMGP/rte-rrtmgp - url = https://github.com/earth-system-radiation/rte-rrtmgp From 8c68c2f9b63ae1456678cf31a74fe0005a8bcb7c Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Wed, 7 Feb 2024 14:52:01 -0600 Subject: [PATCH 154/249] Fix mpi use statement --- physics/smoke_dust/rrfs_smoke_wrapper.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.F90 b/physics/smoke_dust/rrfs_smoke_wrapper.F90 index 0ac285b23..37ffccb35 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.F90 +++ b/physics/smoke_dust/rrfs_smoke_wrapper.F90 @@ -4,7 +4,7 @@ module rrfs_smoke_wrapper - use mpi_f90 + use mpi_f08 use machine , only : kind_phys use rrfs_smoke_config, only : kemit, dust_opt, seas_opt, do_plumerise, & addsmoke_flag, plumerisefire_frq, wetdep_ls_opt, & From afa4f6e18e7c5336e693cef58a315d176b93c64a Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Fri, 9 Feb 2024 13:45:34 -0500 Subject: [PATCH 155/249] remove unused variables from files unified_ugwp.F90, dcyc2t3.f and their related meta files --- physics/GWD/unified_ugwp.F90 | 8 ++------ physics/GWD/unified_ugwp.meta | 24 ------------------------ 2 files changed, 2 insertions(+), 30 deletions(-) diff --git a/physics/GWD/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 index 0b649bd10..fcdee3b5d 100644 --- a/physics/GWD/unified_ugwp.F90 +++ b/physics/GWD/unified_ugwp.F90 @@ -253,7 +253,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt cdmbgwd, jdat, xlat, xlat_d, sinlat, coslat, area, & ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, & del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & - tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & + tau_tofd, tau_mtb, tau_ogw, tau_ngw, & dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_omega, con_pi, con_cp, con_rd, con_rv, & con_rerth, con_fvirt, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & @@ -309,7 +309,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt & slmsk(:) real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg - real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb + real(kind=kind_phys), intent(out), dimension(:) :: rdxzb real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw 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 @@ -377,10 +377,6 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt errmsg = '' errflg = 0 - ! Initialize variables not being used - zmtb(:) = 0.0 - zlwb(:) = 0.0 - zogb(:) = 0.0 ! 1) ORO stationary GWs ! ------------------ diff --git a/physics/GWD/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta index a08ee3960..189f7072c 100644 --- a/physics/GWD/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -900,30 +900,6 @@ type = real kind = kind_phys intent = out -[zmtb] - standard_name = height_of_mountain_blocking - long_name = height of mountain blocking drag - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out -[zlwb] - standard_name = height_of_low_level_wave_breaking - long_name = height of low level wave breaking - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out -[zogw] - standard_name = height_of_launch_level_of_orographic_gravity_wave - long_name = height of launch level of orographic gravity wave - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out [dudt_mtb] standard_name = instantaneous_change_in_x_wind_due_to_mountain_blocking_drag long_name = instantaneous change in x wind due to mountain blocking drag From 82c6873942c387fcf7c2febbb707563ea95917ca Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Fri, 9 Feb 2024 14:01:36 -0500 Subject: [PATCH 156/249] remove unused variables from files dcyc2t3.f and dcyc2t3.meta --- physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f | 8 ++++---- physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta | 8 -------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f index 36299651d..1e373ae12 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.f @@ -44,7 +44,7 @@ module dcyc2t3 ! input/output: ! ! dtdt,dtdtnp, ! ! outputs: ! -! adjsfcdsw,adjsfcnsw,adjsfcdlw,adjsfculw, ! +! adjsfcdsw,adjsfcnsw,adjsfcdlw, ! ! adjsfculw_lnd,adjsfculw_ice,adjsfculw_wat,xmu,xcosz, ! ! adjnirbmu,adjnirdfu,adjvisbmu,adjvisdfu, ! ! adjdnnbmd,adjdnndfd,adjdnvbmd,adjdnvdfd) ! @@ -181,7 +181,7 @@ subroutine dcyc2t3_run & ! --- input/output: & dtdt,dtdtnp,htrlw, & ! --- outputs: - & adjsfcdsw,adjsfcnsw,adjsfcdlw,adjsfculw, & + & adjsfcdsw,adjsfcnsw,adjsfcdlw, & & adjsfculw_lnd,adjsfculw_ice,adjsfculw_wat,xmu,xcosz, & & adjnirbmu,adjnirdfu,adjvisbmu,adjvisdfu, & & adjnirbmd,adjnirdfd,adjvisbmd,adjvisdfd, & @@ -242,7 +242,7 @@ subroutine dcyc2t3_run & ! --- outputs: real(kind=kind_phys), dimension(:), intent(out) :: & - & adjsfcdsw, adjsfcnsw, adjsfcdlw, adjsfculw, xmu, xcosz, & + & adjsfcdsw, adjsfcnsw, adjsfcdlw, xmu, xcosz, & & adjnirbmu, adjnirdfu, adjvisbmu, adjvisdfu, & & adjnirbmd, adjnirdfd, adjvisbmd, adjvisdfd @@ -352,7 +352,7 @@ subroutine dcyc2t3_run & ! if (lprnt .and. i == ipr) write(0,*)' in dcyc3: dry==',dry(i) ! &,' wet=',wet(i),' icy=',icy(i),' tsfc3=',tsfc3(i,:) -! &,' sfcemis=',sfcemis(i,:),' adjsfculw=',adjsfculw(i,:) +! &,' sfcemis=',sfcemis(i,:) ! !> - normalize by average value over radiation period for daytime. diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta index 95b3f341b..6f8a0eda0 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta @@ -524,14 +524,6 @@ type = real kind = kind_phys intent = out -[adjsfculw] - standard_name = surface_upwelling_longwave_flux - long_name = surface upwelling longwave flux at current time - units = W m-2 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out [adjsfculw_lnd] standard_name = surface_upwelling_longwave_flux_over_land long_name = surface upwelling longwave flux at current time over land From 3fa192f76e445d150ab9e52aa98614e1191205d0 Mon Sep 17 00:00:00 2001 From: "Shan.Sun" Date: Wed, 14 Feb 2024 18:14:08 +0000 Subject: [PATCH 157/249] ufs-community/ccpp-physics issue #172 (wrong ice temperature in the coupled UFS ATM output during summer) -- 'tisfc' is no longer modified by the atmospheric model, i.e., allowing the ice model to determine the ice temperature over both sea ice and lake ice; -- Changing tisfc from intent(inout) to intent(in). Co-authored-by: Jun Wang --- .../UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 | 10 ++-------- .../UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 index fd16dea59..d36a86721 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.F90 @@ -42,9 +42,9 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, iopt_lake, iopt_l real(kind=kind_phys), dimension(:), intent(in ) :: landfrac, lakefrac, lakedepth, oceanfrac real(kind=kind_phys), dimension(:), intent(inout) :: cice, hice real(kind=kind_phys), dimension(:), intent( out) :: frland - real(kind=kind_phys), dimension(:), intent(in ) :: snowd, tprcp, uustar, weasd, qss + real(kind=kind_phys), dimension(:), intent(in ) :: snowd, tprcp, uustar, weasd, qss, tisfc - real(kind=kind_phys), dimension(:), intent(inout) :: tsfc, tsfco, tsfcl, tisfc + real(kind=kind_phys), dimension(:), intent(inout) :: tsfc, tsfco, tsfcl real(kind=kind_phys), dimension(:), intent(inout) :: snowd_lnd, snowd_ice, tprcp_wat, & tprcp_lnd, tprcp_ice, tsfc_wat, tsurf_wat,tsurf_lnd, tsurf_ice, & uustar_wat, uustar_lnd, uustar_ice, weasd_lnd, weasd_ice, & @@ -86,7 +86,6 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, iopt_lake, iopt_l if (oceanfrac(i) > zero) then if (cice(i) >= min_seaice) then icy(i) = .true. - tisfc(i) = max(timin, min(tisfc(i), tgice)) if (cplflx) then islmsk_cice(i) = 4 flag_cice(i) = .true. @@ -111,7 +110,6 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, iopt_lake, iopt_l if (cice(i) >= min_lakeice) then icy(i) = .true. islmsk(i) = 2 - tisfc(i) = max(timin, min(tisfc(i), tgice)) else cice(i) = zero hice(i) = zero @@ -151,7 +149,6 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, iopt_lake, iopt_l if (oceanfrac(i) > zero) then if (cice(i) >= min_seaice) then icy(i) = .true. - tisfc(i) = max(timin, min(tisfc(i), tgice)) ! This cplice namelist option was added to deal with the ! situation of the FV3ATM-HYCOM coupling without an active sea ! ice (e.g., CICE6) component. By default, the cplice is true @@ -187,9 +184,6 @@ subroutine GFS_surface_composites_pre_run (im, lkm, frac_grid, iopt_lake, iopt_l is_clm = lkm>0 .and. iopt_lake==iopt_lake_clm .and. use_lake_model(i)>0 if (cice(i) >= min_lakeice) then icy(i) = .true. - if(.not.is_clm) then - tisfc(i) = max(timin, min(tisfc(i), tgice)) - endif islmsk(i) = 2 else cice(i) = zero diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta index 33e2f0523..4d1021118 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.meta @@ -358,7 +358,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = in [tsurf_wat] standard_name = surface_skin_temperature_after_iteration_over_water long_name = surface skin temperature after iteration over water From bb9b90fefdadb82a97d68e9fee2c6d7326e6020f Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Mon, 26 Feb 2024 13:44:20 +0000 Subject: [PATCH 158/249] Update MPI find_package and check if MPI F08 module is supported --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d0d265437..b8cf73f7c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.10) project(ccpp_physics VERSION 5.0.0 @@ -9,9 +9,10 @@ set(PACKAGE "ccpp-physics") set(AUTHORS "Grant Firl" "Dustin Swales" "Man Zhang" "Mike Kavulich" ) #------------------------------------------------------------------------------ -# Set MPI flags for C/C++/Fortran -if (MPI) - find_package(MPI REQUIRED C Fortran) +# Set MPI flags for C/C++/Fortran with MPI F08 interface +find_package(MPI REQUIRED C Fortran) +if(NOT MPI_Fortran_HAVE_F08_MODULE) + message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") endif() #------------------------------------------------------------------------------ From 0cb5d97355d347f5448568bba1b64409f6e1ddf5 Mon Sep 17 00:00:00 2001 From: Dusan Jovic Date: Tue, 27 Feb 2024 00:01:41 +0000 Subject: [PATCH 159/249] Remove C from MPI find_package --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b8cf73f7c..c56070123 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,8 @@ set(PACKAGE "ccpp-physics") set(AUTHORS "Grant Firl" "Dustin Swales" "Man Zhang" "Mike Kavulich" ) #------------------------------------------------------------------------------ -# Set MPI flags for C/C++/Fortran with MPI F08 interface -find_package(MPI REQUIRED C Fortran) +# Set MPI flags for Fortran with MPI F08 interface +find_package(MPI REQUIRED Fortran) if(NOT MPI_Fortran_HAVE_F08_MODULE) message(FATAL_ERROR "MPI implementation does not support the Fortran 2008 mpi_f08 interface") endif() From df5d9d4366cfd83f1af09cb3af3cfa10ffb31226 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 7 Mar 2024 12:47:52 -0500 Subject: [PATCH 160/249] add cs_conv V2 changes on top of latest ufs/dev code --- physics/CONV/Chikira_Sugiyama/cs_conv.F90 | 1468 ++++++++++++--------- 1 file changed, 820 insertions(+), 648 deletions(-) diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 index ab7388df8..94dadba87 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 @@ -60,6 +60,7 @@ module cs_conv !DD and precipitation. Decrease for more precip real(kind_phys), public :: precz0, preczh, clmd, clmp, clmdpa + real(kind_phys), public, parameter :: c0t=0.002, d0t=0.002 ! ! Private data ! @@ -225,15 +226,17 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! ! output arguments of CS_CUMLUS ! - real(kind_phys), dimension(IJSDIM,KMAX,nctp) :: vverti + real(kind_phys), dimension(IJSDIM,KMAX+1,nctp) :: vverti, sigmai real(kind_phys) GTT(IJSDIM,KMAX) !< temperature tendency [K/s] real(kind_phys) GTQ(IJSDIM,KMAX,NTR) !< tracer tendency [kg/kg/s] real(kind_phys) GTU(IJSDIM,KMAX) !< zonal velocity tendency [m/s2] real(kind_phys) GTV(IJSDIM,KMAX) !< meridional velocity tendency [m/s2] - real(kind_phys) GTPRP(IJSDIM,KMAX) !< precipitation (including snowfall) flux at interfaces [kg/m2/s] - real(kind_phys) GSNWP(IJSDIM,KMAX) !< snowfall flux at interfaces [kg/m2/s] - + real(kind_phys) CMDET(IJSDIM,KMAX) !< detrainment mass flux [kg/m2/s] + real(kind_phys) GTPRP(IJSDIM,KMAX+1) !< precipitation (including snowfall) flux at interfaces [kg/m2/s] + real(kind_phys) GSNWP(IJSDIM,KMAX+1) !< snowfall flux at interfaces [kg/m2/s] + real(kind_phys) GMFX0(IJSDIM,KMAX+1) !< updraft mass flux [kg/m2/s] + real(kind_phys) GMFX1(IJSDIM,KMAX+1) !< downdraft mass flux [kg/m2/s] integer KT(IJSDIM,nctp) !< cloud top index for each cloud type real(kind_phys) :: cape(IJSDIM) !< convective available potential energy (J/kg) @@ -377,13 +380,14 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & !> -# Initialize the sigma diagnostics do n=1,nctp - do k=1,kmax + do k=1,kmax+1 do i=ists,iens vverti(i,k,n) = zero + sigmai(i,k,n) = zero enddo enddo enddo - do k=1,kmax + do k=1,kmax+1 do i=ists,iens sigma(i,k) = zero enddo @@ -394,9 +398,9 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & otspt(1:ntr,1), otspt(1:ntr,2), & lprnt , ipr , & GTT , GTQ , GTU , GTV , & ! output - dt_mf , & ! output - GTPRP , GSNWP , ud_mf , & ! output - dd_mf , cape , KT , & ! output + CMDET , & ! output + GTPRP , GSNWP , GMFX0 , & ! output + GMFX1 , cape , KT , & ! output CBMFX , & ! modified GDT , GDQ , GDU , GDV , & ! input GDTM , & ! input @@ -404,7 +408,7 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & delp , delpi , & DELTA , DELTI , ISTS , IENS, mype,& ! input fscav, fswtr, wcbmaxm, nctp, & - sigma, vverti, & ! input/output !DDsigma + sigmai, sigma, vverti, & ! input/output !DDsigma do_aw, do_awdd, flx_form) ! ! @@ -432,6 +436,10 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & t(i,k) = GDT(i,k) + GTT(i,k) * delta u(i,k) = GDU(i,k) + GTU(i,k) * delta v(i,k) = GDV(i,k) + GTV(i,k) * delta +! Set the mass fluxes. + ud_mf (i,k) = GMFX0(i,k) + dd_mf (i,k) = GMFX1(i,k) + dt_mf (i,k) = CMDET(i,k) enddo enddo @@ -458,8 +466,8 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! CNV_PRC3(i,k) = 0.0 CNV_NDROP(i,k) = 0.0 CNV_NICE(i,k) = 0.0 - cf_upi(i,k) = max(0.0, min(1.0, 0.5*(sigma(i,k)+sigma(i,kp1)))) - CLCN(i,k) = cf_upi(i,k) !downdraft is below updraft +! cf_upi(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)),0.1)) +! CLCN(i,k) = cf_upi(i,k) !downdraft is below updraft !! clcn(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)/delta),0.25)) w_upi(i,k) = 0.0 @@ -492,9 +500,9 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! CNV_PRC3(i,k) = 0.0 CNV_NDROP(i,k) = 0.0 CNV_NICE(i,k) = 0.0 - cf_upi(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)),0.25)) +! cf_upi(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)),0.1)) ! & 500*ud_mf(i,k)),0.60)) - CLCN(i,k) = cf_upi(i,k) !downdraft is below updraft +! CLCN(i,k) = cf_upi(i,k) !downdraft is below updraft w_upi(i,k) = ud_mf(i,k)*(t(i,k)+epsvt*gdq(i,k,1)) * rair & / (max(cf_upi(i,k),1.e-12)*gdp(i,k)) @@ -586,11 +594,11 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions GDT , GDQ , GDU , GDV , & ! input GDTM , & ! input GDP , GDPM , GDZ , GDZM , & ! input - delp , delpi , & + delp , delpinv , & DELTA , DELTI , ISTS , IENS, mype,& ! input fscav, fswtr, wcbmaxm, nctp, & ! - sigma, vverti, & ! input/output !DDsigma - do_aw, do_awdd, flx_form ) + sigmai, sigma, vverti, & ! input/output !DDsigma + do_aw, do_awdd, flx_form) ! IMPLICIT NONE @@ -598,6 +606,8 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions INTEGER, INTENT(IN) :: im, IJSDIM, KMAX, NTR, mype, nctp, ipr !! DD, for GFS, pass in logical, intent(in) :: do_aw, do_awdd, flx_form ! switch to apply Arakawa-Wu to the tendencies logical, intent(in) :: otspt1(ntr), otspt2(ntr), lprnt + REAL(kind_phys),intent(in) :: DELP (IJSDIM, KMAX) + REAL(kind_phys),intent(in) :: DELPINV (IJSDIM, KMAX) ! ! [OUTPUT] REAL(kind_phys), INTENT(OUT) :: GTT (IJSDIM, KMAX ) ! heating rate @@ -605,35 +615,35 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions REAL(kind_phys), INTENT(OUT) :: GTU (IJSDIM, KMAX ) ! tendency of u REAL(kind_phys), INTENT(OUT) :: GTV (IJSDIM, KMAX ) ! tendency of v REAL(kind_phys), INTENT(OUT) :: CMDET (IJSDIM, KMAX ) ! detrainment mass flux - + REAL(kind_phys) :: GTLDET( IJSDIM, KMAX ) ! cloud liquid tendency by detrainment + REAL(kind_phys) :: GTIDET( IJSDIM, KMAX ) ! cloud ice tendency by detrainment ! assuming there is no flux at the top of the atmospherea - Moorthi - REAL(kind_phys), INTENT(OUT) :: GTPRP (IJSDIM, KMAX ) ! rain+snow flux - REAL(kind_phys), INTENT(OUT) :: GSNWP (IJSDIM, KMAX ) ! snowfall flux - REAL(kind_phys), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX ) ! updraft mass flux - REAL(kind_phys), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX ) ! downdraft mass flux + REAL(kind_phys), INTENT(OUT) :: GTPRP (IJSDIM, KMAX+1 ) ! rain+snow flux + REAL(kind_phys), INTENT(OUT) :: GSNWP (IJSDIM, KMAX+1 ) ! snowfall flux + REAL(kind_phys), INTENT(OUT) :: GMFX0 (IJSDIM, KMAX+1 ) ! updraft mass flux + REAL(kind_phys), INTENT(OUT) :: GMFX1 (IJSDIM, KMAX+1 ) ! downdraft mass flux REAL(kind_phys), INTENT(OUT) :: CAPE (IJSDIM ) INTEGER , INTENT(OUT) :: KT (IJSDIM, NCTP ) ! cloud top ! ! [MODIFIED] - REAL(kind_phys), INTENT(INOUT) :: CBMFX (IM, NCTP) ! cloud base mass flux - -!DDsigma - output added for AW sigma diagnostics -! sigma and vert. velocity as a function of cloud type (1==sfc) - real(kind_phys), intent(out), dimension(IM,KMAX) :: sigma !sigma totaled over cloud type - on interfaces (1=sfc) - real(kind_phys), intent(out), dimension(IM,KMAX,nctp) :: vverti + REAL(kind_phys), INTENT(INOUT) :: CBMFX ( IM, NCTP ) !! cloud base mass flux + !DDsigma - output added for AW sigma diagnostics + real(kind_phys), intent(out) :: sigmai(IM,KMAX+1,nctp) !DDsigma sigma by cloud type - on interfaces (1=sfc) + real(kind_phys), intent(out) :: vverti(IM,KMAX+1,nctp) !DDsigma vert. vel. by cloud type - on interfaces (1=sfc) + real(kind_phys), intent(out) :: sigma(IM,KMAX+1) !DDsigma sigma totaled over cloud type - on interfaces (1=sfc) + ! for computing AW flux form of tendencies -! The tendencies are summed over all cloud types -! real(kind_phys), intent(out), dimension(IM,KMAX) :: & !DDsigmadiag - real(kind_phys), allocatable, dimension(:,:) :: sfluxterm, qvfluxterm,& ! tendencies of DSE and water vapor due to eddy mass flux - qlfluxterm, qifluxterm,& ! tendencies of cloud water and cloud ice due to eddy mass flux +! real(kind_phys), dimension(IM,KMAX) :: & !DDsigmadiag +! sfluxterm, qvfluxterm +! real(kind_phys), dimension(IM,KMAX) :: & !DDsigmadiag +! qlfluxterm, qifluxterm +! real(kind_phys), dimension(ijsdim,kmax,ntrq:ntr) :: trfluxterm ! tendencies of tracers due to eddy mass flux + real(kind_phys), dimension(IM,KMAX) :: & !DDsigmadiag + condtermt, condtermq, frzterm, prectermq, prectermfrz + !DDsigma -! The fluxes are for an individual cloud type and reused. -! condtermt, condtermq are eddy flux of temperature and water vapor - condtermt, condtermq, frzterm, & - prectermq, prectermfrz - real(kind_phys), allocatable, dimension(:,:,:) :: trfluxterm ! tendencies of tracers due to eddy mass flux ! ! [INPUT] REAL(kind_phys), INTENT(IN) :: GDT (IJSDIM, KMAX ) ! temperature T @@ -653,167 +663,190 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! ! [INTERNAL WORK] REAL(kind_phys), allocatable :: GPRCC (:, :) ! rainfall -! REAL(kind_phys) GPRCC (IJSDIM, NTR) ! rainfall -! REAL(kind_phys) GSNWC (IJSDIM) ! snowfall -! REAL(kind_phys) CUMCLW(IJSDIM, KMAX) ! cloud water in cumulus -! REAL(kind_phys) CUMFRC(IJSDIM) ! cumulus cloud fraction -! -! REAL(kind_phys) GTCFRC(IJSDIM, KMAX) ! change in cloud fraction -! REAL(kind_phys) FLIQC (IJSDIM, KMAX) ! liquid ratio in cumulus -! -! REAL(kind_phys) GDCFRC(IJSDIM, KMAX) ! cloud fraction -! - REAL(kind_phys) GDW (IJSDIM, KMAX) ! total water - REAL(kind_phys) DELP (IJSDIM, KMAX) - REAL(kind_phys) DELPI (IJSDIM, KMAX) - REAL(kind_phys) GDQS (IJSDIM, KMAX) ! saturate moisture - REAL(kind_phys) FDQS (IJSDIM, KMAX) - REAL(kind_phys) GAM (IJSDIM, KMAX) - REAL(kind_phys) GDS (IJSDIM, KMAX) ! dry static energy - REAL(kind_phys) GDH (IJSDIM, KMAX) ! moist static energy - REAL(kind_phys) GDHS (IJSDIM, KMAX) ! saturate MSE -! - REAL(kind_phys) GCYM (IJSDIM, KMAX, NCTP)! norm. mass flux (half lev) - REAL(kind_phys) GCHB (IJSDIM) ! cloud base MSE-Li*Qi - REAL(kind_phys) GCWB (IJSDIM) ! cloud base total water - REAL(kind_phys) GCUB (IJSDIM) ! cloud base U - REAL(kind_phys) GCVB (IJSDIM) ! cloud base V - REAL(kind_phys) GCIB (IJSDIM) ! cloud base ice - REAL(kind_phys) GCtrB (IJSDIM,ntrq:ntr) ! cloud base tracer - REAL(kind_phys) GCYT (IJSDIM, NCTP) ! norm. mass flux @top - REAL(kind_phys) GCHT (IJSDIM, NCTP) ! cloud top MSE - REAL(kind_phys) GCQT (IJSDIM, NCTP) ! cloud top q - REAL(kind_phys) GCwT (IJSDIM) ! cloud top total water - REAL(kind_phys) GCUT (IJSDIM, NCTP) ! cloud top U - REAL(kind_phys) GCVT (IJSDIM, NCTP) ! cloud top V - REAL(kind_phys) GCLT (IJSDIM, NCTP) ! cloud top cloud water - REAL(kind_phys) GCIT (IJSDIM, NCTP) ! cloud top cloud ice + REAL(kind_phys) GSNWC ( IJSDIM ) !! snowfall + REAL(kind_phys) CUMCLW( IJSDIM, KMAX ) !! cloud water in cumulus + REAL(kind_phys) CUMFRC( IJSDIM ) !! cumulus cloud fraction +!COSP + REAL(kind_phys) QLIQC ( IJSDIM, KMAX ) !! cumulus cloud liquid water [kg/kg] + REAL(kind_phys) QICEC ( IJSDIM, KMAX ) !! cumulus cloud ice [kg/kg] + REAL(kind_phys) GPRCPF( IJSDIM, KMAX ) !! rainfall flux at full level + REAL(kind_phys) GSNWPF( IJSDIM, KMAX ) !! snowfall flux at full level +! + REAL(kind_phys) GTCFRC( IJSDIM, KMAX ) !! change in cloud fraction + REAL(kind_phys) FLIQC ( IJSDIM, KMAX ) !! liquid ratio in cumulus +! +!#ifdef OPT_CHASER +! REAL(kind_phys) RFXC ( IJSDIM, KMAX+1 ) !! precipi. flx [kg/m2/s] +! REAL(kind_phys) SFXC ( IJSDIM, KMAX+1 ) !! ice/snow flx [kg/m2/s] +! INTEGER LEVCUM( IJSDIM, KMAX ) !! flag for cum. cloud top +! REAL(kind_phys) LNFRC ( IJSDIM, KMAX ) !! areal rates of clouds +! REAL(kind_phys) REVC ( IJSDIM, KMAX ) !! evaporation rates +!#endif +! + REAL(kind_phys) GDCFRC( IJSDIM, KMAX ) !! cloud fraction +! +! REAL(kind_phys) GTQL ( IJSDIM, KMAX ) !! tendency of cloud liquid +! + REAL(kind_phys) GDW ( IJSDIM, KMAX ) !! total water + REAL(kind_phys) GDQS ( IJSDIM, KMAX ) !! saturate moisture + REAL(kind_phys) FDQS ( IJSDIM, KMAX ) + REAL(kind_phys) GAM ( IJSDIM, KMAX ) + REAL(kind_phys) GDS ( IJSDIM, KMAX ) !! dry static energy + REAL(kind_phys) GDH ( IJSDIM, KMAX ) !! moist static energy + REAL(kind_phys) GDHS ( IJSDIM, KMAX ) !! saturate MSE +! + REAL(kind_phys) GCYM ( IJSDIM, KMAX, NCTP ) !! norm. mass flux (half lev) + REAL(kind_phys) GCHB ( IJSDIM ) !! cloud base MSE-Li*Qi + REAL(kind_phys) GCWB ( IJSDIM ) !! cloud base total water + REAL(kind_phys) GCtrB ( IJSDIM, ntrq:ntr ) !! cloud base water vapor tracer + REAL(kind_phys) GCUB ( IJSDIM ) !! cloud base U + REAL(kind_phys) GCVB ( IJSDIM ) !! cloud base V + REAL(kind_phys) GCIB ( IJSDIM ) !! cloud base ice + REAL(kind_phys) ELAM ( IJSDIM, KMAX, NCTP ) !! entrainment (rate*massflux) + REAL(kind_phys) GCYT ( IJSDIM, NCTP ) !! norm. mass flux @top + REAL(kind_phys) GCHT ( IJSDIM, NCTP ) !! cloud top MSE + REAL(kind_phys) GCQT ( IJSDIM, NCTP ) !! cloud top q + REAL(kind_phys) GCwT ( IJSDIM ) !! cloud top total water + REAL(kind_phys) GCUT ( IJSDIM, NCTP ) !! cloud top U + REAL(kind_phys) GCVT ( IJSDIM, NCTP ) !! cloud top V + REAL(kind_phys) GCLT ( IJSDIM, NCTP ) !! cloud top cloud water + REAL(kind_phys) GCIT ( IJSDIM, NCTP ) !! cloud top cloud ice REAL(kind_phys) GCtrT (IJSDIM, ntrq:ntr, NCTP) ! cloud top tracer - REAL(kind_phys) GTPRT (IJSDIM, NCTP) ! precipitation/M - REAL(kind_phys) GCLZ (IJSDIM, KMAX) ! cloud liquid for each CTP - REAL(kind_phys) GCIZ (IJSDIM, KMAX) ! cloud ice for each CTP - -! REAL(kind_phys) ACWF (IJSDIM, NCTP) ! cloud work function - REAL(kind_phys) ACWF (IJSDIM ) ! cloud work function - REAL(kind_phys) GPRCIZ(IJSDIM, KMAX) ! precipitation - REAL(kind_phys) GSNWIZ(IJSDIM, KMAX) ! snowfall - REAL(kind_phys) GTPRC0(IJSDIM) ! precip. before evap. - - REAL(kind_phys) GMFLX (IJSDIM, KMAX) ! mass flux (updraft+downdraft) - REAL(kind_phys) QLIQ (IJSDIM, KMAX) ! total cloud liquid - REAL(kind_phys) QICE (IJSDIM, KMAX) ! total cloud ice - REAL(kind_phys) GPRCI (IJSDIM, KMAX) ! rainfall generation - REAL(kind_phys) GSNWI (IJSDIM, KMAX) ! snowfall generation - - REAL(kind_phys) GPRCP (IJSDIM, KMAX) ! rainfall flux -! - REAL(kind_phys) GTEVP (IJSDIM, KMAX) ! evaporation+sublimation - REAL(kind_phys) GMDD (IJSDIM, KMAX) ! downdraft mass flux - -! REAL(kind_phys) CUMHGT(IJSDIM, NCTP) ! cloud top height -! REAL(kind_phys) CTOPP (IJSDIM) ! cloud top pressure - - REAL(kind_phys) GDZTR (IJSDIM) ! tropopause height -! REAL(kind_phys) FLIQOU(IJSDIM, KMAX) ! liquid ratio in cumulus - INTEGER KB (IJSDIM) - INTEGER KSTRT (IJSDIM) ! tropopause level - REAL(kind_phys) GAMX - REAL(kind_phys) CIN (IJSDIM) - INTEGER JBUOY (IJSDIM) - REAL(kind_phys) DELZ, BUOY, DELWC, DELER - REAL(kind_phys) WCBX (IJSDIM) -! REAL(kind_phys) ERMR (NCTP) ! entrainment rate (ASMODE) -! SAVE ERMR - INTEGER KTMX (NCTP) ! max of cloud top - INTEGER KTMXT ! max of cloud top -! REAL(kind_phys) TIMED - REAL(kind_phys) GDCLDX, GDMU2X, GDMU3X -! -! REAL(kind_phys) HBGT (IJSDIM) ! imbalance in column heat -! REAL(kind_phys) WBGT (IJSDIM) ! imbalance in column water + REAL(kind_phys) GTPRT ( IJSDIM, NCTP ) !! precipitation/M + REAL(kind_phys) GCLZ ( IJSDIM, KMAX ) !! cloud liquid for each CTP + REAL(kind_phys) GCIZ ( IJSDIM, KMAX ) !! cloud ice for each CTP + + REAL(kind_phys) ACWF ( IJSDIM ) !! cloud work function + REAL(kind_phys) GPRCIZ( IJSDIM, KMAX+1, NCTP ) !! precipitation + REAL(kind_phys) GSNWIZ( IJSDIM, KMAX+1, NCTP ) !! snowfall + REAL(kind_phys) GTPRC0( IJSDIM ) !! precip. before evap. + + REAL(kind_phys) GMFLX ( IJSDIM, KMAX+1 ) !! mass flux (updraft+downdraft) + REAL(kind_phys) QLIQ ( IJSDIM, KMAX ) !! total cloud liquid + REAL(kind_phys) QICE ( IJSDIM, KMAX ) !! total cloud ice + REAL(kind_phys) GPRCI ( IJSDIM, KMAX ) !! rainfall generation + REAL(kind_phys) GSNWI ( IJSDIM, KMAX ) !! snowfall generation + + REAL(kind_phys) GPRCP ( IJSDIM, KMAX+1 ) !! rainfall flux +! + REAL(kind_phys) GTEVP ( IJSDIM, KMAX ) !! evaporation+sublimation + REAL(kind_phys) GMDD ( IJSDIM, KMAX+1 ) !! downdraft mass flux + + REAL(kind_phys) CUMHGT( IJSDIM, NCTP ) !! cloud top height + REAL(kind_phys) CTOPP ( IJSDIM ) !! cloud top pressure + + REAL(kind_phys) GDZTR ( IJSDIM ) !! tropopause height + REAL(kind_phys) FLIQOU( IJSDIM, KMAX ) !! liquid ratio in cumulus +!#ifdef OPT_CHASER +! REAL(kind_phys) TOPFLX( IJSDIM, NCTP ) !! flux at each cloud top +!#endif + INTEGER KB ( IJSDIM ) + INTEGER KSTRT ( IJSDIM ) !! tropopause level + REAL(kind_phys) GAMX + REAL(kind_phys) CIN ( IJSDIM ) + INTEGER JBUOY ( IJSDIM ) + REAL(kind_phys) DELZ, BUOY, DELWC, DELER +!M REAL(kind_phys) WCB ( NCTP ) !! updraft velocity**2 @base +!M SAVE WCB + REAL(kind_phys) WCBX (IJSDIM) +! REAL(kind_phys) ERMR ( NCTP ) !! entrainment rate (ASMODE) +! SAVE ERMR + INTEGER KTMX ( NCTP ) !! max of cloud top + INTEGER KTMXT !! max of cloud top + REAL(kind_phys) TIMED + REAL(kind_phys) GDCLDX, GDMU2X, GDMU3X +! + LOGICAL OOUT1, OOUT2 + INTEGER KBMX, I, K, CTP, ierr, n, kp1, l, l1, kk, kbi, kmi, km1 + real(kind_phys) tem1, tem2, tem3, cbmfl, mflx_e, teme, tems + + REAL(kind_phys) HBGT ( IJSDIM ) !! imbalance in column heat + REAL(kind_phys) WBGT ( IJSDIM ) !! imbalance in column water -!DDsigma begin local work variables - all on model interfaces (sfc=1) - REAL(kind_phys) lamdai ! lamda for cloud type ctp - REAL(kind_phys) gdqm, gdlm, gdim ! water vapor + !DDsigma begin local work variables - all on model interfaces (sfc=1) + REAL(kind_phys) lamdai( IJSDIM, KMAX+1, nctp ) !! lamda for cloud type ctp + REAL(kind_phys) lamdaprod( IJSDIM, KMAX+1 ) !! product of (1+lamda) through cloud type ctp + REAL(kind_phys) gdrhom !! density + REAL(kind_phys) gdtvm !! virtual temperature + REAL(kind_phys) gdqm, gdwm,gdlm, gdim !! water vaper REAL(kind_phys) gdtrm(ntrq:ntr) ! tracer - -! the following are new arguments to cumup to get them out for AW - REAL(kind_phys) wcv (IJSDIM, KMAX) ! in-cloud vertical velocity - REAL(kind_phys) GCTM (IJSDIM, KMAX) ! cloud T (half lev) !DDsigmadiag make output - REAL(kind_phys) GCQM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GCwM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GCiM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GClM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GChM (IJSDIM, KMAX) ! cloud q (half lev) !DDsigmadiag make output + character(len=4) :: cproc !DDsigmadiag + + ! the following are new arguments to cumup to get them out + REAL(kind_phys) wcv( IJSDIM, KMAX+1, nctp) !! in-cloud vertical velocity + REAL(kind_phys) GCTM ( IJSDIM, KMAX+1 ) !! cloud T (half lev) !DDsigmadiag make output + REAL(kind_phys) GCQM ( IJSDIM, KMAX+1, nctp ) !! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCwM ( IJSDIM, KMAX+1, nctp ) !! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCiM ( IJSDIM, KMAX+1 ) !! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GClM ( IJSDIM, KMAX+1 ) !! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GChM ( IJSDIM, KMAX+1, nctp ) !! cloud q (half lev) !DDsigmadiag make output REAL(kind_phys) GCtrM (IJSDIM, KMAX, ntrq:ntr) ! cloud tracer (half lev) !DDsigmadiag make output - -! eddy flux profiles for dse, water vapor, cloud water, cloud ice - REAL(kind_phys), dimension(Kmax+1) :: sfluxtem, qvfluxtem, qlfluxtem, qifluxtem - REAL(kind_phys), dimension(Kmax+1,ntrq:ntr) :: trfluxtem ! tracer - -! tendency profiles - condensation heating, condensation moistening, heating due to -! freezing, total precip production, frozen precip production - REAL(kind_phys), dimension(ijsdim,Kmax) :: dtcondtem, dqcondtem, dtfrztem, dqprectem,& ! Moorthi - dfrzprectem, lamdaprod !< product of (1+lamda) through cloud type ctp - REAL(kind_phys), dimension(ijsdim,Kmax) :: dtevap, dqevap, dtmelt, dtsubl - -! factor to modify precip rate to force conservation of water. With bug fixes it's -! not doing anything now. - REAL(kind_phys), dimension(ijsdim) :: moistening_aw - real(kind_phys), dimension(ijsdim,kmax) :: gctbl, gcqbl,gcwbl, gcqlbl, gcqibl, & !DDsigmadiag updraft profiles below cloud Base - sigmad ! downdraft area fraction + +! these are the fluxes at the interfaces - AW will operate on them + REAL(kind_phys), dimension(ijsdim,Kmax+1,nctp) :: sfluxtem, qvfluxtem, qlfluxtem, qifluxtem + REAL(kind_phys), dimension(ijsdim,Kmax+1,ntrq:ntr,nctp) :: trfluxtem ! tracer + + REAL(kind_phys), dimension(ijsdim,Kmax+1) :: dtcondtem, dqcondtem, dtfrztem, dqprectem,dfrzprectem + REAL(kind_phys), dimension(ijsdim,Kmax) :: dtevap, dqevap, dtmelt, dtsubl + REAL(kind_phys), dimension(ijsdim) :: moistening_aw + real(kind_phys) rhs_q, rhs_h, sftem, qftem, qlftem, qiftem + real(kind_phys), dimension(ijsdim,kmax+1) :: gctbl, gcqbl,gcwbl, gcqlbl, gcqibl !DDsigmadiag updraft profiles below cloud Base real(kind_phys), dimension(ijsdim,kmax,ntrq:ntr) :: gctrbl !DDsigmadiag tracer updraft profiles below cloud Base -! rhs_q, rhs_h are residuals of condensed water, MSE budgets to compute condensation, -! and heating due to freezing - real(kind_phys) :: rhs_q, rhs_h, fsigma, sigmai, delpinv -! real(kind_phys) :: rhs_q, rhs_h, sftem, qftem, qlftem, qiftem, & -! fsigma ! factor to reduce mass flux terms (1-sigma**2) for AW -!DDsigma end local work variables -! -! profiles of heating due to precip evaporation, melting and sublimation, and the -! evap, melting and sublimation rates. - - REAL(kind_phys), allocatable, dimension(:,:) :: dtdwn, & ! t tendency downdraft detrainment - dqvdwn, & ! qv tendency downdraft detrainment - dqldwn, & ! ql tendency downdraft detrainment - dqidwn ! qi tendency downdraft detrainment - REAL(kind_phys), allocatable, dimension(:,:,:) :: dtrdwn ! tracer tendency downdraft detrainment - + real(kind_phys), dimension(ijsdim,kmax+1) :: sigmad + real(kind_phys) :: fsigma( IJSDIM, KMAX+1 ) ! factor to reduce mass flux terms (1-sigma**2) for AW + real(kind_phys) :: lamdamax ! for sorting lamda values + integer loclamdamax + real(kind_phys) :: pr_tot, pr_ice, pr_liq !DDsigma end local work variables ! ! [INTERNAL PARM] - REAL(kind_phys), parameter :: WCBMIN = zero ! min. of updraft velocity at cloud base - -!M REAL(kind_phys) :: WCBMAX = 1.4_kind_phys ! max. of updraft velocity at cloud base + REAL(kind_phys) :: WCBMIN = 0._kind_phys !! min. of updraft velocity at cloud base +!M REAL(kind_phys) :: WCBMAX = 1.4_kind_phys !! max. of updraft velocity at cloud base !M wcbas commented by Moorthi since it is not used -!M REAL(kind_phys) :: WCBAS = 2._kind_phys ! updraft velocity**2 at cloud base (ASMODE) -!M REAL(kind_phys) :: ERAMIN = 1.e-5_kind_phys ! min. of entrainment rate - ! used only in OPT_ASMODE -!M REAL(kind_phys) :: ERAMAX = 2.e-3_kind_phys ! max. of entrainment rate - ! used only in OPT_ASMODE - LOGICAL :: OINICB = .false. ! set 0.d0 to CBMFX when .true. - -! REAL(kind_phys) :: VARMIN = 1.e-13_kind_phys ! minimum of PDF variance -! REAL(kind_phys) :: VARMAX = 5.e-7_kind_phys ! maximum of PDF variance -! REAL(kind_phys) :: SKWMAX = 0.566_kind_phys ! maximum of PDF skewness +!M REAL(kind_phys) :: WCBAS = 2._kind_phys !! updraft velocity**2 at cloud base (ASMODE) +!M REAL(kind_phys) :: ERAMIN = 1.e-5_kind_phys !! min. of entrainment rate + !! used only in OPT_ASMODE +!M REAL(kind_phys) :: ERAMAX = 2.e-3_kind_phys !! max. of entrainment rate + !! used only in OPT_ASMODE +! downdraft mass flux terms now slot nctp+1 in the *fluxterm arrays + REAL(kind_phys) dtdwn ( IJSDIM, KMAX ) !! t tendency downdraft detrainment + REAL(kind_phys) dqvdwn ( IJSDIM, KMAX ) !! qv tendency downdraft detrainment + REAL(kind_phys) dqldwn ( IJSDIM, KMAX ) !! ql tendency downdraft detrainment + REAL(kind_phys) dqidwn ( IJSDIM, KMAX ) !! qi tendency downdraft detrainment + REAL(kind_phys), dimension(ijsdim,kmax,ntrq:ntr) :: dtrdwn ! tracer tendency downdraft detrainment + + LOGICAL :: OINICB = .false. !! set 0.d0 to CBMFX + + REAL(kind_phys) :: VARMIN = 1.e-13_kind_phys !! minimum of PDF variance + REAL(kind_phys) :: VARMAX = 5.e-7_kind_phys !! maximum of PDF variance + REAL(kind_phys) :: SKWMAX = 0.566_kind_phys !! maximum of PDF skewness + + REAL(kind_phys) :: PSTRMX = 400.e2_kind_phys !! max P of tropopause + REAL(kind_phys) :: PSTRMN = 50.e2_kind_phys !! min P of tropopause + REAL(kind_phys) :: GCRSTR = 1.e-4_kind_phys !! crit. dT/dz tropopause - REAL(kind_phys) :: PSTRMX = 400.e2_kind_phys ! max P of tropopause - REAL(kind_phys) :: PSTRMN = 50.e2_kind_phys ! min P of tropopause - REAL(kind_phys) :: GCRSTR = 1.e-4_kind_phys ! crit. dT/dz tropopause - - real(kind=kind_phys) :: tem, esat, mflx_e, cbmfl, tem1, tem2, tem3 - INTEGER :: KBMX, I, K, CTP, ierr, n, kp1, km1, kk, kbi, l, l1 + ! 0: mass fixer is not applied + ! tracers which may become negative values + ! e.g. subgrid-PDFs + ! 1: mass fixer is applied, total mass may change through cumulus scheme + ! e.g. moisture, liquid cloud, ice cloud, aerosols + ! 2: mass fixer is applied, total mass never change through cumulus scheme + ! e.g. CO2 + real(kind=kind_phys), parameter :: zero=0.0, one=1.0 + real(kind=kind_phys) :: tem, esat ! - LOGICAL, SAVE :: OFIRST = .TRUE. ! called first time? + LOGICAL, SAVE :: OFIRST = .TRUE. !! called first time? ! + IF ( OFIRST ) THEN - IF (OFIRST) THEN OFIRST = .FALSE. IF (OINICB) THEN CBMFX = zero ENDIF ENDIF ! + + kp1 = kmax + 1 do n=1,ntr do k=1,kmax do i=1,ijsdim @@ -821,65 +854,82 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions enddo enddo enddo - + do k=1,kmax+1 + do i=1,ijsdim + gmflx(i,k) = zero + gmfx0(i,k) = zero + enddo + enddo do k=1,kmax do i=1,ijsdim - gtt(i,k) = zero - gtu(i,k) = zero - gtv(i,k) = zero - gmflx(i,k) = zero - gmfx0(i,k) = zero - gprci(i,k) = zero - gsnwi(i,k) = zero - qliq(i,k) = zero - qice(i,k) = zero -! gtcfrc(i,k) = zero -! cumclw(i,k) = zero -! fliqc(i,k) = zero - sigma(i,k) = zero + gtt(i,k) = zero + gtu(i,k) = zero + gtv(i,k) = zero + gprci(i,k) = zero + gsnwi(i,k) = zero + qliq(i,k) = zero + qice(i,k) = zero +! gtcfrc(i,k) = zero +! cumclw(i,k) = zero +! fliqc(i,k) = zero + fliqou(i,k) = zero + gprcpf(i,k) = zero + gsnwpf(i,k) = zero + cmdet(i,k) = zero enddo enddo if (flx_form) then - allocate(sfluxterm(ijsdim,kmax), qvfluxterm(ijsdim,kmax), qlfluxterm(ijsdim,kmax), & - qifluxterm(ijsdim,kmax), condtermt(ijsdim,kmax), condtermq(ijsdim,kmax), & - frzterm(ijsdim,kmax), prectermq(ijsdim,kmax), prectermfrz(ijsdim,kmax), & - dtdwn(ijsdim,kmax), dqvdwn(ijsdim,kmax), dqldwn(ijsdim,kmax), & - dqidwn(ijsdim,kmax), trfluxterm(ijsdim,kmax,ntrq:ntr), & - dtrdwn(ijsdim,kmax,ntrq:ntr)) - do k=1,kmax - do i=1,ijsdim - sfluxterm(i,k) = zero - qvfluxterm(i,k) = zero - qlfluxterm(i,k) = zero - qifluxterm(i,k) = zero - condtermt(i,k) = zero - condtermq(i,k) = zero - frzterm(i,k) = zero - prectermq(i,k) = zero - prectermfrz(i,k) = zero - dtdwn(i,k) = zero - dqvdwn(i,k) = zero - dqldwn(i,k) = zero - dqidwn(i,k) = zero - cmdet(i,k) = zero + do ctp = 1,nctp + do k=1,kp1 + do i=1,ijsdim + sfluxtem(i,k,ctp) = zero + qvfluxtem(i,k,ctp) = zero + qlfluxtem(i,k,ctp) = zero + qifluxtem(i,k,ctp) = zero + enddo + enddo + do n = ntrq,ntr + do k=1,kp1 + do i=1,ijsdim + trfluxtem(i,k,n,ctp) = zero + enddo + enddo enddo enddo - do n = ntrq,ntr do k=1,kmax do i=1,ijsdim - trfluxterm(i,k,n) = zero - dtrdwn(i,k,n) = zero + condtermt(i,k) = zero + condtermq(i,k) = zero + frzterm(i,k) = zero + prectermq(i,k) = zero + prectermfrz(i,k) = zero enddo enddo - enddo + do k=1,kmax + do i=1,ijsdim + dtdwn(i,k) = zero + dqvdwn(i,k) = zero + dqldwn(i,k) = zero + dqidwn(i,k) = zero + enddo + enddo + do n = ntrq,ntr + do k=1,kmax + do i=1,ijsdim + dtrdwn(i,k,n) = zero + enddo + enddo + enddo endif do i=1,ijsdim -! gprcc(i,:) = zero - gtprc0(i) = zero -! hbgt(i) = zero -! wbgt(i) = zero - gdztr(i) = zero - kstrt(i) = kmax +! gprcc(i,:) = zero +! gmflx(i,kp1) = zero + gmfx0(i,kp1) = zero + gtprc0(i) = zero +! hbgt(i) = zero +! wbgt(i) = zero + gdztr(i) = zero + kstrt(i) = kmax enddo do k=1,kmax @@ -907,9 +957,8 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! !> -# Compute tropopause height (GDZTR) DO K=1,KMAX - kp1 = k + 1 DO I=ISTS,IENS - GAMX = (GDTM(I,KP1)-GDTM(I,K)) / (GDZM(I,KP1)-GDZM(I,K)) + GAMX = (GDTM(I,K+1)-GDTM(I,K)) / (GDZM(I,K+1)-GDZM(I,K)) IF ((GDP(I,K) < PSTRMX .AND. GAMX > GCRSTR) .OR. GDP(I,K) < PSTRMN) THEN KSTRT(I) = MIN(K, KSTRT(I)) ENDIF @@ -925,12 +974,12 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions !> -# Call cumbas() to compute cloud base properties CALL CUMBAS(IJSDIM, KMAX , & !DD dimensions - KB , GCYM(1,1,1) , KBMX , & ! output + KB , GCYM(:,:,1) , KBMX , & ! output ntr , ntrq , & GCHB , GCWB , GCUB , GCVB , & ! output GCIB , gctrb, & ! output GDH , GDW , GDHS , GDQS , & ! input - GDQ(1,1,iti) , GDU , GDV , GDZM , & ! input + GDQ(:,:,iti) , GDU , GDV , GDZM , & ! input GDPM , FDQS , GAM , & ! input lprnt, ipr, & ISTS , IENS , & !) ! input @@ -955,7 +1004,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions CAPE(I) = CAPE(I) + BUOY * GRAV * (GDZM(I,K+1) - GDZM(I,K)) JBUOY(I) = 2 ELSEIF (BUOY < zero .AND. JBUOY(I) /= 2) THEN - CIN(I) = CIN(I) - BUOY * GRAV * (GDZM(I,K+1) - GDZM(I,K)) + CIN(I) = CIN(I) + BUOY * GRAV * (GDZM(I,K+1) - GDZM(I,K)) JBUOY(I) = -1 ENDIF endif @@ -968,12 +1017,25 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions !DDsigma some initialization before summing over cloud type !> -# Initialize variables before summing over cloud types - do k=1,kmax ! Moorthi + if(flx_form) then + do k=1,kp1 ! Moorthi do i=1,ijsdim lamdaprod(i,k) = one + sigma(i,k) = 0.0 enddo enddo + do ctp=1,nctp + do k=1,kp1 + do i=1,ijsdim + lamdai(i,k,ctp) = zero + sigmai(i,k,ctp) = zero + vverti(i,k,ctp) = zero + enddo + enddo + enddo + endif + do ctp=2,nctp do k=1,kmax do i=1,ijsdim @@ -990,15 +1052,6 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions WCBX(I) = DELWC * DELWC enddo - do k=1,kmax ! Moorthi - do i=1,ijsdim - dqcondtem(i,k) = zero - dqprectem(i,k) = zero - dfrzprectem(i,k) = zero - dtfrztem(i,k) = zero - dtcondtem(i,k) = zero - enddo - enddo ! getting more incloud profiles of variables to compute eddy flux tendencies ! and condensation rates @@ -1010,51 +1063,48 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions !> -# Call cumup() to compute in-cloud properties CALL CUMUP(IJSDIM, KMAX, NTR, ntrq, & !DD dimensions ACWF , & ! output - GCLZ , GCIZ , GPRCIZ , GSNWIZ, & ! output - GCYT(1,CTP) , GCHT(1,CTP) , GCQT (1,CTP), & ! output - GCLT(1,CTP) , GCIT(1,CTP) , GTPRT(1,CTP), & ! output - GCUT(1,CTP) , GCVT(1,CTP) , gctrt(1,ntrq:ntr,ctp), & ! output - KT (1,CTP) , KTMX(CTP) , & ! output - GCYM(1,1,CTP) , & ! modified - wcv , & ! !DD-sigma new output + GCLZ , GCIZ , GPRCIZ(:,:,CTP), GSNWIZ(:,:,CTP), & ! output + GCYT(:,CTP) , GCHT(:,CTP) , GCQT (:,CTP), & ! output + GCLT(:,CTP) , GCIT(:,CTP) , GTPRT(:,CTP), & ! output + GCUT(:,CTP) , GCVT(:,CTP) , gctrt(:,ntrq:ntr,ctp), & ! output + KT (:,CTP) , KTMX(CTP) , & ! output + GCYM(:,:,CTP) , & ! modified + wcv(:,:,CTP) , & ! !DD-sigma new output GCHB , GCWB , GCUB , GCVB , & ! input !DDsigmadiag GCIB , gctrb , & ! input GDU , GDV , GDH , GDW , & ! input GDHS , GDQS , GDT , GDTM , & ! input - GDQ , GDQ(1,1,iti) , GDZ , GDZM , & ! input + GDQ , GDQ(:,:,iti) , GDZ , GDZM , & ! input GDPM , FDQS , GAM , GDZTR , & ! input CPRES , WCBX , & ! input KB , CTP , ISTS , IENS , & ! input - gctm , gcqm, gcwm, gchm, gcwt, gclm, gcim, gctrm, & ! additional incloud profiles and cloud top total water + gctm , gcqm(:,:,CTP), gcwm(:,:,CTP), gchm(:,:,CTP),& + gcwt, gclm, gcim, gctrm, & ! additional incloud profiles and cloud top total water lprnt , ipr ) ! !> -# Call cumbmx() to compute cloud base mass flux CALL CUMBMX(IJSDIM, KMAX, & !DD dimensions - CBMFX(1,CTP), & ! modified - ACWF , GCYT(1,CTP), GDZM , & ! input + CBMFX(:,CTP), & ! modified + ACWF , GCYT(:,CTP), GDZM , & ! input GDW , GDQS , DELP , & ! input - KT (1,CTP), KTMX(CTP) , KB , & ! input + KT (:,CTP), KTMX(CTP) , KB , & ! input DELTI , ISTS , IENS ) !DDsigma - begin sigma computation ! At this point cbmfx is updated and we have everything we need to compute sigma - do i=ISTS,IENS - if (flx_form) then -!> -# Initialize eddy fluxes for cloud types - do k=1,kmax+1 - sfluxtem(k) = zero - qvfluxtem(k) = zero - qlfluxtem(k) = zero - qifluxtem(k) = zero - enddo - do n=ntrq,ntr ! tracers - do k=1,kmax+1 - trfluxtem(k,n) = zero - enddo + if (flx_form) then + do k=1,kmax + 1 ! Moorthi + do i=1,ijsdim + dqcondtem(i,k) = zero + dqprectem(i,k) = zero + dfrzprectem(i,k) = zero + dtfrztem(i,k) = zero + dtcondtem(i,k) = zero enddo - endif + enddo + do i=ISTS,IENS cbmfl = cbmfx(i,ctp) kk = kt(i,ctp) ! cloud top index @@ -1062,56 +1112,54 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions kbi = kb(i) ! cloud base index do k=kbi,kk ! loop from cloud base to cloud top km1 = k - 1 - rhs_h = zero - rhs_q = zero -!> -# Interpolate environment variables to layer interface +! get environment variables interpolated to layer interface GDQM = half * (GDQ(I,K,1) + GDQ(I,KM1,1)) ! as computed in cumup ! GDwM = half * (GDw(I,K) + GDw(I,KM1 )) - GDlM = half * (GDQ(I,K,3) + GDQ(I,KM1,3)) - GDiM = half * (GDQ(I,K,2) + GDQ(I,KM1,2)) + GDlM = half * (GDQ(I,K,itl) + GDQ(I,KM1,itl)) + GDiM = half * (GDQ(I,K,iti) + GDQ(I,KM1,iti)) do n = ntrq,NTR GDtrM(n) = half * (GDQ(I,K,n) + GDQ(I,KM1,n)) ! as computed in cumup enddo mflx_e = gcym(i,k,ctp) * cbmfl ! mass flux at level k for cloud ctp - if (do_aw) then !> -# Compute lamda for a cloud type and then updraft area fraction !! (sigmai) following Equations 23 and 12 of !! Arakawa and Wu (2013) \cite arakawa_and_wu_2013 , respectively - lamdai = mflx_e * rair * gdtm(i,k)*(one+epsvt*gdqm) & - / (gdpm(i,k)*wcv(i,k)) - lamdaprod(i,k) = lamdaprod(i,k) * (one+lamdai) - -! vverti(i,k,ctp) = wcv(i,k) -! sigmai(i,k,ctp) = lamdai / lamdaprod(i,k) -! sigma(i,k) = max(zero, min(one, sigma(i,k) + sigmai(i,k,ctp))) - - sigmai = lamdai / lamdaprod(i,k) - sigma(i,k) = max(zero, min(one, sigma(i,k) + sigmai)) - vverti(i,k,ctp) = sigmai * wcv(i,k) - else - sigma(i,k) = 0.0 - endif + lamdai(i,k,ctp) = mflx_e * rair * gdtm(i,k)*(one+epsvt*gdqm) & + / (gdpm(i,k)*wcv(i,k,ctp)) + +! just compute lamdai here, we will compute sigma, sigmai, and vverti outside +! the cloud type loop after we can sort lamdai +! lamdaprod(i,k) = lamdaprod(i,k) * (one+lamdai(i,k,ctp)) +! +!! vverti(i,k,ctp) = wcv(i,k) +!! sigmai(i,k,ctp) = lamdai / lamdaprod(i,k) +!! sigma(i,k) = max(zero, min(one, sigma(i,k) + sigmai(i,k,ctp))) +! +! sigmai(i,k,ctp) = lamdai(i,k,ctp) / lamdaprod(i,k) +! sigma(i,k) = max(zero, min(one, sigma(i,k) + sigmai(i,k,ctp))) +! vverti(i,k,ctp) = sigmai(i,k,ctp) * wcv(i,k,ctp) - if (flx_form) then +! sigma effect won't be applied until later, when lamda is sorted ! fsigma = 1.0 ! no aw effect, comment following lines to undo AW - fsigma = one - sigma(i,k) +! fsigma = one - sigma(i,k) !> -# Compute tendencies based on mass flux and condensation ! fsigma is the AW reduction of flux tendencies if(k == kbi) then do l=2,kbi ! compute eddy fluxes below cloud base - tem = - fsigma * gcym(i,l,ctp) * cbmfl +! tem = - fsigma * gcym(i,l,ctp) * cbmfl + tem = - gcym(i,l,ctp) * cbmfl ! first get environment variables at layer interface l1 = l - 1 GDQM = half * (GDQ(I,l,1) + GDQ(I,l1,1)) - GDlM = half * (GDQ(I,l,3) + GDQ(I,l1,3)) - GDiM = half * (GDQ(I,l,2) + GDQ(I,l1,2)) + GDlM = half * (GDQ(I,l,itl) + GDQ(I,l1,itl)) + GDiM = half * (GDQ(I,l,iti) + GDQ(I,l1,iti)) !! GDwM = half * (GDw(I,l) + GDw(I,l1)) do n = ntrq,NTR GDtrM(n) = half * (GDQ(I,l,n) + GDQ(I,l1,n)) ! as computed in cumup @@ -1119,12 +1167,12 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! flux = mass flux * (updraft variable minus environment variable) !centered differences - sfluxtem(l) = tem * (gdtm(i,l)-gctbl(i,l)) - qvfluxtem(l) = tem * (gdqm-gcqbl(i,l)) - qlfluxtem(l) = tem * (gdlm-gcqlbl(i,l)) - qifluxtem(l) = tem * (gdim-gcqibl(i,l)) + sfluxtem(i,l,ctp) = tem * (gdtm(i,l)-gctbl(i,l)) + qvfluxtem(i,l,ctp) = tem * (gdqm-gcqbl(i,l)) + qlfluxtem(i,l,ctp) = tem * (gdlm-gcqlbl(i,l)) + qifluxtem(i,l,ctp) = tem * (gdim-gcqibl(i,l)) do n = ntrq,NTR - trfluxtem(l,n) = tem * (gdtrm(n)-gctrbl(i,l,n)) + trfluxtem(i,l,n,ctp) = tem * (gdtrm(n)-gctrbl(i,l,n)) enddo ! if(lprnt .and. i == ipr) write(0,*)' l=',l,' kbi=',kbi,' tem =', tem,' trfluxtem=',trfluxtem(l,ntr),& ! ' gdtrm=',gdtrm(ntr),' gctrbl=',gctrbl(i,l,ntr),' gq=',GDQ(I,l,ntr),GDQ(I,l1,ntr),' l1=',l1,' ctp=',ctp,& @@ -1146,14 +1194,15 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions else ! flux = mass flux * (updraft variable minus environment variable) - tem = - fsigma * mflx_e +! tem = - fsigma * mflx_e + tem = - mflx_e !centered - sfluxtem(k) = tem * (gdtm(i,k)+gocp*gdzm(i,k)-gctm(i,k)) - qvfluxtem(k) = tem * (gdqm-gcqm(i,k)) - qlfluxtem(k) = tem * (gdlm-gclm(i,k)) - qifluxtem(k) = tem * (gdim-gcim(i,k)) + sfluxtem(i,k,ctp) = tem * (gdtm(i,k)+gocp*gdzm(i,k)-gctm(i,k)) + qvfluxtem(i,k,ctp) = tem * (gdqm-gcqm(i,k,ctp)) + qlfluxtem(i,k,ctp) = tem * (gdlm-gclm(i,k)) + qifluxtem(i,k,ctp) = tem * (gdim-gcim(i,k)) do n = ntrq,NTR - trfluxtem(k,n) = tem * (gdtrm(n)-gctrm(i,k,n)) + trfluxtem(i,k,n,ctp) = tem * (gdtrm(n)-gctrm(i,k,n)) enddo !upstream - This better matches what the original CS tendencies do @@ -1185,117 +1234,57 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! ' fsigma=',fsigma,' mflx_e=',mflx_e,' trfluxtemk=',trfluxtem(k,ntr),' sigma=',sigma(i,k) -! the condensation terms - these come from the MSE and condensed water budgets for -! an entraining updraft -! if(k > kb(i)) then ! comment for test -! if(k <= kk) then ! Moorthi -! if(k < kt(i,ctp)) then -! rhs_h = cbmfl*(gcym(i,k)*gchm(i,k) - (gcym(i,km1)*gchm(i,km1) & -! + GDH(I,Km1 )*(gcym(i,k)-gcym(i,km1))) ) -! rhs_q = cbmfl*(gcym(i,k)*(gcwm(i,k)-gcqm(i,k)) & -! - (gcym(i,km1)*(gcwm(i,km1)-gcqm(i,km1)) & -! + (GDw( I,Km1 )-gdq(i,km1,1))*(gcym(i,k)-gcym(i,km1))) ) -! tem = cbmfl * (one - sigma(i,k)) - tem = cbmfl * (one - 0.5*(sigma(i,k)+sigma(i,km1))) - tem1 = gcym(i,k,ctp) * (one - sigma(i,k)) - tem2 = gcym(i,km1,ctp) * (one - sigma(i,km1)) - rhs_h = cbmfl * (tem1*gchm(i,k) - (tem2*gchm(i,km1) & - + GDH(I,Km1)*(tem1-tem2)) ) - rhs_q = cbmfl * (tem1*(gcwm(i,k)-gcqm(i,k)) & - - (tem2*(gcwm(i,km1)-gcqm(i,km1)) & - + (GDw(I,Km1)-gdq(i,km1,1))*(tem1-tem2)) ) - -! ELSE -! rhs_h = cbmfl*(gcht(i,ctp) - (gcym(i,k-1)*gchm(i,k-1) + GDH( I,K-1 )*(gcyt(i,ctp)-gcym(i,k-1))) ) -! rhs_q = cbmfl*((gcwt(i)-gcqt(i,ctp)) - (gcym(i,k-1)*(gcwm(i,k-1)-gcqm(i,k-1)) + (GDw( I,K-1 )-gdq(i,k-1,1))*(gcyt(i,ctp)-gcym(i,k-1))) ) -! endif - -!> -# Compute condensation, total precipitation production, frozen precipitation production, -!! heating due to freezing, and total temperature tendency due to in-cloud microphysics - dqcondtem(i,km1) = -rhs_q ! condensation -! dqprectem(i,km1) = cbmfl * (GPRCIZ(i,k) + GSNWIZ(i,k)) - dqprectem(i,km1) = tem * (GPRCIZ(i,k) + GSNWIZ(i,k)) ! total precip production -! dfrzprectem(i,km1) = cbmfl * GSNWIZ(i,k) - dfrzprectem(i,km1) = tem * GSNWIZ(i,k) ! production of frozen precip - dtfrztem(i,km1) = rhs_h*oneocp ! heating due to freezing - dtcondtem(i,km1) = - elocp * dqcondtem(i,km1) + dtfrztem(i,km1) - endif ! if(k > kbi) then - endif ! if (flx_form) enddo ! end of k=kbi,kk loop endif ! end of if(cbmfl > zero) -! get tendencies by difference of fluxes, sum over cloud type - - if (flx_form) then - do k = 1,kk - delpinv = delpi(i,k) -!> -# Sum single cloud microphysical tendencies over all cloud types - condtermt(i,k) = condtermt(i,k) + dtcondtem(i,k) * delpinv - condtermq(i,k) = condtermq(i,k) + dqcondtem(i,k) * delpinv - prectermq(i,k) = prectermq(i,k) + dqprectem(i,k) * delpinv - prectermfrz(i,k) = prectermfrz(i,k) + dfrzprectem(i,k) * delpinv - frzterm(i,k) = frzterm(i,k) + dtfrztem(i,k) * delpinv - -!> -# Compute flux tendencies and vertical flux divergence - sfluxterm(i,k) = sfluxterm(i,k) - (sfluxtem(k+1) - sfluxtem(k)) * delpinv - qvfluxterm(i,k) = qvfluxterm(i,k) - (qvfluxtem(k+1) - qvfluxtem(k)) * delpinv - qlfluxterm(i,k) = qlfluxterm(i,k) - (qlfluxtem(k+1) - qlfluxtem(k)) * delpinv - qifluxterm(i,k) = qifluxterm(i,k) - (qifluxtem(k+1) - qifluxtem(k)) * delpinv - do n = ntrq,ntr - trfluxterm(i,k,n) = trfluxterm(i,k,n) - (trfluxtem(k+1,n) - trfluxtem(k,n)) * delpinv - enddo -! if (lprnt .and. i == ipr) write(0,*)' k=',k,' trfluxtem=',trfluxtem(k+1,ntr),trfluxtem(k,ntr),& -! ' ctp=',ctp,' trfluxterm=',trfluxterm(i,k,ntr) - enddo - endif ! if (flx_form) enddo ! end of i loop -! - do i=ists,iens - if (cbmfx(i,ctp) > zero) then - tem = one - sigma(i,kt(i,ctp)) - gcyt(i,ctp) = tem * gcyt(i,ctp) - gtprt(i,ctp) = tem * gtprt(i,ctp) - gclt(i,ctp) = tem * gclt(i,ctp) - gcht(i,ctp) = tem * gcht(i,ctp) - gcqt(i,ctp) = tem * gcqt(i,ctp) - gcit(i,ctp) = tem * gcit(i,ctp) - if (.not. flx_form) then - do n = ntrq,ntr - gctrt(i,n,ctp) = tem * gctrt(i,n,ctp) - enddo - end if - gcut(i,ctp) = tem * gcut(i,ctp) - gcvt(i,ctp) = tem * gcvt(i,ctp) - do k=1,kmax - kk = kb(i) - if (k < kk) then - tem = one - sigma(i,kk) - tem1 = tem - else - tem = one - sigma(i,k) - tem1 = one - 0.5*(sigma(i,k)+sigma(i,k-1)) - endif - gcym(i,k,ctp) = tem * gcym(i,k,ctp) - gprciz(i,k) = tem1 * gprciz(i,k) - gsnwiz(i,k) = tem1 * gsnwiz(i,k) - gclz(i,k) = tem1 * gclz(i,k) - gciz(i,k) = tem1 * gciz(i,k) - enddo - endif - enddo + endif ! if (flx_form) +! +! we don't reduce these values in AW, just the tendencies due to fluxes +! do i=ists,iens +! if (cbmfx(i,ctp) > zero) then +! tem = one - sigma(i,kt(i,ctp)) +! gcyt(i,ctp) = tem * gcyt(i,ctp) +! gtprt(i,ctp) = tem * gtprt(i,ctp) +! gclt(i,ctp) = tem * gclt(i,ctp) +! gcht(i,ctp) = tem * gcht(i,ctp) +! gcqt(i,ctp) = tem * gcqt(i,ctp) +! gcit(i,ctp) = tem * gcit(i,ctp) +! do n = ntrq,ntr +! gctrt(i,n,ctp) = tem * gctrt(i,n,ctp) +! enddo +! gcut(i,ctp) = tem * gcut(i,ctp) +! gcvt(i,ctp) = tem * gcvt(i,ctp) +! do k=1,kmax +! kk = kb(i) +! if (k < kk) then +! tem = one - sigma(i,kk) +! tem1 = tem +! else +! tem = one - sigma(i,k) +! tem1 = one - 0.5*(sigma(i,k)+sigma(i,k-1)) +! endif +! gcym(i,k,ctp) = tem * gcym(i,k,ctp) +! gprciz(i,k) = tem1 * gprciz(i,k) +! gsnwiz(i,k) = tem1 * gsnwiz(i,k) +! gclz(i,k) = tem1 * gclz(i,k) +! gciz(i,k) = tem1 * gciz(i,k) +! enddo +! endif +! enddo ! !> -# Call cumflx() to compute cloud mass flux and precipitation CALL CUMFLX(IM , IJSDIM, KMAX , & !DD dimensions GMFX0 , GPRCI , GSNWI , CMDET, & ! output QLIQ , QICE , GTPRC0, & ! output - CBMFX(1,CTP) , GCYM(1,1,ctp), GPRCIZ , GSNWIZ , & ! input - GTPRT(1,CTP) , GCLZ , GCIZ , GCYT(1,ctp),& ! input - KB , KT(1,CTP) , KTMX(CTP) , & ! input + CBMFX(:,CTP) , GCYM(:,:,ctp), GPRCIZ(:,:,CTP), GSNWIZ(:,:,CTP) , & ! input + GTPRT(:,CTP) , GCLZ , GCIZ , GCYT(:,ctp),& ! input + KB , KT(:,CTP) , KTMX(CTP) , & ! input ISTS , IENS ) ! input ENDDO ! end of cloud type ctp loop @@ -1333,46 +1322,127 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions GDH , GDQ , GDU , GDV , & ! input ! GTT , GTQ , GTCFRC, GTU , GTV , & ! modified ! GDH , GDQ , GDCFRC, GDU , GDV , & ! input - CBMFX , GCYT , DELPI , GCHT , GCQT , & ! input - GCLT , GCIT , GCUT , GCVT , GDQ(1,1,iti),& ! input + CBMFX , GCYT , DELPInv , GCHT , GCQT , & ! input + GCLT , GCIT , GCUT , GCVT , GDQ(:,:,iti),& ! input gctrt , & KT , ISTS , IENS, nctp ) ! input endif !for now area fraction of the downdraft is zero, it will be computed -! within cumdwn and applied there -! Get AW downdraft eddy flux and microphysical tendencies out of downdraft code. +! within cumdwn and applied there. So we will get the total sigma now before calling it, +! and apply to the diabatic terms from the updrafts. - do k=1,kmax - do i=ists,iens - sigmad(i,k) = zero - enddo - enddo +! if (do_aw.and.flx_form) then + if (flx_form) then + do k=1,kp1 + do i=ists,iens + lamdamax = maxval(lamdai(i,k,:)) + do while (lamdamax > zero) + loclamdamax = maxloc(lamdai(i,k,:),dim=1) + lamdaprod(i,k) = lamdaprod(i,k) * (one+lamdai(i,k,loclamdamax)) + sigmai(i,k,loclamdamax) = lamdai(i,k,loclamdamax) / lamdaprod(i,k) + sigma(i,k) = max(zero, min(one, sigma(i,k) + sigmai(i,k,loclamdamax))) + vverti(i,k,loclamdamax) = sigmai(i,k,loclamdamax) * wcv(i,k,loclamdamax) + + ! make this lamdai negative so it won't be counted again + lamdai(i,k,loclamdamax) = -lamdai(i,k,loclamdamax) + ! get new lamdamax + lamdamax = maxval(lamdai(i,k,:)) + enddo + ! restore original values of lamdai + lamdai(i,k,:) = abs(lamdai(i,k,:)) +! write(6,'(i2,14f7.4)') k,sigmai(i,k,:) + enddo + enddo + endif + +! the condensation terms - these come from the MSE and condensed water budgets for +! an entraining updraft + if(flx_form) then + DO CTP=1,NCTP ! loop over cloud types + dtcondtem(:,:) = zero + dqcondtem(:,:) = zero + dqprectem(:,:) = zero + dfrzprectem(:,:) = zero + dtfrztem(:,:) = zero + do i=ISTS,IENS + cbmfl = cbmfx(i,ctp) + kk = kt(i,ctp) ! cloud top index + if(cbmfl > zero) then ! this should avoid zero wcv in the denominator + kbi = kb(i) ! cloud base index + do k=kbi,kk ! loop from cloud base to cloud top + km1 = k - 1 + rhs_h = zero + rhs_q = zero + if(k > kbi) then +! tem = cbmfl * (one - sigma(i,k)) + tem = cbmfl * (one - 0.5*(sigma(i,k)+sigma(i,km1))) + tem1 = gcym(i,k,ctp) * (one - sigma(i,k)) + tem2 = gcym(i,km1,ctp) * (one - sigma(i,km1)) + rhs_h = cbmfl * (tem1*gchm(i,k,ctp) - (tem2*gchm(i,km1,ctp) & + + GDH(I,Km1)*(tem1-tem2)) ) + rhs_q = cbmfl * (tem1*(gcwm(i,k,ctp)-gcqm(i,k,ctp)) & + - (tem2*(gcwm(i,km1,ctp)-gcqm(i,km1,ctp)) & + + (GDw(I,Km1)-gdq(i,km1,1))*(tem1-tem2)) ) +! + dqcondtem(i,km1) = -rhs_q ! condensation + dqprectem(i,km1) = tem * (GPRCIZ(i,k,ctp) + GSNWIZ(i,k,ctp)) ! total precip production + dfrzprectem(i,km1) = tem * GSNWIZ(i,k,ctp) ! production of frozen precip + dtfrztem(i,km1) = rhs_h*oneocp ! heating due to freezing +! total temperature tendency due to in cloud microphysics + dtcondtem(i,km1) = - elocp * dqcondtem(i,km1) + dtfrztem(i,km1) + + endif ! if(k > kbi) then + enddo ! end of k=kbi,kk loop + + endif ! end of if(cbmfl > zero) + + +! get tendencies by difference of fluxes, sum over cloud type + + do k = 1,kk +! sum single cloud microphysical tendencies over all cloud types + condtermt(i,k) = condtermt(i,k) + dtcondtem(i,k) * delpinv(i,k) + condtermq(i,k) = condtermq(i,k) + dqcondtem(i,k) * delpinv(i,k) + prectermq(i,k) = prectermq(i,k) + dqprectem(i,k) * delpinv(i,k) + prectermfrz(i,k) = prectermfrz(i,k) + dfrzprectem(i,k) * delpinv(i,k) + frzterm(i,k) = frzterm(i,k) + dtfrztem(i,k) * delpinv(i,k) + +! if (lprnt .and. i == ipr) write(0,*)' k=',k,' trfluxtem=',trfluxtem(k+1,ntr),trfluxtem(k,ntr),& +! ' ctp=',ctp,' trfluxterm=',trfluxterm(i,k,ntr) + enddo + + enddo ! end of i loop + enddo ! end of nctp loop + endif +!downdraft sigma and mass-flux tendency terms are now put into +! the nctp+1 slot of the cloud-type dimensiond variables + + do k=1,kmax + do i=ists,iens + sigmad(i,k) = zero + enddo + enddo !> -# Call cumdwn() to compute cumulus downdraft and assocated melt, freeze !! and evaporation - CALL CUMDWN(IM , IJSDIM, KMAX , NTR , ntrq , & ! DD dimensions + CALL CUMDWN(IM, IJSDIM, KMAX, NTR, ntrq, nctp, & ! DD dimensions GTT , GTQ , GTU , GTV , & ! modified GMFLX , & ! modified updraft+downdraft flux GPRCP , GSNWP , GTEVP , GMDD , & ! output GPRCI , GSNWI , & ! input - GDH , GDW , GDQ , GDQ(1,1,iti) , & ! input + GDH , GDW , GDQ , GDQ(:,:,iti) , & ! input GDQS , GDS , GDHS , GDT , & ! input GDU , GDV , GDZ , & ! input - GDZM , FDQS , DELP , DELPI , & ! input + GDZM , FDQS , DELP , DELPInv , & ! input sigmad, do_aw , do_awdd, flx_form, & ! DDsigma input dtmelt, dtevap, dtsubl, & ! DDsigma input dtdwn , dqvdwn, dqldwn, dqidwn, & ! DDsigma input dtrdwn, & KB , KTMXT , ISTS , IENS ) ! input -! here we substitute the AW tendencies into tendencies to be passed out -! if (do_aw) then -! do k=1,kmax -! do i=ists,iens -! sigma(i,k) = sigma(i,k) + sigmad(i,k) -! enddo -! enddo + +! sigma = sigma + sigmad !> -# Call cumsbw() to compute cloud subsidence heating if (.not. flx_form) then @@ -1381,20 +1451,20 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions CALL CUMSBH(IM , IJSDIM, KMAX , NTR , ntrq , & !DD dimensions GTT , GTQ , & ! modified GTU , GTV , & ! modified - GDH , GDQ , GDQ(1,1,iti) , & ! input + GDH , GDQ , GDQ(:,:,iti) , & ! input GDU , GDV , & ! input - DELPI , GMFLX , GMFX0 , & ! input + DELPINV , GMFLX , GMFX0 , & ! input KTMXT , CPRES , kb, ISTS , IENS ) ! input else CALL CUMSBW(IM , IJSDIM, KMAX , & !DD dimensions GTU , GTV , & ! modified GDU , GDV , & ! input - DELPI , GMFLX , GMFX0 , & ! input + DELPINV , GMFLX , GMFX0 , & ! input KTMXT , CPRES , kb, ISTS , IENS ) ! input endif ! -! for now the following routines appear to be of no consequence to AW - DD +! for now the following routines appear to be of no consequence - DD ! if (.not. flx_form) then ! Tracer Updraft properties @@ -1411,20 +1481,20 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions GCYM , GCYT , GCQT , GCLT , GCIT , & ! input GTPRT , GTEVP , GTPRC0, & ! input KB , KBMX , KT , KTMX , KTMXT , & ! input - DELPI , OTSPT1, ISTS , IENS, & ! input + DELPInv , OTSPT1, ISTS , IENS, & ! input fscav , fswtr, nctp) ! ! Tracer Change due to Downdraft ! --------------- CALL CUMDNR(im ,IJSDIM , KMAX , NTR , & !DD dimensions GTQ , & ! modified - GDQ , GMDD , DELPI , & ! input + GDQ , GMDD , DELPInv , & ! input KTMXT , OTSPT1, ISTS , IENS ) ! input !! !! Tracer change due to Subsidence !! --------------- !! This will be done by cumsbh, now DD 20170907 -! CALL CUMSBR(im , IJSDIM, KMAX , NTR , & !DD dimensions +! CALL CUMSBR(im , IJSDIM, KMAX , NTR ,NCTP, & !DD dimensions ! GTQ , & ! modified ! GDQ , DELPI , & ! input ! GMFLX , KTMXT , OTSPT2, & ! input @@ -1447,6 +1517,60 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions !> -# Compute AW tendencies of T, ql and qi if(flx_form) then ! compute AW tendencies ! AW lump all heating together, compute qv term + +! sigma interpolated to the layer for condensation, etc. terms, precipitation + if(do_aw) then + do k=1,kmax + kp1 = k+1 + do i=1,ijsdim + fsigma(i,k) = one - half*(sigma(i,k)+sigma(i,kp1)) + enddo + enddo + else + do k=1,kmax+1 + do i=1,ijsdim + fsigma(i,k) = one + enddo + enddo + endif + +! AW adjustment of precip fluxes from downdraft model + if(do_aw) then + kp1 = kmax+1 + DO I=ISTS,IENS + GSNWP( I,kp1 ) = zero + GPRCP( I,kp1 ) = zero + ENDDO + tem1 = cpoemelt/grav + tem2 = cpoel/grav + tem3 = cpoesub/grav + DO K=KMAX,1,-1 + kp1 = k+1 + DO I=ISTS,IENS + tem = -dtmelt(i,k) * delp(i,k) * tem1 + teme = -dtevap(i,k) * delp(i,k) * tem2 + tems = -dtsubl(i,k) * delp(i,k) * tem3 + GSNWP(I,k) = GSNWP(I,kp1) + fsigma(i,k) * (GSNWI(i,k) - tem - tems) + GPRCP(I,k) = GPRCP(I,kp1) + fsigma(i,k) * (GPRCI(i,k) + tem - teme) + ENDDO + ENDDO + endif + + +! some of the above routines have set the tendencies and they need to be +! reinitialized, gtt not needed, but gtq needed Anning 5/25/2020 + do n=1,ntr + do k=1,kmax + do i=1,ijsdim + gtq(i,k,n) = zero + enddo + enddo + enddo +! do k=1,kmax +! do i=1,ijsdim +! gtt(i,k) = zero +! enddo +! enddo do k=1,kmax do i=ists,iens dqevap(i,k) = - dtevap(i,k)*cpoel - dtsubl(i,k)*cpoesub @@ -1454,25 +1578,70 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions dtsubl(i,k) = zero enddo enddo - do i=1,ijsdim - moistening_aw(i) = zero - enddo - tem2 = one / delta + + +! diabatic terms from updraft and downdraft models DO K=1,KMAX DO I=ISTS,IENS tem = frzterm(i,k)*cpoEMELT - prectermfrz(i,k) - gtt(i,k) = dtdwn(i,k) + sfluxterm(i,k) + condtermt(i,k) & - + dtmelt(i,k) + dtevap(i,k) - gtq(i,k,1) = dqvdwn(i,k) + qvfluxterm(i,k) + condtermq(i,k) & - + dqevap(i,k) - gtq(i,k,itl) = dqldwn(i,k) + qlfluxterm(i,k) - condtermq(i,k) & +! gtt(i,k) = gtt(i,k) + fsigma(i,k)*(dtmelt(i,k) + dtevap(i,k)) + condtermt(i,k) +! gtq(i,k,1) = gtq(i,k,1) + fsigma(i,k)*dqevap(i,k) + condtermq(i,k) +! gtq(i,k,itl) = gtq(i,k,itl) - (condtermq(i,k) + prectermq(i,k) + tem) +! gtq(i,k,iti) = gtq(i,k,iti) + tem + gtt(i,k) = dtdwn(i,k) + condtermt(i,k) & + + fsigma(i,k)*(dtmelt(i,k) + dtevap(i,k)) + gtq(i,k,1) = dqvdwn(i,k) + condtermq(i,k) & + + fsigma(i,k) * dqevap(i,k) + gtq(i,k,itl) = dqldwn(i,k) - condtermq(i,k) & - prectermq(i,k) - tem - gtq(i,k,iti) = dqidwn(i,k) + qifluxterm(i,k) + tem + gtq(i,k,iti) = dqidwn(i,k) + tem + ! detrainment terms get zeroed ! gtldet(i,k) = zero ! gtidet(i,k) = zero + ENDDO + ENDDO +!! flux tendencies - compute the vertical flux divergence + DO ctp =1,nctp + DO I=ISTS,IENS + cbmfl = cbmfx(i,ctp) + kk = kt(i,ctp) ! cloud top index + if(cbmfl > zero) then ! this should avoid zero wcv in the denominator + DO K=1,kk + kp1 = k+1 + gtt(i,k) = gtt(i,k) - (fsigma(i,kp1)*sfluxtem(i,kp1,ctp) & + - fsigma(i,k)*sfluxtem(i,k,ctp)) * delpinv(i,k) + gtq(i,k,1) = gtq(i,k,1) - (fsigma(i,kp1)*qvfluxtem(i,kp1,ctp) & + - fsigma(i,k)*qvfluxtem(i,k,ctp)) * delpinv(i,k) + gtq(i,k,itl) = gtq(i,k,itl) - (fsigma(i,kp1)*qlfluxtem(i,kp1,ctp) & + - fsigma(i,k)*qlfluxtem(i,k,ctp)) * delpinv(i,k) + gtq(i,k,iti) = gtq(i,k,iti) - (fsigma(i,kp1)*qifluxtem(i,kp1,ctp) & + - fsigma(i,k)*qifluxtem(i,k,ctp)) * delpinv(i,k) + ENDDO +! replace tracer tendency only if to be advected. + DO n = ntrq,NTR + if (OTSPT2(n)) then + DO K=1,kk + kp1 = k+1 + gtq(i,k,n) = - (fsigma(i,kp1)*trfluxtem(i,kp1,n,ctp) & + - fsigma(i,k)*trfluxtem(i,k,n,ctp)) * delpinv(i,k) + ENDDO + endif + ENDDO + end if + ENDDO + ENDDO + +! if(kdt>4) stop 1000 + DO I=ISTS,IENS + moistening_aw(i) = zero + enddo +! adjust tendencies that will lead to negative water mixing ratios + tem2 = one / delta + DO K=1,KMAX + DO I=ISTS,IENS tem1 = - gdq(i,k,itl)*tem2 if (gtq(i,k,itl) < tem1) then tem3 = gtq(i,k,itl) - tem1 @@ -1504,7 +1673,7 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions if (OTSPT2(n)) then DO K=1,KMAX DO I=ISTS,IENS - gtq(i,k,n) = dtrdwn(i,k,n) + trfluxterm(i,k,n) + gtq(i,k,n) = gtq(i,k,n) + dtrdwn(i,k,n) ENDDO ENDDO endif @@ -1597,46 +1766,74 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions !> -# Ensures conservation of water. !In fact, no adjustment of the precip ! is occuring now which is a good sign! DD - if(flx_form .and. adjustp) then + if(flx_form) then DO I = ISTS, IENS if(gprcp(i,1)+gsnwp(i,1) > 1.e-12_kind_phys) then - moistening_aw(i) = - moistening_aw(i) / (gprcp(i,1)+gsnwp(i,1)) - else - moistening_aw(i) = 1.0 + moistening_aw(i) = -moistening_aw(i) / (gprcp(i,1)+gsnwp(i,1)) +! print*,'moistening_aw',moistening_aw(i) + gprcp(i,:) = gprcp(i,:) * moistening_aw(i) + gsnwp(i,:) = gsnwp(i,:) * moistening_aw(i) endif - ENDDO - do k=1,kmax - DO I = ISTS, IENS - gprcp(i,k) = max(0.0, gprcp(i,k) * moistening_aw(i)) - gsnwp(i,k) = max(0.0, gsnwp(i,k) * moistening_aw(i)) - ENDDO - enddo - + END DO endif + +! second method of determining sfc precip only +! if(flx_form) then +! DO I = ISTS, IENS +! pr_tot = zero +! pr_liq = zero +! pr_ice = zero +! do k = 1,kmax +! pr_tot = pr_tot - (gtq(i,k,1)+gtq(i,k,itl)+gtq(i,k,iti)) * delp(i,k) * gravi +! pr_ice = pr_ice + ( cp*gtt(i,k) + el*gtq(i,k,1) - emelt*gtq(i,k,iti) ) & +! * delp(i,k)*gravi +! enddo + !pr_ice = max( min(pr_tot, pr_ice / (emelt)),zero) +! pr_ice = pr_ice / emelt +! pr_liq = pr_tot - pr_ice +! END DO +! print *,'precip1',pr_tot*86400.,gprcp(1,1)*86400.,gsnwp(1,1)*86400. +! print *,'precip2',pr_tot*86400.,pr_liq*86400.,pr_ice*86400. +! endif + + DO K = 1, KMAX + DO I = ISTS, IENS + GPRCPF( I,K ) = 0.5*( GPRCP( I,K )+GPRCP( I,K+1 ) ) + GSNWPF( I,K ) = 0.5*( GSNWP( I,K )+GSNWP( I,K+1 ) ) + END DO + END DO + ! -! do i=ISTS,IENS -! GPRCC(I,1) = GPRCP(I,1) -! GSNWC(I ) = GSNWP(I,1) -! enddo - do k=1,kmax +! do i=ISTS,IENS +! GPRCC( I,1 ) = GPRCP( I,1 ) +! GSNWC( I ) = GSNWP( I,1 ) +! enddo + +! adjust sfc precip consistently with vertically integrated +! temperature and moisture tendencies + + do k=1,kmax+1 do i=ISTS,IENS GTPRP(I,k) = GPRCP(I,k) + GSNWP(I,k) enddo enddo ! !DD provide GFS with a separate downdraft mass flux - DO K=1,KMAX - DO I=ISTS,IENS - GMFX1(I,K) = GMFX0(I,K) - GMFLX(I,K) - ENDDO - ENDDO -! - if (flx_form) then - deallocate(sfluxterm, qvfluxterm, qlfluxterm, qifluxterm,& - condtermt, condtermq, frzterm, prectermq, & - prectermfrz, dtdwn, dqvdwn, dqldwn, & - dqidwn, trfluxterm, dtrdwn) - endif + if(do_aw) then + DO K = 1, KMAX+1 + DO I = ISTS, IENS + fsigma(i,k) = one - sigma(i,k) + GMFX0( I,K ) = GMFX0( I,K ) * fsigma(i,k) + GMFLX( I,K ) = GMFLX( I,K ) * fsigma(i,k) + END DO + END DO + endif + DO K = 1, KMAX+1 + DO I = ISTS, IENS + GMFX1( I,K ) = GMFX0( I,K ) - GMFLX( I,K ) + END DO + END DO + if (allocated(gprcc)) deallocate(gprcc) ! @@ -1748,28 +1945,6 @@ SUBROUTINE CUMBAS & ! cloud base ENDIF ENDDO ENDDO - DO K=KLCLB+1,KBMAX-1 - DO I=ISTS,IENS - spbl(i) = one - gdpm(i,k) * tx1(i) - IF (kb(i) > k .and. spbl(i) > spblmax) THEN - KB(I) = K - ENDIF - ENDDO - ENDDO -! DO K=KBMAX-1,KLCLB+1,-1 -! DO I=ISTS,IENS -! GAMX = FDQS(I,K) / (one+GAM(I,K)) * oneocp -! QSL(i) = GDQS(I,K) + GAMX * (GDH(I,KLCLB)-GDHS(I,K)) -! spbl(i) = one - gdpm(i,k) * tx1(i) -! IF (GDW(I,KLCLB) >= QSL(i) .and. spbl(i) >= spblcrit & -! .and. spbl(i) < spblcrit*6.0) THEN -! .and. spbl(i) < spblcrit*8.0) THEN -! KB(I) = K + KBOFS -! ENDIF -! ENDDO -! if(lprnt) write(0,*)' k=',k,' gdh1=',gdh(ipr,klclb),' gdhs=',gdhs(ipr,k),' kb=',kb(ipr) & -! ,' GDQS=',GDQS(ipr,k),' GDW=',GDW(ipr,KLCLB),' gdpm=',gdpm(ipr,k),' spbl=',spbl(ipr),' qsl=',qsl(ipr) -! ENDDO ENDIF ! do i=ists,iens @@ -1910,8 +2085,8 @@ SUBROUTINE CUMUP & !! in-cloud properties REAL(kind_phys) ACWF (IJSDIM) !< cloud work function REAL(kind_phys) GCLZ (IJSDIM, KMAX) !< cloud liquid water*eta REAL(kind_phys) GCIZ (IJSDIM, KMAX) !< cloud ice*eta - REAL(kind_phys) GPRCIZ(IJSDIM, KMAX) !< rain generation*eta - REAL(kind_phys) GSNWIZ(IJSDIM, KMAX) !< snow generation*eta + REAL(kind_phys) GPRCIZ(IJSDIM, KMAX+1) !< rain generation*eta + REAL(kind_phys) GSNWIZ(IJSDIM, KMAX+1) !< snow generation*eta REAL(kind_phys) GCYT (IJSDIM) !< norm. mass flux @top REAL(kind_phys) GCHT (IJSDIM) !< cloud top MSE*eta REAL(kind_phys) GCQT (IJSDIM) !< cloud top moisture*eta @@ -1924,7 +2099,7 @@ SUBROUTINE CUMUP & !! in-cloud properties REAL(kind_phys) GCwT (IJSDIM) !< cloud top v*eta INTEGER KT (IJSDIM) !< cloud top INTEGER KTMX !< max of cloud top - REAL(kind_phys) WCV (IJSDIM, KMAX) !< updraft velocity (half lev) !DD sigma make output + REAL(kind_phys) WCV (IJSDIM, KMAX+1) !< updraft velocity (half lev) !DD sigma make output ! ! [MODIFIED] REAL(kind_phys) GCYM (IJSDIM, KMAX) !< norm. mass flux @@ -1980,12 +2155,12 @@ SUBROUTINE CUMUP & !! in-cloud properties ! REAL(kind_phys) ELAR (IJSDIM, KMAX) !< entrainment rate REAL(kind_phys) ELAR !< entrainment rate at mid layer ! - REAL(kind_phys) GCHM (IJSDIM, KMAX) !< cloud MSE (half lev) - REAL(kind_phys) GCWM (IJSDIM, KMAX) !< cloud Qt (half lev) !DDsigmadiag - REAL(kind_phys) GCTM (IJSDIM, KMAX) !< cloud T (half lev) !DDsigmadiag make output - REAL(kind_phys) GCQM (IJSDIM, KMAX) !< cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GCLM (IJSDIM, KMAX) !< cloud liquid ( half lev) - REAL(kind_phys) GCIM (IJSDIM, KMAX) !< cloud ice (half lev) + REAL(kind_phys) GCHM (IJSDIM, KMAX+1) !< cloud MSE (half lev) + REAL(kind_phys) GCWM (IJSDIM, KMAX+1) !< cloud Qt (half lev) !DDsigmadiag + REAL(kind_phys) GCTM (IJSDIM, KMAX+1) !< cloud T (half lev) !DDsigmadiag make output + REAL(kind_phys) GCQM (IJSDIM, KMAX+1) !< cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCLM (IJSDIM, KMAX+1) !< cloud liquid ( half lev) + REAL(kind_phys) GCIM (IJSDIM, KMAX+1) !< cloud ice (half lev) REAL(kind_phys) GCUM (IJSDIM, KMAX) !< cloud U (half lev) REAL(kind_phys) GCVM (IJSDIM, KMAX) !< cloud V (half lev) REAL(kind_phys) GCtrM (IJSDIM, KMAX,ntrq:ntr) !< cloud tracer (half lev) @@ -2021,8 +2196,9 @@ SUBROUTINE CUMUP & !! in-cloud properties ! REAL(kind_phys) :: WCCRT = zero !m REAL(kind_phys) :: WCCRT = 0.01 REAL(kind_phys) :: WCCRT = 1.0e-6_kind_phys, wvcrt=1.0e-3_kind_phys - REAL(kind_phys) :: TSICE = 268.15_kind_phys ! compatible with macrop_driver - REAL(kind_phys) :: TWICE = 238.15_kind_phys ! compatible with macrop_driver + REAL(kind_phys) :: TSICE = 273.15_kind_phys ! compatible with macrop_driver + REAL(kind_phys) :: TWICE = 233.15_kind_phys ! compatible with macrop_driver + REAL(kind_phys) :: c1t ! REAL(kind_phys) :: wfn_neg = 0.1 REAL(kind_phys) :: wfn_neg = 0.15 @@ -2033,10 +2209,15 @@ SUBROUTINE CUMUP & !! in-cloud properties REAL(kind_phys) :: esat, tem ! REAL(kind_phys) :: esat, tem, rhs_h, rhs_q ! +! [INTERNAL FUNC] + REAL(kind_phys) FPREC ! precipitation ratio in condensate + REAL(kind_phys) FRICE ! ice ratio in cloud water REAL(kind_phys) Z ! altitude REAL(kind_phys) ZH ! scale height REAL(kind_phys) T ! temperature ! + FPREC(Z,ZH) = MIN(MAX(one-EXP(-(Z-PRECZ0)/ZH), zero), one) + FRICE(T) = MIN(MAX((TSICE-T)/(TSICE-TWICE), zero), one) ! ! Note: iteration is not made to diagnose cloud ice for simplicity ! @@ -2052,14 +2233,25 @@ SUBROUTINE CUMUP & !! in-cloud properties GCVT (I) = zero GCwT (I) = zero enddo + do k=1,kmax+1 + do i=ists,iens + GPRCIZ(I,k) = zero + GSNWIZ(I,k) = zero + enddo + enddo + do k=1,kmax + do i=ists,iens + WCV (I,k) = unset_kind_phys + GCLM (I,k) = unset_kind_phys + GCIM (I,k) = unset_kind_phys + enddo + enddo do k=1,kmax do i=ists,iens ACWFK (I,k) = unset_kind_phys ACWFN (I,k) = unset_kind_phys GCLZ (I,k) = zero GCIZ (I,k) = zero - GPRCIZ(I,k) = zero - GSNWIZ(I,k) = zero ! GCHMZ (I,k) = zero GCWMZ (I,k) = zero @@ -2070,15 +2262,12 @@ SUBROUTINE CUMUP & !! in-cloud properties ! BUOY (I,k) = unset_kind_phys BUOYM (I,k) = unset_kind_phys - WCV (I,k) = unset_kind_phys GCY (I,k) = unset_kind_phys ! GCHM (I,k) = unset_kind_phys GCWM (I,k) = unset_kind_phys GCTM (I,k) = unset_kind_phys GCQM (I,k) = unset_kind_phys - GCLM (I,k) = unset_kind_phys - GCIM (I,k) = unset_kind_phys GCUM (I,k) = unset_kind_phys GCVM (I,k) = unset_kind_phys enddo @@ -2199,13 +2388,24 @@ SUBROUTINE CUMUP & !! in-cloud properties FDQSM = GDQSM * tem * (fact1 + fact2*tem) ! calculate d(qs)/dT CPGMI = one / (CP + EL*FDQSM) - PRCZH = PRECZH * MIN(GDZTR(I)*ZTREFI, one) - PRECR = FPREC(GDZM(I,K)-GDZMKB(I), PRCZH ) ! wrk = one / GCYM(I,K) DCTM = (GCHMZ(I,K)*wrk - GDHSM) * CPGMI GCQMZ(i) = min((GDQSM+FDQSM*DCTM)*GCYM(I,K), GCWMZ(I,K)) - GTPRMZ(I,K) = PRECR * (GCWMZ(I,K)-GCQMZ(i)) + if(PRECZH > zero) then + PRCZH = PRECZH * MIN(GDZTR(I)*ZTREFI, one) + PRECR = FPREC(GDZM(I,K)-GDZMKB(I), PRCZH ) + GTPRMZ(I,K) = PRECR * (GCWMZ(I,K)-GCQMZ(i)) + else + DELC=GDZ(I,K)-GDZ(I,KM1) + if(gdtm(i,k)>TSICE) then + c1t=c0t*delc + else + c1t=c0t*exp(d0t*(gdtm(i,k)-TSICE))*delc + end if + c1t=min(c1t, one) + GTPRMZ(I,K) = c1t * (GCWMZ(I,K)-GCQMZ(i)) + end if GTPRMZ(I,K) = MAX(GTPRMZ(I,K), GTPRMZ(I,KM1)) GCCMZ = GCWMZ(I,K) - GCQMZ(i) - GTPRMZ(I,K ) DELC = MIN(GCCMZ, zero) @@ -2274,7 +2474,11 @@ SUBROUTINE CUMUP & !! in-cloud properties wrk = one / GCYM(I,K) DCTM = (GCHMZ(I,K)*wrk - GDHSM) * CPGMI GCQMZ(i) = min((GDQSM+FDQSM*DCTM)*GCYM(I,K), GCWMZ(I,K)) - GTPRMZ(I,K) = PRECR * (GCWMZ(I,K)-GCQMZ(i)) + if(PRECZH > zero) then + GTPRMZ(I,K) = PRECR * (GCWMZ(I,K)-GCQMZ(i)) + else + GTPRMZ(I,K) = c1t * (GCWMZ(I,K)-GCQMZ(i)) + end if GTPRMZ(I,K) = MAX(GTPRMZ(I,K), GTPRMZ(I,KM1)) GCCMZ = GCWMZ(I,K) - GCQMZ(i) - GTPRMZ(I,K) DELC = MIN(GCCMZ, zero) @@ -2399,8 +2603,19 @@ SUBROUTINE CUMUP & !! in-cloud properties wrk = one / gcyt(i) DCT = (GCHT(I)*wrk - GDHS(I,K)) / (CP*(one + GAM(I,K))) GCQT(I) = min((GDQS(I,K) + FDQS(I,K)*DCT) * GCYT(I), GCWT(i)) - PRCZH = PRECZH * MIN(GDZTR(I)*ZTREFI, one) - GTPRT(I) = FPREC(GDZ(I,K)-GDZMKB(I), PRCZH) * (GCWT(i)-GCQT(I)) + if(PRECZH > zero) then + PRCZH = PRECZH * MIN(GDZTR(I)*ZTREFI, one) + GTPRT(I) = FPREC(GDZ(I,K)-GDZMKB(I), PRCZH) * (GCWT(i)-GCQT(I)) + else + DELC=GDZ(I,K)-GDZ(I,K-1) + if(gdtm(i,k)>TSICE) then + c1t=c0t*delc + else + c1t=c0t*exp(d0t*(gdtm(i,k)-TSICE))*delc + end if + c1t=min(c1t, one) + GTPRT(I) = c1t * (GCWT(i)-GCQT(I)) + end if GTPRT(I) = MAX(GTPRT(I), GTPRMZ(I,K)) GCCT = GCWT(i) - GCQT(I) - GTPRT(I) DELC = MIN(GCCT, zero) @@ -2503,24 +2718,6 @@ SUBROUTINE CUMUP & !! in-cloud properties ! ! WRITE( CTNUM, '(I2.2)' ) CTP ! - -contains - - pure function FPREC(Z,ZH) - implicit none - real(kind_phys), intent(in) :: Z - real(kind_phys), intent(in) :: ZH - real(kind_phys) :: FPREC - FPREC = MIN(MAX(one-EXP(-(Z-PRECZ0)/ZH), zero), one) - end function FPREC - - pure function FRICE(T) - implicit none - real(kind_phys), intent(in) :: T - real(kind_phys) :: FRICE - FRICE = MIN(MAX((TSICE-T)/(TSICE-TWICE), zero), one) - end function FRICE - END SUBROUTINE CUMUP !*********************************************************************** !>\ingroup cs_scheme @@ -2562,8 +2759,8 @@ SUBROUTINE CUMBMX & !! cloud base mass flux ! [INTERNAL PARAM] REAL(kind_phys) :: FMAX = 1.5e-2_kind_phys ! maximum flux ! REAL(kind_phys) :: RHMCRT = zero ! critical val. of cloud mean RH -! REAL(kind_phys) :: RHMCRT = 0.25_kind_phys ! critical val. of cloud mean RH - REAL(kind_phys) :: RHMCRT = 0.50_kind_phys ! critical val. of cloud mean RH + REAL(kind_phys) :: RHMCRT = 0.25_kind_phys ! critical val. of cloud mean RH +! REAL(kind_phys) :: RHMCRT = 0.50_kind_phys ! critical val. of cloud mean RH REAL(kind_phys) :: ALP1 = zero REAL(kind_phys) :: TAUD = 1.e3_kind_phys ! REAL(kind_phys) :: TAUD = 6.e2_kind_phys @@ -2624,7 +2821,7 @@ SUBROUTINE CUMFLX & !! cloud mass flux INTEGER, INTENT(IN) :: IJSDIM, KMAX, IM !! DD, for GFS, pass in ! ! [OUTPUT] - REAL(kind_phys) GMFLX (IJSDIM, KMAX) !< mass flux + REAL(kind_phys) GMFLX (IJSDIM, KMAX+1) !< mass flux REAL(kind_phys) CMDET (IJSDIM, KMAX) !< detrainment mass flux REAL(kind_phys) GPRCI (IJSDIM, KMAX) !< rainfall generation REAL(kind_phys) GSNWI (IJSDIM, KMAX) !< snowfall generation @@ -2636,8 +2833,8 @@ SUBROUTINE CUMFLX & !! cloud mass flux REAL(kind_phys) CBMFX (IJSDIM) !< cloud base mass flux REAL(kind_phys) GCYM (IJSDIM, KMAX) !< normalized mass flux REAL(kind_phys) GCYT (IJSDIM) !< detraining mass flux - REAL(kind_phys) GPRCIZ(IJSDIM, KMAX) !< precipitation/M - REAL(kind_phys) GSNWIZ(IJSDIM, KMAX) !< snowfall/M + REAL(kind_phys) GPRCIZ(IJSDIM, KMAX+1) !< precipitation/M + REAL(kind_phys) GSNWIZ(IJSDIM, KMAX+1) !< snowfall/M REAL(kind_phys) GTPRT (IJSDIM) !< rain+snow @top REAL(kind_phys) GCLZ (IJSDIM, KMAX) !< cloud liquid/M REAL(kind_phys) GCIZ (IJSDIM, KMAX) !< cloud ice/M @@ -2773,8 +2970,8 @@ SUBROUTINE CUMSBH & !! adiabat. descent REAL(kind_phys) GDU (IJSDIM, KMAX) REAL(kind_phys) GDV (IJSDIM, KMAX) REAL(kind_phys) DELPI (IJSDIM, KMAX) - REAL(kind_phys) GMFLX (IJSDIM, KMAX) !< mass flux (updraft+downdraft) - REAL(kind_phys) GMFX0 (IJSDIM, KMAX) !< mass flux (updraft only) + REAL(kind_phys) GMFLX (IJSDIM, KMAX+1) !< mass flux (updraft+downdraft) + REAL(kind_phys) GMFX0 (IJSDIM, KMAX+1) !< mass flux (updraft only) INTEGER KB(IJSDIM) !< cloud base index - negative means no convection INTEGER KTMX REAL(kind_phys) CPRES !< pressure factor for cumulus friction @@ -2890,8 +3087,8 @@ SUBROUTINE CUMSBW & !! adiabat. descent REAL(kind_phys) GDU (IJSDIM, KMAX) REAL(kind_phys) GDV (IJSDIM, KMAX) REAL(kind_phys) DELPI (IJSDIM, KMAX) - REAL(kind_phys) GMFLX (IJSDIM, KMAX) !< mass flux (updraft+downdraft) - REAL(kind_phys) GMFX0 (IJSDIM, KMAX) !< mass flux (updraft only) + REAL(kind_phys) GMFLX (IJSDIM, KMAX+1) !< mass flux (updraft+downdraft) + REAL(kind_phys) GMFX0 (IJSDIM, KMAX+1) !< mass flux (updraft only) INTEGER KB(IJSDIM) !< cloud base index - negative means no convection INTEGER KTMX, ISTS, IENS REAL(kind_phys) CPRES !< pressure factor for cumulus friction @@ -2962,7 +3159,7 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation ! IMPLICIT NONE - INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR, ntrq ! DD, for GFS, pass in + INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR , ntrq, nctp !! DD, for GFS, pass in logical, intent(in) :: do_aw, do_awdd, flx_form ! ! [MODIFY] @@ -2970,13 +3167,13 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation REAL(kind_phys) GTQ (IJSDIM, KMAX, NTR) !< Moisture etc tendency REAL(kind_phys) GTU (IJSDIM, KMAX) !< u tendency REAL(kind_phys) GTV (IJSDIM, KMAX) !< v tendency - REAL(kind_phys) GMFLX (IJSDIM, KMAX) !< mass flux + REAL(kind_phys) GMFLX (IJSDIM, KMAX+1) !< mass flux ! ! [OUTPUT] - REAL(kind_phys) GPRCP (IJSDIM, KMAX) !< rainfall flux - REAL(kind_phys) GSNWP (IJSDIM, KMAX) !< snowfall flux + REAL(kind_phys) GPRCP (IJSDIM, KMAX+1) !< rainfall flux + REAL(kind_phys) GSNWP (IJSDIM, KMAX+1) !< snowfall flux REAL(kind_phys) GTEVP (IJSDIM, KMAX) !< evaporation+sublimation - REAL(kind_phys) GMDD (IJSDIM, KMAX) !< downdraft mass flux + REAL(kind_phys) GMDD (IJSDIM, KMAX+1) !< downdraft mass flux !AW microphysical tendencies REAL(kind_phys) gtmelt (IJSDIM, KMAX) !< t tendency ice-liq @@ -2988,8 +3185,6 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation REAL(kind_phys) dqldwn (IJSDIM, KMAX) !< ql tendency downdraft detrainment REAL(kind_phys) dqidwn (IJSDIM, KMAX) !< qi tendency downdraft detrainment REAL(kind_phys) dtrdwn (IJSDIM, KMAX, ntrq:ntr) !< tracer tendency downdraft detrainment -! AW downdraft area fraction (assumed zero for now) - REAL(kind_phys) sigmad (IJSDIM,KMAX) !< DDsigma cloud downdraft area fraction ! [INPUT] REAL(kind_phys) GPRCI (IJSDIM, KMAX) !< rainfall generation @@ -3011,6 +3206,8 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation REAL(kind_phys) DELPI (IJSDIM, KMAX) INTEGER KB (IJSDIM) INTEGER KTMX, ISTS, IENS + REAL(kind_phys) sigmad (IM,KMAX+1) !< DDsigma cloud downdraft area fraction + ! ! [INTERNAL WORK] ! Note: Some variables have 3-dimensions for the purpose of budget check. @@ -3031,27 +3228,33 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation ! profiles of downdraft variables for AW flux tendencies REAL(kind_phys) GCdseD(ISTS:IENS, KMAX) !< downdraft dse REAL(kind_phys) GCqvD (ISTS:IENS, KMAX) !< downdraft qv -! REAL(kind_phys) GCqlD (ISTS:IENS, KMAX) !< downdraft ql -! REAL(kind_phys) GCqiD (ISTS:IENS, KMAX) !< downdraft qi + REAL(kind_phys) GCqlD (ISTS:IENS, KMAX) !< downdraft ql + REAL(kind_phys) GCqiD (ISTS:IENS, KMAX) !< downdraft qi REAL(kind_phys) GCtrD (ISTS:IENS, ntrq:ntr) !< downdraft tracer REAL(kind_phys) GCUD (ISTS:IENS) !< downdraft u REAL(kind_phys) GCVD (ISTS:IENS) !< downdraft v REAL(kind_phys) FSNOW (ISTS:IENS) REAL(kind_phys) GMDDD (ISTS:IENS) - - REAL(kind_phys) GDTW, GCHX, GCTX, GCQSX, GTPRP, EVSU, GTEVE, LVIC, & - DQW, DTW, GDQW, DZ, GCSD, FDET, GDHI, GMDDX, & - GMDDMX, GCHDX, GCWDX, GCUDD, GCVDD, GTHCI, GTQVCI, & - wrk, wrk1, wrk2, wrk3, wrk4, tx1, & - WMX, HMX, DDWMX, DDHMX, dp_above, dp_below, fsigma, & - fmelt, fevp, wrkn, gctrdd(ntrq:ntr) - + INTEGER I, K + REAL(kind_phys) GDTW + REAL(kind_phys) GCHX, GCTX, GCQSX, GTPRP, EVSU, GTEVE, LVIC + REAL(kind_phys) DQW, DTW, GDQW, DZ, GCSD, FDET, GDHI + REAL(kind_phys) GMDDX, GMDDMX + REAL(kind_phys) GCHDX, GCWDX + REAL(kind_phys) GCUDD, GCVDD + REAL(kind_phys) GTHCI, GTQVCI, GTQLCI, GTQICI !M REAL(kind_phys) GTHCI, GTQVCI, GTQLCI, GTQICI, GTUCI, GTVCI + real(kind_phys) wrk, fmelt, fevp, gctrdd(ntrq:ntr) !DD#ifdef OPT_CUMBGT -! Water, energy, downdraft water and downdraft energy budgets -! REAL(kind_phys), dimension(ISTS:IENS) :: WBGT, HBGT, DDWBGT, DDHBGT - integer ij, i, k, kp1, n + REAL(kind_phys) WBGT ( ISTS:IENS ) !! water budget + REAL(kind_phys) HBGT ( ISTS:IENS ) !! energy budget + REAL(kind_phys) DDWBGT( ISTS:IENS ) !! downdraft water budget + REAL(kind_phys) DDHBGT( ISTS:IENS ) !! downdraft energy budget + REAL(kind_phys) WMX, HMX, DDWMX, DDHMX, tx1, wrk1, wrk2, wrk3, wrk4, wrkn + REAL(kind_phys) dp_above, dp_below + real(kind_phys) fsigma + integer ij, n, kp1 !DD#endif ! ! [INTERNAL PARM] @@ -3109,46 +3312,23 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation gtsubl(I,k) = zero enddo enddo -! testing on oct 17 2016 - if (flx_form) then - if (.not. do_awdd) then - do k=1,kmax - do i=ists,iens - if (kb(i) > 0) then - dtdwn (i,k) = gtt(i,k) - dqvdwn(i,k) = gtq(i,k,1) - dqldwn(i,k) = gtq(i,k,itl) - dqidwn(i,k) = gtq(i,k,iti) - endif - enddo - enddo - do n=ntrq,ntr - do k=1,kmax - do i=ists,iens - if (kb(i) > 0) then - dtrdwn(i,k,n) = gtq(i,k,n) - endif - enddo - enddo - enddo - else - do k=1,kmax - do i=ists,iens - dtdwn (I,k) = zero - dqvdwn(I,k) = zero - dqldwn(I,k) = zero - dqidwn(I,k) = zero - enddo - enddo - do n=ntrq,ntr - do k=1,kmax - do i=ists,iens - dtrdwn(i,k,n) = zero - enddo - enddo - enddo - endif - endif + +! These are zeroed by the calling routine, cs_cumlus +! do k=1,kmax +! do i=ists,iens +! dtdwn (I,k) = zero +! dqvdwn(I,k) = zero +! dqldwn(I,k) = zero +! dqidwn(I,k) = zero +! enddo +! enddo +! do n=ntrq,ntr +! do k=1,kmax +! do i=ists,iens +! dtrdwn(i,k,n) = zero +! enddo +! enddo +! enddo ! do i=ists,iens GCHD(I) = zero @@ -3178,20 +3358,19 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation LVIC = ELocp + EMELTocp*FSNOW(I) GDTW = GDT(I,K) - LVIC*(GDQS(I,K) - GDQ(I,K,1)) & / (one + LVIC*FDQS(I,K)) + + DZ = GDZM(I,KP1) - GDZM(I,K) + FMELT = (one + FTMLT*(GDTW - TWSNOW)) & + * (one - TANH(GMFLX(I,KP1)/GMFLXC)) & + * (one - TANH(VTERMS*MELTAU/DZ)) IF (GDTW < TWSNOW) THEN - GSNWP(I,K) = GSNWP(I,KP1) + GPRCI(I,K) + GSNWI(I,K) - GTTEV(I,K) = EMELToCP * GPRCI(I,K) * DELPI(I,K) - SNMLT(I,K) = -GPRCI(I,K) + SNMLT(I,K) = GPRCP(I,KP1)*min(max(FMELT, one), zero) ELSE - DZ = GDZM(I,KP1) - GDZM(I,K) - FMELT = (one + FTMLT*(GDTW - TWSNOW)) & - * (one - TANH(GMFLX(I,KP1)/GMFLXC)) & - * (one - TANH(VTERMS*MELTAU/DZ)) SNMLT(I,K) = GSNWP(I,KP1)*max(min(FMELT, one), zero) - GSNWP(I,K) = GSNWP(I,KP1)+GSNWI(I,K) - SNMLT(I,K) - GPRCP(I,K) = GPRCP(I,KP1)+GPRCI(I,K) + SNMLT(I,K) - GTTEV(I,K) = -EMELToCP * SNMLT(I,K) * DELPI(I,K) ENDIF + GSNWP(I,K) = GSNWP(I,KP1)+GSNWI(I,K) - SNMLT(I,K) + GPRCP(I,K) = GPRCP(I,KP1)+GPRCI(I,K) + SNMLT(I,K) + GTTEV(I,K) = -EMELToCP * SNMLT(I,K) * DELPI(I,K) !DD heating rate due to precip melting for AW gtmelt(i,k) = gtmelt(i,k) + GTTEV(I,K) endif @@ -3350,8 +3529,15 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation GTQ(I,K,1) = GTQ(I,K,1) + GTQEV(I,K) ! GMFLX(I,K) = GMFLX(I,K) - GMDD(I,K) + endif + ENDDO ! end of i loop + ENDDO ! end of k loop ! AW tendencies due to vertical divergence of eddy fluxes + DO K=2,KTMX + kp1 = min(k+1,kmax) + DO I=ISTS,IENS + if (kb(i) > 0) then if (k > 1 .and. flx_form) then fsigma = one - sigmad(i,kp1) dp_below = wrk * (one - sigmad(i,k)) @@ -3381,28 +3567,6 @@ SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation endif ENDDO ! end of i loop ENDDO ! end of k loop -! - if (.not. do_awdd .and. flx_form) then - do k=1,kmax - do i=ists,iens - if (kb(i) > 0) then - dtdwn(i,k) = gtt(i,k) - dtdwn(i,k) - dqvdwn(i,k) = gtq(i,k,1) - dqvdwn(i,k) - dqldwn(i,k) = gtq(i,k,itl) - dqldwn(i,k) - dqidwn(i,k) = gtq(i,k,iti) - dqidwn(i,k) - endif - enddo - enddo - do n=ntrq,ntr - do k=1,kmax - do i=ists,iens - if (kb(i) > 0) then - dtrdwn(i,k,n) = gtq(i,k,n) - dtrdwn(i,k,n) - endif - enddo - enddo - enddo - endif ! END SUBROUTINE CUMDWN !*********************************************************************** @@ -3428,22 +3592,28 @@ SUBROUTINE CUMCLD & !! cloudiness REAL(kind_phys) FLIQC (IJSDIM, KMAX) !< liquid ratio in cumulus ! ! [INPUT] - REAL(kind_phys) GMFLX (IJSDIM, KMAX) ! cumulus mass flux + REAL(kind_phys) GMFLX (IJSDIM, KMAX+1) ! cumulus mass flux INTEGER KTMX INTEGER ISTS, IENS ! ! [WORK] INTEGER I, K REAL(kind_phys) CUMF, QC, wrk + LOGICAL, SAVE :: OFIRST = .TRUE. ! ! [INTERNAL PARAM] - REAL(kind_phys), parameter :: CMFMIN = 2.e-3_kind_phys, &!< Mc->cloudiness - CMFMAX = 3.e-1_kind_phys, &!< Mc->cloudiness - CLMIN = 1.e-3_kind_phys, &!< cloudiness Min. - CLMAX = 0.1_kind_phys, &!< cloudiness Max. - FACLW = 0.1_kind_phys, &!< Mc->CLW - FACLF = (CLMAX-CLMIN)/LOG(CMFMAX/CMFMIN) -! + REAL(kind_phys) :: FACLW = 0.1_kind_phys !> Mc->CLW + REAL(kind_phys) :: CMFMIN = 2.e-3_kind_phys !> Mc->cloudiness + REAL(kind_phys) :: CMFMAX = 3.e-1_kind_phys !> Mc->cloudiness + REAL(kind_phys) :: CLMIN = 1.e-3_kind_phys !> cloudiness Min. + REAL(kind_phys) :: CLMAX = 0.1_kind_phys !> cloudiness Max. + REAL(kind_phys), SAVE :: FACLF +! + IF ( OFIRST ) THEN + FACLF = (CLMAX-CLMIN)/LOG(CMFMAX/CMFMIN) + OFIRST = .FALSE. + END IF + CUMFRC(ISTS:IENS) = zero DO K=1,KTMX DO I=ISTS,IENS @@ -3668,26 +3838,28 @@ END SUBROUTINE CUMDNR !*********************************************************************** !>\ingroup cs_scheme SUBROUTINE CUMSBR & !! Tracer Subsidence - ( IM , IJSDIM, KMAX , NTR , & !DD dimensions + ( IM , IJSDIM, KMAX, NTR, NCTP, & !DD dimensions GTR , & ! modified - GDR , DELPI , & ! input + GDR , DELP , & ! input GMFLX , KTMX , OTSPT , & ! input + sigmai , sigma , & !DDsigma input ISTS, IENS ) ! input ! IMPLICIT NONE - INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR !! DD, for GFS, pass in + INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR, nctp !! DD, for GFS, pass in ! ! [MODIFY] REAL(kind_phys) GTR (IJSDIM, KMAX, NTR) !! tracer tendency ! ! [INPUT] REAL(kind_phys) GDR (IJSDIM, KMAX, NTR) !! tracer - REAL(kind_phys) DELPI (IJSDIM, KMAX) - REAL(kind_phys) GMFLX (IJSDIM, KMAX) !! mass flux + REAL(kind_phys) DELP (IJSDIM, KMAX) + REAL(kind_phys) GMFLX (IJSDIM, KMAX+1) !! mass flux INTEGER KTMX LOGICAL OTSPT (NTR) !! tracer transport on/off INTEGER ISTS, IENS + REAL(kind_phys) sigmai (IM,KMAX+1,NCTP), sigma(IM,KMAX+1) !!DDsigma cloud updraft fraction ! ! [INTERNAL WORK] INTEGER I, K, KM, KP, LT @@ -3703,14 +3875,14 @@ SUBROUTINE CUMSBR & !! Tracer Subsidence KM = MAX(K-1, 1) KP = MIN(K+1, KMAX) DO I=ISTS,IENS - SBR0 = GMFLX(I,KP) * (GDR(I,KP,LT) - GDR(I,K,LT)) - SBR1 = GMFLX(I,K) * (GDR(I,K,LT) - GDR(I,KM,LT)) - IF (GMFLX(I,K) > GMFLX(I,KP)) THEN + SBR0 = GMFLX(I,K+1) * (GDR(I,KP,LT) - GDR(I,K,LT)) + SBR1 = GMFLX(I,K) * (GDR(I,K,LT) - GDR(I,KM,LT)) + IF (GMFLX(I,K) > GMFLX(I,K+1)) THEN FX1 = half ELSE FX1 = zero END IF - GTR(I,K,LT) = GTR(I,K,LT) + DELPI(I,K) & + GTR(I,K,LT) = GTR(I,K,LT) + GRAV/DELP(I,K) & * ((one-FX(I))*SBR0 + FX1*SBR1) FX(I) = FX1 ENDDO @@ -3733,7 +3905,7 @@ SUBROUTINE CUMFXR & ! Tracer mass fixe INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR !! DD, for GFS, pass in ! ! [MODIFY] - REAL(kind_phys) GTR (IJSDIM, KMAX, NTR) ! tracer tendency + REAL(kind_phys) GTR (IJSDIM, KMAX) ! tracer tendency ! ! [INPUT] REAL(kind_phys) GDR (IJSDIM, KMAX, NTR) ! tracer @@ -3815,14 +3987,14 @@ END SUBROUTINE CUMFXR !********************************************************************* !>\ingroup cs_scheme SUBROUTINE CUMFXR1 & ! Tracer mass fixer - ( IM , IJSDIM, KMAX , & !DD dimensions + ( IM , IJSDIM, KMAX ,nctp, & !DD dimensions GTR , & ! modified GDR , DELP , DELTA , KTMX , IMFXR , & ! input ISTS , IENS ) ! input ! IMPLICIT NONE - INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX ! DD, for GFS, pass in + INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, nctp !! DD, for GFS, pass in ! ! [MODIFY] REAL(kind_phys) GTR (IJSDIM, KMAX) ! tracer tendency From 633f8d1d5bc8f58b1e17a7196f9d0e698133aba4 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 7 Mar 2024 13:57:28 -0500 Subject: [PATCH 161/249] fix array dimension issue --- physics/CONV/Chikira_Sugiyama/cs_conv.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 index 94dadba87..4ca545bc4 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 @@ -3139,7 +3139,7 @@ END SUBROUTINE CUMSBW !>\ingroup cs_scheme !! This subroution calculates freeze, melt and evaporation in cumulus downdraft. SUBROUTINE CUMDWN & ! Freeze & Melt & Evaporation - ( IM , IJSDIM, KMAX , NTR , ntrq, & !DD dimensions + ( IM , IJSDIM, KMAX , NTR,ntrq,nctp, & !DD dimensions GTT , GTQ , GTU , GTV , & ! modified GMFLX , & ! modified GPRCP , GSNWP , GTEVP , GMDD , & ! output @@ -3905,7 +3905,7 @@ SUBROUTINE CUMFXR & ! Tracer mass fixe INTEGER, INTENT(IN) :: IM, IJSDIM, KMAX, NTR !! DD, for GFS, pass in ! ! [MODIFY] - REAL(kind_phys) GTR (IJSDIM, KMAX) ! tracer tendency + REAL(kind_phys) GTR (IJSDIM, KMAX, NTR) ! tracer tendency ! ! [INPUT] REAL(kind_phys) GDR (IJSDIM, KMAX, NTR) ! tracer From 12b5882e675c70c10468ce6b7ad935bdd51747b5 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 7 Mar 2024 14:32:50 -0500 Subject: [PATCH 162/249] remove some unnecessary comment edits and whitespace changes --- physics/CONV/Chikira_Sugiyama/cs_conv.F90 | 193 +++++++++++----------- 1 file changed, 96 insertions(+), 97 deletions(-) diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 index 4ca545bc4..ae59db7ba 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 @@ -663,96 +663,96 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions ! ! [INTERNAL WORK] REAL(kind_phys), allocatable :: GPRCC (:, :) ! rainfall - REAL(kind_phys) GSNWC ( IJSDIM ) !! snowfall - REAL(kind_phys) CUMCLW( IJSDIM, KMAX ) !! cloud water in cumulus - REAL(kind_phys) CUMFRC( IJSDIM ) !! cumulus cloud fraction + REAL(kind_phys) GSNWC ( IJSDIM ) ! snowfall + REAL(kind_phys) CUMCLW( IJSDIM, KMAX ) ! cloud water in cumulus + REAL(kind_phys) CUMFRC( IJSDIM ) ! cumulus cloud fraction !COSP - REAL(kind_phys) QLIQC ( IJSDIM, KMAX ) !! cumulus cloud liquid water [kg/kg] - REAL(kind_phys) QICEC ( IJSDIM, KMAX ) !! cumulus cloud ice [kg/kg] - REAL(kind_phys) GPRCPF( IJSDIM, KMAX ) !! rainfall flux at full level - REAL(kind_phys) GSNWPF( IJSDIM, KMAX ) !! snowfall flux at full level + REAL(kind_phys) QLIQC ( IJSDIM, KMAX ) ! cumulus cloud liquid water [kg/kg] + REAL(kind_phys) QICEC ( IJSDIM, KMAX ) ! cumulus cloud ice [kg/kg] + REAL(kind_phys) GPRCPF( IJSDIM, KMAX ) ! rainfall flux at full level + REAL(kind_phys) GSNWPF( IJSDIM, KMAX ) ! snowfall flux at full level ! - REAL(kind_phys) GTCFRC( IJSDIM, KMAX ) !! change in cloud fraction - REAL(kind_phys) FLIQC ( IJSDIM, KMAX ) !! liquid ratio in cumulus + REAL(kind_phys) GTCFRC( IJSDIM, KMAX ) ! change in cloud fraction + REAL(kind_phys) FLIQC ( IJSDIM, KMAX ) ! liquid ratio in cumulus ! !#ifdef OPT_CHASER -! REAL(kind_phys) RFXC ( IJSDIM, KMAX+1 ) !! precipi. flx [kg/m2/s] -! REAL(kind_phys) SFXC ( IJSDIM, KMAX+1 ) !! ice/snow flx [kg/m2/s] -! INTEGER LEVCUM( IJSDIM, KMAX ) !! flag for cum. cloud top -! REAL(kind_phys) LNFRC ( IJSDIM, KMAX ) !! areal rates of clouds -! REAL(kind_phys) REVC ( IJSDIM, KMAX ) !! evaporation rates +! REAL(kind_phys) RFXC ( IJSDIM, KMAX+1 ) ! precipi. flx [kg/m2/s] +! REAL(kind_phys) SFXC ( IJSDIM, KMAX+1 ) ! ice/snow flx [kg/m2/s] +! INTEGER LEVCUM( IJSDIM, KMAX ) ! flag for cum. cloud top +! REAL(kind_phys) LNFRC ( IJSDIM, KMAX ) ! areal rates of clouds +! REAL(kind_phys) REVC ( IJSDIM, KMAX ) ! evaporation rates !#endif ! - REAL(kind_phys) GDCFRC( IJSDIM, KMAX ) !! cloud fraction + REAL(kind_phys) GDCFRC( IJSDIM, KMAX ) ! cloud fraction ! -! REAL(kind_phys) GTQL ( IJSDIM, KMAX ) !! tendency of cloud liquid +! REAL(kind_phys) GTQL ( IJSDIM, KMAX ) ! tendency of cloud liquid ! - REAL(kind_phys) GDW ( IJSDIM, KMAX ) !! total water - REAL(kind_phys) GDQS ( IJSDIM, KMAX ) !! saturate moisture + REAL(kind_phys) GDW ( IJSDIM, KMAX ) ! total water + REAL(kind_phys) GDQS ( IJSDIM, KMAX ) ! saturate moisture REAL(kind_phys) FDQS ( IJSDIM, KMAX ) REAL(kind_phys) GAM ( IJSDIM, KMAX ) - REAL(kind_phys) GDS ( IJSDIM, KMAX ) !! dry static energy - REAL(kind_phys) GDH ( IJSDIM, KMAX ) !! moist static energy - REAL(kind_phys) GDHS ( IJSDIM, KMAX ) !! saturate MSE -! - REAL(kind_phys) GCYM ( IJSDIM, KMAX, NCTP ) !! norm. mass flux (half lev) - REAL(kind_phys) GCHB ( IJSDIM ) !! cloud base MSE-Li*Qi - REAL(kind_phys) GCWB ( IJSDIM ) !! cloud base total water - REAL(kind_phys) GCtrB ( IJSDIM, ntrq:ntr ) !! cloud base water vapor tracer - REAL(kind_phys) GCUB ( IJSDIM ) !! cloud base U - REAL(kind_phys) GCVB ( IJSDIM ) !! cloud base V - REAL(kind_phys) GCIB ( IJSDIM ) !! cloud base ice - REAL(kind_phys) ELAM ( IJSDIM, KMAX, NCTP ) !! entrainment (rate*massflux) - REAL(kind_phys) GCYT ( IJSDIM, NCTP ) !! norm. mass flux @top - REAL(kind_phys) GCHT ( IJSDIM, NCTP ) !! cloud top MSE - REAL(kind_phys) GCQT ( IJSDIM, NCTP ) !! cloud top q - REAL(kind_phys) GCwT ( IJSDIM ) !! cloud top total water - REAL(kind_phys) GCUT ( IJSDIM, NCTP ) !! cloud top U - REAL(kind_phys) GCVT ( IJSDIM, NCTP ) !! cloud top V - REAL(kind_phys) GCLT ( IJSDIM, NCTP ) !! cloud top cloud water - REAL(kind_phys) GCIT ( IJSDIM, NCTP ) !! cloud top cloud ice + REAL(kind_phys) GDS ( IJSDIM, KMAX ) ! dry static energy + REAL(kind_phys) GDH ( IJSDIM, KMAX ) ! moist static energy + REAL(kind_phys) GDHS ( IJSDIM, KMAX ) ! saturate MSE +! + REAL(kind_phys) GCYM ( IJSDIM, KMAX, NCTP ) ! norm. mass flux (half lev) + REAL(kind_phys) GCHB ( IJSDIM ) ! cloud base MSE-Li*Qi + REAL(kind_phys) GCWB ( IJSDIM ) ! cloud base total water + REAL(kind_phys) GCtrB ( IJSDIM, ntrq:ntr ) ! cloud base water vapor tracer + REAL(kind_phys) GCUB ( IJSDIM ) ! cloud base U + REAL(kind_phys) GCVB ( IJSDIM ) ! cloud base V + REAL(kind_phys) GCIB ( IJSDIM ) ! cloud base ice + REAL(kind_phys) ELAM ( IJSDIM, KMAX, NCTP ) ! entrainment (rate*massflux) + REAL(kind_phys) GCYT ( IJSDIM, NCTP ) ! norm. mass flux @top + REAL(kind_phys) GCHT ( IJSDIM, NCTP ) ! cloud top MSE + REAL(kind_phys) GCQT ( IJSDIM, NCTP ) ! cloud top q + REAL(kind_phys) GCwT ( IJSDIM ) ! cloud top total water + REAL(kind_phys) GCUT ( IJSDIM, NCTP ) ! cloud top U + REAL(kind_phys) GCVT ( IJSDIM, NCTP ) ! cloud top V + REAL(kind_phys) GCLT ( IJSDIM, NCTP ) ! cloud top cloud water + REAL(kind_phys) GCIT ( IJSDIM, NCTP ) ! cloud top cloud ice REAL(kind_phys) GCtrT (IJSDIM, ntrq:ntr, NCTP) ! cloud top tracer - REAL(kind_phys) GTPRT ( IJSDIM, NCTP ) !! precipitation/M - REAL(kind_phys) GCLZ ( IJSDIM, KMAX ) !! cloud liquid for each CTP - REAL(kind_phys) GCIZ ( IJSDIM, KMAX ) !! cloud ice for each CTP + REAL(kind_phys) GTPRT ( IJSDIM, NCTP ) ! precipitation/M + REAL(kind_phys) GCLZ ( IJSDIM, KMAX ) ! cloud liquid for each CTP + REAL(kind_phys) GCIZ ( IJSDIM, KMAX ) ! cloud ice for each CTP - REAL(kind_phys) ACWF ( IJSDIM ) !! cloud work function - REAL(kind_phys) GPRCIZ( IJSDIM, KMAX+1, NCTP ) !! precipitation - REAL(kind_phys) GSNWIZ( IJSDIM, KMAX+1, NCTP ) !! snowfall - REAL(kind_phys) GTPRC0( IJSDIM ) !! precip. before evap. + REAL(kind_phys) ACWF ( IJSDIM ) ! cloud work function + REAL(kind_phys) GPRCIZ( IJSDIM, KMAX+1, NCTP ) ! precipitation + REAL(kind_phys) GSNWIZ( IJSDIM, KMAX+1, NCTP ) ! snowfall + REAL(kind_phys) GTPRC0( IJSDIM ) ! precip. before evap. - REAL(kind_phys) GMFLX ( IJSDIM, KMAX+1 ) !! mass flux (updraft+downdraft) - REAL(kind_phys) QLIQ ( IJSDIM, KMAX ) !! total cloud liquid - REAL(kind_phys) QICE ( IJSDIM, KMAX ) !! total cloud ice - REAL(kind_phys) GPRCI ( IJSDIM, KMAX ) !! rainfall generation - REAL(kind_phys) GSNWI ( IJSDIM, KMAX ) !! snowfall generation + REAL(kind_phys) GMFLX ( IJSDIM, KMAX+1 ) ! mass flux (updraft+downdraft) + REAL(kind_phys) QLIQ ( IJSDIM, KMAX ) ! total cloud liquid + REAL(kind_phys) QICE ( IJSDIM, KMAX ) ! total cloud ice + REAL(kind_phys) GPRCI ( IJSDIM, KMAX ) ! rainfall generation + REAL(kind_phys) GSNWI ( IJSDIM, KMAX ) ! snowfall generation - REAL(kind_phys) GPRCP ( IJSDIM, KMAX+1 ) !! rainfall flux + REAL(kind_phys) GPRCP ( IJSDIM, KMAX+1 ) ! rainfall flux ! - REAL(kind_phys) GTEVP ( IJSDIM, KMAX ) !! evaporation+sublimation - REAL(kind_phys) GMDD ( IJSDIM, KMAX+1 ) !! downdraft mass flux + REAL(kind_phys) GTEVP ( IJSDIM, KMAX ) ! evaporation+sublimation + REAL(kind_phys) GMDD ( IJSDIM, KMAX+1 ) ! downdraft mass flux - REAL(kind_phys) CUMHGT( IJSDIM, NCTP ) !! cloud top height - REAL(kind_phys) CTOPP ( IJSDIM ) !! cloud top pressure + REAL(kind_phys) CUMHGT( IJSDIM, NCTP ) ! cloud top height + REAL(kind_phys) CTOPP ( IJSDIM ) ! cloud top pressure - REAL(kind_phys) GDZTR ( IJSDIM ) !! tropopause height - REAL(kind_phys) FLIQOU( IJSDIM, KMAX ) !! liquid ratio in cumulus + REAL(kind_phys) GDZTR ( IJSDIM ) ! tropopause height + REAL(kind_phys) FLIQOU( IJSDIM, KMAX ) ! liquid ratio in cumulus !#ifdef OPT_CHASER ! REAL(kind_phys) TOPFLX( IJSDIM, NCTP ) !! flux at each cloud top !#endif INTEGER KB ( IJSDIM ) - INTEGER KSTRT ( IJSDIM ) !! tropopause level + INTEGER KSTRT ( IJSDIM ) ! tropopause level REAL(kind_phys) GAMX REAL(kind_phys) CIN ( IJSDIM ) INTEGER JBUOY ( IJSDIM ) REAL(kind_phys) DELZ, BUOY, DELWC, DELER -!M REAL(kind_phys) WCB ( NCTP ) !! updraft velocity**2 @base +!M REAL(kind_phys) WCB ( NCTP ) ! updraft velocity**2 @base !M SAVE WCB REAL(kind_phys) WCBX (IJSDIM) -! REAL(kind_phys) ERMR ( NCTP ) !! entrainment rate (ASMODE) +! REAL(kind_phys) ERMR ( NCTP ) ! entrainment rate (ASMODE) ! SAVE ERMR - INTEGER KTMX ( NCTP ) !! max of cloud top - INTEGER KTMXT !! max of cloud top + INTEGER KTMX ( NCTP ) ! max of cloud top + INTEGER KTMXT ! max of cloud top REAL(kind_phys) TIMED REAL(kind_phys) GDCLDX, GDMU2X, GDMU3X ! @@ -760,26 +760,26 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions INTEGER KBMX, I, K, CTP, ierr, n, kp1, l, l1, kk, kbi, kmi, km1 real(kind_phys) tem1, tem2, tem3, cbmfl, mflx_e, teme, tems - REAL(kind_phys) HBGT ( IJSDIM ) !! imbalance in column heat - REAL(kind_phys) WBGT ( IJSDIM ) !! imbalance in column water + REAL(kind_phys) HBGT ( IJSDIM ) ! imbalance in column heat + REAL(kind_phys) WBGT ( IJSDIM ) ! imbalance in column water !DDsigma begin local work variables - all on model interfaces (sfc=1) - REAL(kind_phys) lamdai( IJSDIM, KMAX+1, nctp ) !! lamda for cloud type ctp - REAL(kind_phys) lamdaprod( IJSDIM, KMAX+1 ) !! product of (1+lamda) through cloud type ctp - REAL(kind_phys) gdrhom !! density - REAL(kind_phys) gdtvm !! virtual temperature - REAL(kind_phys) gdqm, gdwm,gdlm, gdim !! water vaper + REAL(kind_phys) lamdai( IJSDIM, KMAX+1, nctp ) ! lamda for cloud type ctp + REAL(kind_phys) lamdaprod( IJSDIM, KMAX+1 ) ! product of (1+lamda) through cloud type ctp + REAL(kind_phys) gdrhom ! density + REAL(kind_phys) gdtvm ! virtual temperature + REAL(kind_phys) gdqm, gdwm,gdlm, gdim ! water vaper REAL(kind_phys) gdtrm(ntrq:ntr) ! tracer character(len=4) :: cproc !DDsigmadiag ! the following are new arguments to cumup to get them out - REAL(kind_phys) wcv( IJSDIM, KMAX+1, nctp) !! in-cloud vertical velocity - REAL(kind_phys) GCTM ( IJSDIM, KMAX+1 ) !! cloud T (half lev) !DDsigmadiag make output - REAL(kind_phys) GCQM ( IJSDIM, KMAX+1, nctp ) !! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GCwM ( IJSDIM, KMAX+1, nctp ) !! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GCiM ( IJSDIM, KMAX+1 ) !! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GClM ( IJSDIM, KMAX+1 ) !! cloud q (half lev) !DDsigmadiag make output - REAL(kind_phys) GChM ( IJSDIM, KMAX+1, nctp ) !! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) wcv( IJSDIM, KMAX+1, nctp) ! in-cloud vertical velocity + REAL(kind_phys) GCTM ( IJSDIM, KMAX+1 ) ! cloud T (half lev) !DDsigmadiag make output + REAL(kind_phys) GCQM ( IJSDIM, KMAX+1, nctp ) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCwM ( IJSDIM, KMAX+1, nctp ) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GCiM ( IJSDIM, KMAX+1 ) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GClM ( IJSDIM, KMAX+1 ) ! cloud q (half lev) !DDsigmadiag make output + REAL(kind_phys) GChM ( IJSDIM, KMAX+1, nctp ) ! cloud q (half lev) !DDsigmadiag make output REAL(kind_phys) GCtrM (IJSDIM, KMAX, ntrq:ntr) ! cloud tracer (half lev) !DDsigmadiag make output ! these are the fluxes at the interfaces - AW will operate on them @@ -800,30 +800,30 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions !DDsigma end local work variables ! ! [INTERNAL PARM] - REAL(kind_phys) :: WCBMIN = 0._kind_phys !! min. of updraft velocity at cloud base -!M REAL(kind_phys) :: WCBMAX = 1.4_kind_phys !! max. of updraft velocity at cloud base + REAL(kind_phys) :: WCBMIN = 0._kind_phys ! min. of updraft velocity at cloud base +!M REAL(kind_phys) :: WCBMAX = 1.4_kind_phys ! max. of updraft velocity at cloud base !M wcbas commented by Moorthi since it is not used -!M REAL(kind_phys) :: WCBAS = 2._kind_phys !! updraft velocity**2 at cloud base (ASMODE) -!M REAL(kind_phys) :: ERAMIN = 1.e-5_kind_phys !! min. of entrainment rate - !! used only in OPT_ASMODE -!M REAL(kind_phys) :: ERAMAX = 2.e-3_kind_phys !! max. of entrainment rate - !! used only in OPT_ASMODE +!M REAL(kind_phys) :: WCBAS = 2._kind_phys ! updraft velocity**2 at cloud base (ASMODE) +!M REAL(kind_phys) :: ERAMIN = 1.e-5_kind_phys ! min. of entrainment rate + ! used only in OPT_ASMODE +!M REAL(kind_phys) :: ERAMAX = 2.e-3_kind_phys ! max. of entrainment rate + ! used only in OPT_ASMODE ! downdraft mass flux terms now slot nctp+1 in the *fluxterm arrays - REAL(kind_phys) dtdwn ( IJSDIM, KMAX ) !! t tendency downdraft detrainment - REAL(kind_phys) dqvdwn ( IJSDIM, KMAX ) !! qv tendency downdraft detrainment - REAL(kind_phys) dqldwn ( IJSDIM, KMAX ) !! ql tendency downdraft detrainment - REAL(kind_phys) dqidwn ( IJSDIM, KMAX ) !! qi tendency downdraft detrainment + REAL(kind_phys) dtdwn ( IJSDIM, KMAX ) ! t tendency downdraft detrainment + REAL(kind_phys) dqvdwn ( IJSDIM, KMAX ) ! qv tendency downdraft detrainment + REAL(kind_phys) dqldwn ( IJSDIM, KMAX ) ! ql tendency downdraft detrainment + REAL(kind_phys) dqidwn ( IJSDIM, KMAX ) ! qi tendency downdraft detrainment REAL(kind_phys), dimension(ijsdim,kmax,ntrq:ntr) :: dtrdwn ! tracer tendency downdraft detrainment - LOGICAL :: OINICB = .false. !! set 0.d0 to CBMFX + LOGICAL :: OINICB = .false. ! set 0.d0 to CBMFX - REAL(kind_phys) :: VARMIN = 1.e-13_kind_phys !! minimum of PDF variance - REAL(kind_phys) :: VARMAX = 5.e-7_kind_phys !! maximum of PDF variance - REAL(kind_phys) :: SKWMAX = 0.566_kind_phys !! maximum of PDF skewness + REAL(kind_phys) :: VARMIN = 1.e-13_kind_phys ! minimum of PDF variance + REAL(kind_phys) :: VARMAX = 5.e-7_kind_phys ! maximum of PDF variance + REAL(kind_phys) :: SKWMAX = 0.566_kind_phys ! maximum of PDF skewness - REAL(kind_phys) :: PSTRMX = 400.e2_kind_phys !! max P of tropopause - REAL(kind_phys) :: PSTRMN = 50.e2_kind_phys !! min P of tropopause - REAL(kind_phys) :: GCRSTR = 1.e-4_kind_phys !! crit. dT/dz tropopause + REAL(kind_phys) :: PSTRMX = 400.e2_kind_phys ! max P of tropopause + REAL(kind_phys) :: PSTRMN = 50.e2_kind_phys ! min P of tropopause + REAL(kind_phys) :: GCRSTR = 1.e-4_kind_phys ! crit. dT/dz tropopause ! 0: mass fixer is not applied ! tracers which may become negative values @@ -835,10 +835,9 @@ SUBROUTINE CS_CUMLUS (im , IJSDIM, KMAX , NTR , & !DD dimensions real(kind=kind_phys), parameter :: zero=0.0, one=1.0 real(kind=kind_phys) :: tem, esat ! - LOGICAL, SAVE :: OFIRST = .TRUE. !! called first time? + LOGICAL, SAVE :: OFIRST = .TRUE. ! called first time? ! - IF ( OFIRST ) THEN - + IF (OFIRST) THEN OFIRST = .FALSE. IF (OINICB) THEN CBMFX = zero From a0801b69045ad6f6bf656dc451fcb6d85ccee298 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 8 Mar 2024 15:20:43 +0000 Subject: [PATCH 163/249] uncomment calculation of cf_upi in order to allow calculation of w_upi --- physics/CONV/Chikira_Sugiyama/cs_conv.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 index ae59db7ba..4e7030dd5 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.F90 +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.F90 @@ -466,7 +466,7 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! CNV_PRC3(i,k) = 0.0 CNV_NDROP(i,k) = 0.0 CNV_NICE(i,k) = 0.0 -! cf_upi(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)),0.1)) + cf_upi(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)),0.1)) ! CLCN(i,k) = cf_upi(i,k) !downdraft is below updraft !! clcn(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)/delta),0.25)) @@ -500,7 +500,7 @@ subroutine cs_conv_run( IJSDIM , KMAX , ntracp1 , NN, & ! CNV_PRC3(i,k) = 0.0 CNV_NDROP(i,k) = 0.0 CNV_NICE(i,k) = 0.0 -! cf_upi(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)),0.1)) + cf_upi(i,k) = max(0.0,min(0.01*log(1.0+500*ud_mf(i,k)),0.1)) ! & 500*ud_mf(i,k)),0.60)) ! CLCN(i,k) = cf_upi(i,k) !downdraft is below updraft From e1db7f20047f292fa7fe23f47b25fe2c535d1679 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 8 Mar 2024 09:49:44 -0700 Subject: [PATCH 164/249] In physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta: change units 'flashes 5 min-1' to 'flashes min-1' and update long name to make clear this is per 5 minutes --- .../UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta index 0c2d1bcbe..5e9b97333 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta @@ -295,24 +295,24 @@ intent = in [ltg1_max] standard_name = lightning_threat_index_1 - long_name = lightning threat index 1 - units = flashes 5 min-1 + long_name = lightning threat index 1 in flashes per 5 minutes + units = flashes min-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = inout [ltg2_max] standard_name = lightning_threat_index_2 - long_name = lightning threat index 2 - units = flashes 5 min-1 + long_name = lightning threat index 2 in flashes per 5 minutes + units = flashes min-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys intent = inout [ltg3_max] standard_name = lightning_threat_index_3 - long_name = lightning threat index 3 - units = flashes 5 min-1 + long_name = lightning threat index 3 in flashes per 5 minutes + units = flashes min-1 dimensions = (horizontal_loop_extent) type = real kind = kind_phys From 26f95141ce3ef4cbc6d78dc9c98eda8dca48466b Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 8 Mar 2024 12:40:51 -0700 Subject: [PATCH 165/249] In physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90, scale lightning threat from flashes per 5 minutes to flashes per minute to match units in metadata --- .../UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 index cd1016053..f66aa77e9 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 @@ -80,6 +80,12 @@ subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, !Lightning threat indices if (lightning_threat) then call lightning_threat_indices + ! Lightning threat indices are calculated as flashes per 5 minutes. + ! In order to scale that to flashes per minute (standard units), + ! we must divide the indices by a factor of 5 / multiply by 0.2 + ltg1_max = 0.2_kind_phys * ltg1_max + ltg2_max = 0.2_kind_phys * ltg2_max + ltg3_max = 0.2_kind_phys * ltg3_max endif !Calculate hourly max 1-km agl and -10C reflectivity From 743dc85aa132a41502c678671a2de93517da8cf8 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 11 Mar 2024 16:25:16 +0000 Subject: [PATCH 166/249] correctly convert from flashes per five minutes to flashes per minute --- .../maximum_hourly_diagnostics.F90 | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 index f66aa77e9..5ac28afe8 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.F90 @@ -15,6 +15,9 @@ module maximum_hourly_diagnostics real(kind=kind_phys), parameter ::PQ0=379.90516E0, A2A=17.2693882, A3=273.16, A4=35.86, RHmin=1.0E-6 ! *DH + ! Conversion from flashes per five minutes to flashes per minute. + real(kind=kind_phys), parameter :: scaling_factor = 0.2 + contains #if 0 @@ -80,12 +83,6 @@ subroutine maximum_hourly_diagnostics_run(im, levs, reset, lradar, imp_physics, !Lightning threat indices if (lightning_threat) then call lightning_threat_indices - ! Lightning threat indices are calculated as flashes per 5 minutes. - ! In order to scale that to flashes per minute (standard units), - ! we must divide the indices by a factor of 5 / multiply by 0.2 - ltg1_max = 0.2_kind_phys * ltg1_max - ltg2_max = 0.2_kind_phys * ltg2_max - ltg3_max = 0.2_kind_phys * ltg3_max endif !Calculate hourly max 1-km agl and -10C reflectivity @@ -201,7 +198,10 @@ subroutine lightning_threat_indices endif IF ( ltg1 .LT. clim1 ) ltg1 = 0. - + + ! Scale to flashes per minue + ltg1 = ltg1 * scaling_factor + IF ( ltg1 .GT. ltg1_max(i) ) THEN ltg1_max(i) = ltg1 ENDIF @@ -214,14 +214,19 @@ subroutine lightning_threat_indices ltg2 = coef2 * totice_colint(i) IF ( ltg2 .LT. clim2 ) ltg2 = 0. + + ! Scale to flashes per minute + ltg2 = ltg2 * scaling_factor IF ( ltg2 .GT. ltg2_max(i) ) THEN ltg2_max(i) = ltg2 ENDIF + ! This calculation is already in flashes per minute. ltg3_max(i) = 0.95 * ltg1_max(i) + 0.05 * ltg2_max(i) - IF ( ltg3_max(i) .LT. clim3 ) ltg3_max(i) = 0. + ! Thus, we must scale clim3. The compiler will optimize this away. + IF ( ltg3_max(i) .LT. clim3 * scaling_factor ) ltg3_max(i) = 0. enddo end subroutine lightning_threat_indices From 7e74ada4d3a1fcbdeab272aa81a8af7b2b878300 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Mon, 11 Mar 2024 16:39:18 +0000 Subject: [PATCH 167/249] correct the meta file --- .../UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta index 5e9b97333..5d18bd9bd 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta @@ -295,7 +295,7 @@ intent = in [ltg1_max] standard_name = lightning_threat_index_1 - long_name = lightning threat index 1 in flashes per 5 minutes + long_name = lightning threat index 1 units = flashes min-1 dimensions = (horizontal_loop_extent) type = real @@ -303,7 +303,7 @@ intent = inout [ltg2_max] standard_name = lightning_threat_index_2 - long_name = lightning threat index 2 in flashes per 5 minutes + long_name = lightning threat index 2 units = flashes min-1 dimensions = (horizontal_loop_extent) type = real @@ -311,7 +311,7 @@ intent = inout [ltg3_max] standard_name = lightning_threat_index_3 - long_name = lightning threat index 3 in flashes per 5 minutes + long_name = lightning threat index 3 units = flashes min-1 dimensions = (horizontal_loop_extent) type = real From 14d0aadc114e7f10275480a157dd5891074011b4 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Tue, 12 Mar 2024 12:18:03 -0400 Subject: [PATCH 168/249] remove veg-dependent opt_diag used in hr3 --- physics/SFC_Layer/UFS/sfc_diag_post.F90 | 14 +------------- physics/SFC_Layer/UFS/sfc_diag_post.meta | 7 ------- 2 files changed, 1 insertion(+), 20 deletions(-) diff --git a/physics/SFC_Layer/UFS/sfc_diag_post.F90 b/physics/SFC_Layer/UFS/sfc_diag_post.F90 index 6945e48e9..de5e38aa4 100644 --- a/physics/SFC_Layer/UFS/sfc_diag_post.F90 +++ b/physics/SFC_Layer/UFS/sfc_diag_post.F90 @@ -14,7 +14,7 @@ module sfc_diag_post !! #endif subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, con_eps, con_epsm1, pgr,& - vegtype,t2mmp,q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, & + t2mmp,q2mp, t2m, q2m, u10m, v10m, tmpmin, tmpmax, spfhmin, spfhmax, & wind10mmax, u10mmax, v10mmax, dpt2m, errmsg, errflg) use machine, only: kind_phys, kind_dbl_prec @@ -22,7 +22,6 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, co implicit none integer, intent(in) :: im, lsm, lsm_noahmp,opt_diag - integer, dimension(:), intent(in) :: vegtype ! vegetation type (integer index) logical, intent(in) :: lssav real(kind=kind_phys), intent(in) :: dtf, con_eps, con_epsm1 logical , dimension(:), intent(in) :: dry @@ -42,17 +41,6 @@ subroutine sfc_diag_post_run (im, lsm, lsm_noahmp, opt_diag, dry, lssav, dtf, co errflg = 0 if (lsm == lsm_noahmp) then -! over shrublands use opt_diag=2 - do i=1, im - if(dry(i)) then - if (vegtype(i) == 6 .or. vegtype(i) == 7 & - .or. vegtype(i) == 16) then - t2m(i) = t2mmp(i) - q2m(i) = q2mp(i) - endif - endif - enddo - if (opt_diag == 2 .or. opt_diag == 3) then do i=1,im if(dry(i)) then diff --git a/physics/SFC_Layer/UFS/sfc_diag_post.meta b/physics/SFC_Layer/UFS/sfc_diag_post.meta index 4abb3bac0..8c74e2154 100644 --- a/physics/SFC_Layer/UFS/sfc_diag_post.meta +++ b/physics/SFC_Layer/UFS/sfc_diag_post.meta @@ -82,13 +82,6 @@ type = real kind = kind_phys intent = in -[vegtype] - standard_name = vegetation_type_classification - long_name = vegetation type at each grid cell - units = index - dimensions = (horizontal_loop_extent) - type = integer - intent= in [t2mmp] standard_name = temperature_at_2m_from_noahmp long_name = 2 meter temperature from noahmp From 14977720be452f40ede05ca7ad98a83a030a91f8 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 12 Mar 2024 18:44:20 +0000 Subject: [PATCH 169/249] Introduce namelist flag to convection/cloud/radiation interaction in GFS suite --- .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 | 6 +-- .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta | 7 ++++ physics/Radiation/radiation_clouds.f | 38 +++++++++++++++---- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 index 5da5c86fb..767d3e534 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 @@ -19,7 +19,7 @@ module GFS_rrtmg_pre !>\section rrtmg_pre_gen General Algorithm subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& ltp, imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, me, ncnd, ntrac, & - num_p3d, npdf3d, & + num_p3d, npdf3d, xr_cnvcld, & ncnvcld3d,ntqv, ntcw,ntiw, ntlnc, ntinc, ntrnc, ntsnc, ntccn, top_at_1,& ntrw, ntsw, ntgl, nthl, ntwa, ntoz, ntsmoke, ntdust, ntcoarsepm, & ntclamt, nleffr, nieffr, nseffr, lndp_type, kdt, & @@ -129,7 +129,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& uni_cld, effr_in, do_mynnedmf, & lmfshal, lmfdeep2, pert_clds, lcrick,& lcnorm, top_at_1, lextop, mraerosol - logical, intent(in) :: rrfs_sd, aero_dir_fdb + logical, intent(in) :: rrfs_sd, aero_dir_fdb, xr_cnvcld logical, intent(in) :: nssl_ccn_on, nssl_invertccn integer, intent(in) :: spp_rad @@ -981,7 +981,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& & iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, & & idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, & & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, do_mynnedmf, & - & lgfdlmprad, & + & lgfdlmprad, xr_cnvcld, & & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, & & effrl, effri, effrr, effrs, effr_in, & & effrl_inout, effri_inout, effrs_inout, & diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta index 43802298b..15039e822 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta @@ -56,6 +56,13 @@ dimensions = () type = logical intent = in +[xr_cnvcld] + standard_name = flag_for_suspended_convective_clouds_in_Xu_Randall + long_name = flag for using suspended convective clouds in Xu Randall + units = flag + dimensions = () + type = logical + intent = in [ltp] standard_name = extra_top_layer long_name = extra top layer for radiation diff --git a/physics/Radiation/radiation_clouds.f b/physics/Radiation/radiation_clouds.f index 111be4019..979405cdb 100644 --- a/physics/Radiation/radiation_clouds.f +++ b/physics/Radiation/radiation_clouds.f @@ -348,7 +348,7 @@ subroutine radiation_clouds_prop & & iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, & & idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, & & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, & - & do_mynnedmf, lgfdlmprad, & + & do_mynnedmf, lgfdlmprad, xr_cnvcld, & & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, & & effrl, effri, effrr, effrs, effr_in, & & effrl_inout, effri_inout, effrs_inout, & @@ -538,7 +538,8 @@ subroutine radiation_clouds_prop & logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in, & - & do_mynnedmf, lgfdlmprad, top_at_1, lcrick, lcnorm + & do_mynnedmf, lgfdlmprad, top_at_1, lcrick, lcnorm, & + & xr_cnvcld real (kind=kind_phys), dimension(:,:,:), intent(in) :: ccnd, & & tracer1 @@ -727,7 +728,7 @@ subroutine radiation_clouds_prop & call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs & rhly,tracer1,xlat,xlon,slmsk,dz,delp, & & ntrac-1, ntcw-1,ntiw-1,ntrw-1, & - & ntsw-1,ntgl-1,con_ttp, & + & ntsw-1,ntgl-1,con_ttp,xr_cnvcld, & & IX, NLAY, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:NLAY), cnvw, effrl_inout, & & effri_inout, effrs_inout, & @@ -801,7 +802,7 @@ subroutine radiation_clouds_prop & call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs & rhly,tracer1,xlat,xlon,slmsk,dz,delp, & & ntrac-1, ntcw-1,ntiw-1,ntrw-1, & - & ntsw-1,ntgl-1,con_ttp, & + & ntsw-1,ntgl-1,con_ttp,xr_cnvcld, & & IX, NLAY, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:NLAY), cnvw, effrl, effri, effrs, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & @@ -1964,7 +1965,7 @@ subroutine progcld_thompson_wsm6 & & ( plyr,plvl,tlyr,qlyr,qstl,rhly,clw, & ! --- inputs: & xlat,xlon,slmsk,dz,delp, & & ntrac,ntcw,ntiw,ntrw,ntsw,ntgl,con_ttp, & - & IX, NLAY, NLP1, & + & xr_cnvcld, IX, NLAY, NLP1, & & uni_cld, lmfshal, lmfdeep2, cldcov, cnvw, & & re_cloud,re_ice,re_snow, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & @@ -2051,7 +2052,8 @@ subroutine progcld_thompson_wsm6 & integer, intent(in) :: IX, NLAY, NLP1 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw, ntsw, ntgl - logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm + logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm, & + & xr_cnvcld real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, qlyr, qstl, rhly, cldcov, delp, dz, dzlay, & @@ -2122,23 +2124,43 @@ subroutine progcld_thompson_wsm6 & ! enddo ! endif +!> - Include grid-mean suspended cloud condensate in Xu-Randall cloud fraction +!> if xr_cnvcld is true: + + if(xr_cnvcld)then do k = 1, NLAY do i = 1, IX clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw) + clw(i,k,ntsw) & + clw(i,k,ntrw) + cnvw(i,k) enddo enddo + else + do k = 1, NLAY + do i = 1, IX + clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw) + clw(i,k,ntsw) + & + clw(i,k,ntrw) + enddo + enddo + endif !> - Compute total-cloud liquid/ice condensate path in \f$ g/m^2 \f$. !> The total condensate includes convective condensate. do k = 1, NLAY-1 do i = 1, IX - tem1 = cnvw(i,k)*(1.-tem2d(i,k)) + if(xr_cnvcld)then + tem1 = cnvw(i,k)*(1.-tem2d(i,k)) + else + tem1 = 0. + endif cwp(i,k) = max(0.0, (clw(i,k,ntcw)+tem1) * & gfac * delp(i,k)) if(tem1 > 1.e-12 .and. clw(i,k,ntcw) < 1.e-12) & rew(i,k)=reliq_def - tem2 = cnvw(i,k)*tem2d(i,k) + if(xr_cnvcld)then + tem2 = cnvw(i,k)*tem2d(i,k) + else + tem2 = 0. + endif cip(i,k) = max(0.0, (clw(i,k,ntiw) + & snow2ice*clw(i,k,ntsw) + tem2) * & gfac * delp(i,k)) From c77b9e8f4772450b5c7ec89575ccb53aa5bcaa22 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 13 Mar 2024 10:11:08 -0400 Subject: [PATCH 170/249] fix metadata error in cs_conv.meta --- physics/CONV/Chikira_Sugiyama/cs_conv.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.meta b/physics/CONV/Chikira_Sugiyama/cs_conv.meta index 49e460ed6..d75ab1006 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.meta @@ -258,7 +258,7 @@ standard_name = convective_updraft_area_fraction_at_model_interfaces long_name = convective updraft area fraction at model interfaces units = frac - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) type = real kind = kind_phys intent = out From bbdec2ffceeb0cda70aaaa4f44e619a5468e7be3 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 13 Mar 2024 10:50:38 -0400 Subject: [PATCH 171/249] fix convective_updraft_area_fraction_at_model_interfaces metadata --- physics/CONV/Chikira_Sugiyama/cs_conv_post.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv_post.meta b/physics/CONV/Chikira_Sugiyama/cs_conv_post.meta index 75de3fca7..5877c051b 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv_post.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv_post.meta @@ -33,7 +33,7 @@ standard_name = convective_updraft_area_fraction_at_model_interfaces long_name = convective updraft area fraction at model interfaces units = frac - dimensions = (horizontal_loop_extent,vertical_layer_dimension) + dimensions = (horizontal_loop_extent,vertical_interface_dimension) type = real kind = kind_phys intent = in From 457d2caf228c83f234e823d8e0ce9003c6d73a00 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 22 Mar 2024 10:18:21 -0600 Subject: [PATCH 172/249] Bug fix: remove invalid active attribute in several metadata files --- physics/GWD/cires_ugwp.meta | 1 - physics/GWD/drag_suite.meta | 1 - physics/GWD/gwdc_post.meta | 1 - physics/GWD/rayleigh_damp.meta | 1 - physics/PBL/HEDMF/hedmf.meta | 1 - physics/SFC_Models/Lake/CLM/clm_lake.meta | 1 - physics/smoke_dust/rrfs_smoke_wrapper.meta | 3 --- 7 files changed, 9 deletions(-) diff --git a/physics/GWD/cires_ugwp.meta b/physics/GWD/cires_ugwp.meta index cd0192ca7..28faaeadf 100644 --- a/physics/GWD/cires_ugwp.meta +++ b/physics/GWD/cires_ugwp.meta @@ -840,7 +840,6 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - active = (flag_for_diagnostics_3D) intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index diff --git a/physics/GWD/drag_suite.meta b/physics/GWD/drag_suite.meta index 94dddcc93..be0449bd5 100644 --- a/physics/GWD/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -580,7 +580,6 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - active = (flag_for_diagnostics_3D) intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index diff --git a/physics/GWD/gwdc_post.meta b/physics/GWD/gwdc_post.meta index 97649d4cf..ba179181d 100644 --- a/physics/GWD/gwdc_post.meta +++ b/physics/GWD/gwdc_post.meta @@ -115,7 +115,6 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - active = (flag_for_diagnostics_3D) intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index diff --git a/physics/GWD/rayleigh_damp.meta b/physics/GWD/rayleigh_damp.meta index 525acbe8b..5c5271b7d 100644 --- a/physics/GWD/rayleigh_damp.meta +++ b/physics/GWD/rayleigh_damp.meta @@ -137,7 +137,6 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - active = (flag_for_diagnostics_3D) intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index diff --git a/physics/PBL/HEDMF/hedmf.meta b/physics/PBL/HEDMF/hedmf.meta index be0c83741..a5c6d73d9 100644 --- a/physics/PBL/HEDMF/hedmf.meta +++ b/physics/PBL/HEDMF/hedmf.meta @@ -530,7 +530,6 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - active = (flag_for_diagnostics_3D) intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.meta b/physics/SFC_Models/Lake/CLM/clm_lake.meta index 99c7970d3..7b3bc0a49 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.meta +++ b/physics/SFC_Models/Lake/CLM/clm_lake.meta @@ -901,7 +901,6 @@ units = flag dimensions = () type = logical - active = (control_for_lake_model_selection == 3) intent = in [clm_debug_print] standard_name = flag_for_printing_in_clm_lake_model diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index 1f26e5a93..cbc25a611 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -135,7 +135,6 @@ units = index dimensions = () type = integer - active = (do_smoke_coupling) intent = in [dust_moist_correction_in] standard_name = dust_moist_correction_fengsha_dust_scheme @@ -144,7 +143,6 @@ dimensions = () type = real kind = kind_phys - active = (do_smoke_coupling) intent = in [dust_drylimit_factor_in] standard_name = dust_drylimit_factor_fengsha_dust_scheme @@ -153,7 +151,6 @@ dimensions = () type = real kind = kind_phys - active = (do_smoke_coupling) intent = in [aero_ind_fdb_in] standard_name = do_smoke_aerosol_indirect_feedback From 0ff86ac719fe84eeb796094c482abf9061284fa4 Mon Sep 17 00:00:00 2001 From: Helin Wei Date: Thu, 28 Mar 2024 12:56:07 -0400 Subject: [PATCH 173/249] use radiative temp as skin temp to the atmosphere --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index c2c03d0de..0f2e4e717 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -658,6 +658,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: precip_freeze_frac_in ! used for penman calculation real (kind=kind_phys) :: virtfac1 ! virtual factor + real (kind=kind_phys) :: tflux ! surface flux temp real (kind=kind_phys) :: tvs1 ! surface virtual temp real (kind=kind_phys) :: vptemp ! virtual potential temp @@ -934,7 +935,8 @@ subroutine noahmpdrv_run & t2mmp(i) = temperature_bare_2m q2mp(i) = spec_humidity_bare_2m - tskin(i) = temperature_ground + tskin(i) = temperature_radiative + tflux = temperature_ground surface_temperature = temperature_ground vegetation_fraction = vegetation_frac ch_vegetated = 0.0 @@ -1024,7 +1026,8 @@ subroutine noahmpdrv_run & q2mp(i) = spec_humidity_veg_2m * vegetation_fraction + & spec_humidity_bare_2m * (1-vegetation_fraction) - tskin(i) = surface_temperature + tskin(i) = temperature_radiative + tflux = surface_temperature endif ! glacial split ends @@ -1170,9 +1173,9 @@ subroutine noahmpdrv_run & endif if(thsfc_loc) then ! Use local potential temperature - tvs1 = tskin(i) * virtfac1 + tvs1 = tflux * virtfac1 else ! Use potential temperature referenced to 1000 hPa - tvs1 = tskin(i)/prsik1(i) * virtfac1 + tvs1 = tflux/prsik1(i) * virtfac1 endif z0_total = max(min(z0_total,forcing_height),1.0e-6) From 5e3f87adb858a4dad1accbe486b645bf0d164039 Mon Sep 17 00:00:00 2001 From: "anning.cheng" Date: Fri, 29 Mar 2024 15:21:48 -0400 Subject: [PATCH 174/249] create mr2_innl and fixed evaporation for mraerosol --- physics/MP/Thompson/module_mp_thompson.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/MP/Thompson/module_mp_thompson.F90 b/physics/MP/Thompson/module_mp_thompson.F90 index 62e2688c7..a5f7cf207 100644 --- a/physics/MP/Thompson/module_mp_thompson.F90 +++ b/physics/MP/Thompson/module_mp_thompson.F90 @@ -3587,7 +3587,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & !+---+-----------------------------------------------------------------+ ! EVAPORATION elseif (clap .lt. -eps .AND. ssatw(k).lt.-1.E-6 .AND. & - (is_aerosol_aware .or. merra2_aerosol_aware)) then + (is_aerosol_aware)) then tempc = temp(k) - 273.15 otemp = 1./temp(k) rvs = rho(k)*qvs(k) From cb2eedd54241523ca8bab09af86b4a45fa0bdd1b Mon Sep 17 00:00:00 2001 From: "anning.cheng" Date: Mon, 1 Apr 2024 14:48:03 -0400 Subject: [PATCH 175/249] fixed excessive evap --- physics/MP/Thompson/module_mp_thompson.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/MP/Thompson/module_mp_thompson.F90 b/physics/MP/Thompson/module_mp_thompson.F90 index a5f7cf207..af1a0fc0d 100644 --- a/physics/MP/Thompson/module_mp_thompson.F90 +++ b/physics/MP/Thompson/module_mp_thompson.F90 @@ -3587,7 +3587,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & !+---+-----------------------------------------------------------------+ ! EVAPORATION elseif (clap .lt. -eps .AND. ssatw(k).lt.-1.E-6 .AND. & - (is_aerosol_aware)) then + is_aerosol_aware) then tempc = temp(k) - 273.15 otemp = 1./temp(k) rvs = rho(k)*qvs(k) From 9e5eeb83f70a2d6730684617306dc58c88fb2162 Mon Sep 17 00:00:00 2001 From: helin wei Date: Thu, 4 Apr 2024 15:09:44 +0000 Subject: [PATCH 176/249] create a single_loop_alternate for hr4_test3 --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 6abd59f69..d97a81ba2 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -4052,11 +4052,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & end if -! prepare for longwave rad. - - air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4 - cir = (2.-emv*(1.-emg))*emv*sb -! if(opt_sfc == 4) then gdx = sqrt(garea1) @@ -4203,6 +4198,11 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & end if end if +! prepare for longwave rad. + + air = -emv*(1.+(1.-emv)*(1.-emg))*lwdn - emv*emg*sb*tg**4 + cir = (2.-emv*(1.-emg))*emv*sb + ! prepare for sensible heat flux above veg. cah = 1./rahc @@ -4265,7 +4265,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & ! update vegetation surface temperature tv = tv + dtv -! tah = ata + bta*tv ! canopy air t; update here for consistency + tah = ata + bta*tv ! canopy air t; update here for consistency ! for computing m-o length in the next iteration h = rhoair*cpair*(tah - sfctmp) /rahc @@ -4278,15 +4278,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & qfx = (qsfc-qair)*rhoair*caw endif - - if (liter == 1) then - exit loop1 - endif - if (iter >= 5 .and. abs(dtv) <= 0.01 .and. liter == 0) then - liter = 1 - endif - - end do loop1 ! end stability iteration +! after canopy balance, do the under-canopy ground balance ! under-canopy fluxes and tg @@ -4296,8 +4288,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & cev = rhoair*cpair / (gammag*(rawg+rsurf)) ! barlage: change to ground v3.6 cgh = 2.*df(isnow+1)/dzsnso(isnow+1) - loop2: do iter = 1, niterg - t = tdc(tg) call esat(t, esatw, esati, dsatw, dsati) if (t .gt. 0.) then @@ -4323,7 +4313,14 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & gh = gh + cgh*dtg tg = tg + dtg - end do loop2 + if (liter == 1) then + exit loop1 + endif + if (iter >= 5 .and. abs(dtv) <= 0.01 .and. abs(dtg) <= 0.01 .and. liter == 0) then + liter = 1 ! if conditions are met, then do one final loop + endif + + end do loop1 ! tah = (cah*sfctmp + cvh*tv + cgh*tg)/(cah + cvh + cgh) From e039a94ae1a718fe7e7c517c1f61c6d4fc100c8d Mon Sep 17 00:00:00 2001 From: helin wei Date: Mon, 8 Apr 2024 23:13:53 +0000 Subject: [PATCH 177/249] opt_trs bug fixed --- physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index d97a81ba2..e519e472c 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -5873,7 +5873,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, z0h_out = z0m_out - elseif (opt_trs == chen09 .or. opt_trs == tessel) then + elseif (opt_trs == tessel) then if (vegtyp <= 5) then z0h_out = z0m_out @@ -5881,7 +5881,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, z0h_out = z0m_out * 0.01 endif - elseif (opt_trs == blumel99) then + elseif (opt_trs == chen09 .or. opt_trs == blumel99) then reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c if (reyn > 2.0) then From e4d091f84772c373d0a3f9ed6cace8d33061812a Mon Sep 17 00:00:00 2001 From: DWesl <22566757+DWesl@users.noreply.github.com> Date: Tue, 9 Apr 2024 17:35:38 -0400 Subject: [PATCH 178/249] Make ozone photochem diagnostics match parametrization terms The ozone photochemistry parametrization is a first-order Taylor expansion of the net ozone production in three variables. This commit changes the four diagnostics the parametrization manages to match the four terms in the Taylor expansion. When comparing to the implementation in lines 301-304, note that it is implicit in the model ozone mixing ratio, so line 301 has the first term and the second half of the second term, while the first half of the second term is part of the denominator on line 304. I could use ozi or ozib for an explicit approximation to that term, but we already calculated the value needed for the implicit calculation actually used for the update. --- physics/photochem/module_ozphys.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/photochem/module_ozphys.F90 b/physics/photochem/module_ozphys.F90 index b66eb0a74..0b3435e6c 100644 --- a/physics/photochem/module_ozphys.F90 +++ b/physics/photochem/module_ozphys.F90 @@ -306,8 +306,8 @@ subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do_diag, do3_ ! Diagnostics (optional) if (do_diag) then - do3_dt_prd(:,iLev) = (prod(:,1)-prod(:,2)*prod(:,6))*dt - do3_dt_ozmx(:,iLev) = (oz(:,iLev) - ozib(:)) + do3_dt_prd(:,iLev) = prod(:,1) * dt + do3_dt_ozmx(:,iLev) = prod(:,2) * (oz(:,iLev) - prod(:,6)) * dt do3_dt_temp(:,iLev) = prod(:,3)*(t(:,iLev)-prod(:,5))*dt do3_dt_ohoz(:,iLev) = prod(:,4) * (colo3(:,iLev)-coloz(:,iLev))*dt endif From f6082ba019833dd66c98df5a976f3f0caf633200 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 12 Mar 2024 18:44:20 +0000 Subject: [PATCH 179/249] Introduce namelist flag to convection/cloud/radiation interaction in GFS suite --- .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 | 6 +-- .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta | 7 ++++ physics/Radiation/radiation_clouds.f | 38 +++++++++++++++---- 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 index 5da5c86fb..767d3e534 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 @@ -19,7 +19,7 @@ module GFS_rrtmg_pre !>\section rrtmg_pre_gen General Algorithm subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& ltp, imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, me, ncnd, ntrac, & - num_p3d, npdf3d, & + num_p3d, npdf3d, xr_cnvcld, & ncnvcld3d,ntqv, ntcw,ntiw, ntlnc, ntinc, ntrnc, ntsnc, ntccn, top_at_1,& ntrw, ntsw, ntgl, nthl, ntwa, ntoz, ntsmoke, ntdust, ntcoarsepm, & ntclamt, nleffr, nieffr, nseffr, lndp_type, kdt, & @@ -129,7 +129,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& uni_cld, effr_in, do_mynnedmf, & lmfshal, lmfdeep2, pert_clds, lcrick,& lcnorm, top_at_1, lextop, mraerosol - logical, intent(in) :: rrfs_sd, aero_dir_fdb + logical, intent(in) :: rrfs_sd, aero_dir_fdb, xr_cnvcld logical, intent(in) :: nssl_ccn_on, nssl_invertccn integer, intent(in) :: spp_rad @@ -981,7 +981,7 @@ subroutine GFS_rrtmg_pre_run (im, levs, lm, lmk, lmp, n_var_lndp, lextop,& & iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, & & idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, & & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, do_mynnedmf, & - & lgfdlmprad, & + & lgfdlmprad, xr_cnvcld, & & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, & & effrl, effri, effrr, effrs, effr_in, & & effrl_inout, effri_inout, effrs_inout, & diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta index 43802298b..15039e822 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta @@ -56,6 +56,13 @@ dimensions = () type = logical intent = in +[xr_cnvcld] + standard_name = flag_for_suspended_convective_clouds_in_Xu_Randall + long_name = flag for using suspended convective clouds in Xu Randall + units = flag + dimensions = () + type = logical + intent = in [ltp] standard_name = extra_top_layer long_name = extra top layer for radiation diff --git a/physics/Radiation/radiation_clouds.f b/physics/Radiation/radiation_clouds.f index 111be4019..979405cdb 100644 --- a/physics/Radiation/radiation_clouds.f +++ b/physics/Radiation/radiation_clouds.f @@ -348,7 +348,7 @@ subroutine radiation_clouds_prop & & iovr_dcorr, iovr_exp, iovr_exprand, idcor, idcor_con, & & idcor_hogan, idcor_oreopoulos, lcrick, lcnorm, & & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_c3, & - & do_mynnedmf, lgfdlmprad, & + & do_mynnedmf, lgfdlmprad, xr_cnvcld, & & uni_cld, lmfshal, lmfdeep2, cldcov, clouds1, & & effrl, effri, effrr, effrs, effr_in, & & effrl_inout, effri_inout, effrs_inout, & @@ -538,7 +538,8 @@ subroutine radiation_clouds_prop & logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, effr_in, & - & do_mynnedmf, lgfdlmprad, top_at_1, lcrick, lcnorm + & do_mynnedmf, lgfdlmprad, top_at_1, lcrick, lcnorm, & + & xr_cnvcld real (kind=kind_phys), dimension(:,:,:), intent(in) :: ccnd, & & tracer1 @@ -727,7 +728,7 @@ subroutine radiation_clouds_prop & call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs & rhly,tracer1,xlat,xlon,slmsk,dz,delp, & & ntrac-1, ntcw-1,ntiw-1,ntrw-1, & - & ntsw-1,ntgl-1,con_ttp, & + & ntsw-1,ntgl-1,con_ttp,xr_cnvcld, & & IX, NLAY, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:NLAY), cnvw, effrl_inout, & & effri_inout, effrs_inout, & @@ -801,7 +802,7 @@ subroutine radiation_clouds_prop & call progcld_thompson_wsm6 (plyr,plvl,tlyr,qlyr,qstl, & ! --- inputs & rhly,tracer1,xlat,xlon,slmsk,dz,delp, & & ntrac-1, ntcw-1,ntiw-1,ntrw-1, & - & ntsw-1,ntgl-1,con_ttp, & + & ntsw-1,ntgl-1,con_ttp,xr_cnvcld, & & IX, NLAY, NLP1, uni_cld, lmfshal, lmfdeep2, & & cldcov(:,1:NLAY), cnvw, effrl, effri, effrs, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & @@ -1964,7 +1965,7 @@ subroutine progcld_thompson_wsm6 & & ( plyr,plvl,tlyr,qlyr,qstl,rhly,clw, & ! --- inputs: & xlat,xlon,slmsk,dz,delp, & & ntrac,ntcw,ntiw,ntrw,ntsw,ntgl,con_ttp, & - & IX, NLAY, NLP1, & + & xr_cnvcld, IX, NLAY, NLP1, & & uni_cld, lmfshal, lmfdeep2, cldcov, cnvw, & & re_cloud,re_ice,re_snow, & & lwp_ex, iwp_ex, lwp_fc, iwp_fc, & @@ -2051,7 +2052,8 @@ subroutine progcld_thompson_wsm6 & integer, intent(in) :: IX, NLAY, NLP1 integer, intent(in) :: ntrac, ntcw, ntiw, ntrw, ntsw, ntgl - logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm + logical, intent(in) :: uni_cld, lmfshal, lmfdeep2, lcnorm, & + & xr_cnvcld real (kind=kind_phys), dimension(:,:), intent(in) :: plvl, plyr, & & tlyr, qlyr, qstl, rhly, cldcov, delp, dz, dzlay, & @@ -2122,23 +2124,43 @@ subroutine progcld_thompson_wsm6 & ! enddo ! endif +!> - Include grid-mean suspended cloud condensate in Xu-Randall cloud fraction +!> if xr_cnvcld is true: + + if(xr_cnvcld)then do k = 1, NLAY do i = 1, IX clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw) + clw(i,k,ntsw) & + clw(i,k,ntrw) + cnvw(i,k) enddo enddo + else + do k = 1, NLAY + do i = 1, IX + clwf(i,k) = clw(i,k,ntcw) + clw(i,k,ntiw) + clw(i,k,ntsw) + & + clw(i,k,ntrw) + enddo + enddo + endif !> - Compute total-cloud liquid/ice condensate path in \f$ g/m^2 \f$. !> The total condensate includes convective condensate. do k = 1, NLAY-1 do i = 1, IX - tem1 = cnvw(i,k)*(1.-tem2d(i,k)) + if(xr_cnvcld)then + tem1 = cnvw(i,k)*(1.-tem2d(i,k)) + else + tem1 = 0. + endif cwp(i,k) = max(0.0, (clw(i,k,ntcw)+tem1) * & gfac * delp(i,k)) if(tem1 > 1.e-12 .and. clw(i,k,ntcw) < 1.e-12) & rew(i,k)=reliq_def - tem2 = cnvw(i,k)*tem2d(i,k) + if(xr_cnvcld)then + tem2 = cnvw(i,k)*tem2d(i,k) + else + tem2 = 0. + endif cip(i,k) = max(0.0, (clw(i,k,ntiw) + & snow2ice*clw(i,k,ntsw) + tem2) * & gfac * delp(i,k)) From 27683dbca78f08d43056e676118de6cedc11ff31 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 3 Apr 2024 17:12:23 -0600 Subject: [PATCH 180/249] Add missing optional attribute to metadata files ONLY --- physics/CONV/C3/cu_c3_driver.meta | 10 +++ physics/CONV/C3/cu_c3_driver_post.meta | 1 + physics/CONV/C3/cu_c3_driver_pre.meta | 1 + physics/CONV/Chikira_Sugiyama/cs_conv.meta | 11 +++ physics/CONV/Grell_Freitas/cu_gf_driver.meta | 7 ++ .../CONV/Grell_Freitas/cu_gf_driver_post.meta | 2 + .../CONV/Grell_Freitas/cu_gf_driver_pre.meta | 2 + physics/CONV/RAS/rascnv.meta | 13 +++ physics/CONV/SAMF/samfdeepcnv.meta | 18 ++++ physics/CONV/SAMF/samfshalcnv.meta | 6 ++ physics/CONV/SAS/sascnvn.meta | 11 +++ physics/CONV/SAS/shalcnv.meta | 2 + physics/CONV/nTiedtke/cu_ntiedtke.meta | 1 + physics/CONV/nTiedtke/cu_ntiedtke_post.meta | 1 + physics/CONV/nTiedtke/cu_ntiedtke_pre.meta | 1 + physics/GWD/cires_ugwp.meta | 13 +++ physics/GWD/cires_ugwp_post.meta | 6 ++ physics/GWD/drag_suite.meta | 24 +++++ physics/GWD/gwdc_post.meta | 1 + physics/GWD/gwdps.meta | 8 ++ physics/GWD/rayleigh_damp.meta | 1 + physics/GWD/ugwpv1_gsldrag.meta | 29 +++++++ physics/GWD/ugwpv1_gsldrag_post.meta | 43 +++++++++ physics/GWD/unified_ugwp.meta | 31 +++++++ physics/GWD/unified_ugwp_post.meta | 43 +++++++++ .../GFS_DCNV_generic_post.meta | 9 ++ .../UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta | 2 + .../UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta | 2 + .../UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta | 6 ++ .../UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta | 33 +++++++ .../UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta | 26 ++++++ .../UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta | 4 + .../GFS_SCNV_generic_post.meta | 5 ++ .../UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta | 1 + .../GFS_cloud_diagnostics.meta | 3 + .../GFS_phys_time_vary.fv3.meta | 87 +++++++++++++++++++ .../GFS_phys_time_vary.scm.meta | 81 +++++++++++++++++ .../UFS_SCM_NEPTUNE/GFS_physics_post.meta | 2 + .../GFS_rad_time_vary.fv3.meta | 9 ++ .../GFS_rad_time_vary.scm.meta | 9 ++ .../GFS_radiation_surface.meta | 6 ++ .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta | 15 ++++ .../UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta | 21 +++++ .../GFS_rrtmgp_cloud_overlap.meta | 5 ++ .../UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta | 1 + .../UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta | 15 ++++ .../UFS_SCM_NEPTUNE/GFS_stochastics.meta | 10 +++ .../GFS_suite_interstitial_2.meta | 3 + .../GFS_suite_interstitial_3.meta | 9 ++ .../GFS_suite_interstitial_4.meta | 4 + .../GFS_suite_stateout_update.meta | 4 + .../GFS_surface_composites_post.meta | 3 + .../GFS_surface_generic_post.meta | 34 ++++++++ .../GFS_surface_generic_pre.meta | 6 ++ .../Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta | 1 + .../UFS_SCM_NEPTUNE/dcyc2t3.meta | 4 + .../maximum_hourly_diagnostics.meta | 6 ++ .../UFS_SCM_NEPTUNE/sgscloud_radpre.meta | 6 ++ physics/MP/Ferrier_Aligo/mp_fer_hires.meta | 1 + physics/MP/GFDL/fv_sat_adj.meta | 1 + physics/MP/GFDL/gfdl_cloud_microphys.meta | 12 +++ physics/MP/Morrison_Gettelman/m_micro.meta | 19 ++++ .../MP/Morrison_Gettelman/m_micro_post.meta | 3 + .../MP/Morrison_Gettelman/m_micro_pre.meta | 1 + physics/MP/NSSL/mp_nssl.meta | 22 +++++ physics/MP/Thompson/mp_thompson.meta | 18 ++++ physics/MP/Zhao_Carr/zhaocarr_gscond.meta | 7 ++ physics/MP/Zhao_Carr/zhaocarr_precpd.meta | 1 + physics/PBL/HEDMF/hedmf.meta | 4 + physics/PBL/MYJ/myjpbl_wrapper.meta | 3 + physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta | 64 ++++++++++++++ physics/PBL/SATMEDMF/satmedmfvdif.meta | 4 + physics/PBL/SATMEDMF/satmedmfvdifq.meta | 4 + physics/PBL/SHOC/moninshoc.meta | 4 + physics/PBL/SHOC/shoc.meta | 1 + physics/PBL/YSU/ysuvdif.meta | 3 + physics/PBL/saYSU/shinhongvdif.meta | 3 + physics/Radiation/RRTMG/radlw_main.meta | 3 + physics/Radiation/RRTMG/radsw_main.meta | 2 + .../RRTMGP/rrtmgp_aerosol_optics.meta | 2 + physics/Radiation/RRTMGP/rrtmgp_lw_main.meta | 14 +++ physics/Radiation/RRTMGP/rrtmgp_sw_main.meta | 13 +++ physics/SFC_Layer/MYJ/myjsfc_wrapper.meta | 1 + physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta | 17 ++++ physics/SFC_Layer/UFS/sfc_diag.meta | 2 + physics/SFC_Layer/UFS/sfc_diag_post.meta | 2 + physics/SFC_Layer/UFS/sfc_nst.meta | 19 ++++ physics/SFC_Layer/UFS/sfc_nst_post.meta | 5 ++ physics/SFC_Layer/UFS/sfc_nst_pre.meta | 5 ++ physics/SFC_Models/Lake/CLM/clm_lake.meta | 7 ++ .../SFC_Models/Lake/Flake/flake_driver.meta | 16 ++++ physics/SFC_Models/Land/Noah/lsm_noah.meta | 4 + physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 47 ++++++++++ physics/SFC_Models/Land/RUC/lsm_ruc.meta | 29 +++++++ physics/SFC_Models/Land/sfc_land.meta | 16 ++++ physics/SFC_Models/Ocean/UFS/sfc_ocean.meta | 3 + physics/SFC_Models/SeaIce/CICE/sfc_cice.meta | 5 ++ physics/SFC_Models/SeaIce/CICE/sfc_sice.meta | 2 + physics/smoke_dust/rrfs_smoke_postpbl.meta | 1 + physics/smoke_dust/rrfs_smoke_wrapper.meta | 11 +++ physics/tools/get_phi_fv3.meta | 1 + physics/tools/get_prs_fv3.meta | 1 + 102 files changed, 1121 insertions(+) diff --git a/physics/CONV/C3/cu_c3_driver.meta b/physics/CONV/C3/cu_c3_driver.meta index 5677cdd32..338954ae3 100644 --- a/physics/CONV/C3/cu_c3_driver.meta +++ b/physics/CONV/C3/cu_c3_driver.meta @@ -243,6 +243,7 @@ type = real kind = kind_phys intent = in + optional = True [sigmain] standard_name = prognostic_updraft_area_fraction_in_convection long_name = convective updraft area fraction @@ -251,6 +252,7 @@ type = real kind = kind_phys intent = in + optional = True [sigmaout] standard_name = updraft_area_fraction_updated_by_physics long_name = convective updraft area fraction updated by physics @@ -259,6 +261,7 @@ type = real kind = kind_phys intent = out + optional = True [betascu] standard_name = tuning_param_for_shallow_cu long_name = tuning param for shallow cu in case prognostic closure is used @@ -462,6 +465,7 @@ type = real kind = kind_phys intent = in + optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt @@ -470,6 +474,7 @@ type = real kind = kind_phys intent = out + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * delt @@ -531,6 +536,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -538,6 +544,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [ntqv] standard_name = index_of_specific_humidity_in_tracer_concentration_array long_name = tracer index for water vapor (specific humidity) @@ -616,6 +623,7 @@ type = real kind = kind_phys intent = inout + optional = True [fhour] standard_name = forecast_time long_name = current forecast time @@ -669,6 +677,7 @@ type = real kind = kind_phys intent = in + optional = True [rainevap] standard_name = physics_field_for_coupling long_name = physics_field_for_coupling @@ -693,6 +702,7 @@ type = real kind = kind_phys intent = in + optional = True [do_mynnedmf] standard_name = flag_for_mellor_yamada_nakanishi_niino_pbl_scheme long_name = flag to activate MYNN-EDMF diff --git a/physics/CONV/C3/cu_c3_driver_post.meta b/physics/CONV/C3/cu_c3_driver_post.meta index 78dca2ed4..b1c5e8b49 100644 --- a/physics/CONV/C3/cu_c3_driver_post.meta +++ b/physics/CONV/C3/cu_c3_driver_post.meta @@ -53,6 +53,7 @@ type = real kind = kind_phys intent = out + optional = True [cactiv] standard_name = counter_for_grell_freitas_convection long_name = convective activity memory diff --git a/physics/CONV/C3/cu_c3_driver_pre.meta b/physics/CONV/C3/cu_c3_driver_pre.meta index a022cf743..c1d46d6db 100644 --- a/physics/CONV/C3/cu_c3_driver_pre.meta +++ b/physics/CONV/C3/cu_c3_driver_pre.meta @@ -76,6 +76,7 @@ type = real kind = kind_phys intent = in + optional = True [forcet] standard_name = tendency_of_air_temperature_due_to_nonphysics long_name = temperature tendency due to dynamics only diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.meta b/physics/CONV/Chikira_Sugiyama/cs_conv.meta index d75ab1006..08d348562 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.meta @@ -159,6 +159,7 @@ type = real kind = kind_phys intent = inout + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * delt @@ -312,6 +313,7 @@ type = real kind = kind_phys intent = out + optional = True [qicn] standard_name = mass_fraction_of_convective_cloud_ice long_name = mass fraction of convective cloud ice water @@ -320,6 +322,7 @@ type = real kind = kind_phys intent = out + optional = True [w_upi] standard_name = vertical_velocity_for_updraft long_name = vertical velocity for updraft @@ -328,6 +331,7 @@ type = real kind = kind_phys intent = out + optional = True [cf_upi] standard_name = convective_cloud_fraction_for_microphysics long_name = convective cloud fraction for microphysics @@ -336,6 +340,7 @@ type = real kind = kind_phys intent = out + optional = True [cnv_mfd] standard_name = detrained_mass_flux long_name = detrained mass flux @@ -344,6 +349,7 @@ type = real kind = kind_phys intent = out + optional = True [cnv_dqldt] standard_name = tendency_of_cloud_water_due_to_convective_microphysics long_name = tendency of cloud water due to convective microphysics @@ -352,6 +358,7 @@ type = real kind = kind_phys intent = out + optional = True [clcn] standard_name = convective_cloud_volume_fraction long_name = convective cloud volume fraction @@ -360,6 +367,7 @@ type = real kind = kind_phys intent = out + optional = True [cnv_fice] standard_name = ice_fraction_in_convective_tower long_name = ice fraction in convective tower @@ -368,6 +376,7 @@ type = real kind = kind_phys intent = out + optional = True [cnv_ndrop] standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment long_name = droplet number concentration in convective detrainment @@ -376,6 +385,7 @@ type = real kind = kind_phys intent = out + optional = True [cnv_nice] standard_name = number_concentration_of_ice_crystals_for_detrainment long_name = crystal number concentration in convective detrainment @@ -384,6 +394,7 @@ type = real kind = kind_phys intent = out + optional = True [mp_phys] standard_name = control_for_microphysics_scheme long_name = flag for microphysics scheme diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.meta b/physics/CONV/Grell_Freitas/cu_gf_driver.meta index d0b661fd8..4c737c1c6 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.meta @@ -355,6 +355,7 @@ type = real kind = kind_phys intent = in + optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt @@ -363,6 +364,7 @@ type = real kind = kind_phys intent = out + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * delt @@ -424,6 +426,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -431,6 +434,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [ntqv] standard_name = index_of_specific_humidity_in_tracer_concentration_array long_name = tracer index for water vapor (specific humidity) @@ -509,6 +513,7 @@ type = real kind = kind_phys intent = inout + optional = True [fhour] standard_name = forecast_time long_name = current forecast time @@ -570,6 +575,7 @@ type = real kind = kind_phys intent = in + optional = True [do_mynnedmf] standard_name = flag_for_mellor_yamada_nakanishi_niino_pbl_scheme long_name = flag to activate MYNN-EDMF @@ -628,6 +634,7 @@ type = real kind = kind_phys intent = inout + optional = True [fscav] standard_name = smoke_dust_conv_wet_coef long_name = smoke dust convetive wet scavanging coefficents diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta b/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta index 478d48987..e3034403c 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta @@ -53,6 +53,7 @@ type = real kind = kind_phys intent = out + optional = True [cactiv] standard_name = counter_for_grell_freitas_convection long_name = convective activity memory @@ -127,6 +128,7 @@ type = real kind = kind_phys intent = inout + optional = True [gq0] standard_name = tracer_concentration_of_new_state long_name = tracer concentration updated by physics diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta index ff22f1583..23d753feb 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta @@ -76,6 +76,7 @@ type = real kind = kind_phys intent = in + optional = True [forcet] standard_name = tendency_of_air_temperature_due_to_nonphysics long_name = temperature tendency due to dynamics only @@ -158,6 +159,7 @@ type = real kind = kind_phys intent = inout + optional = True [gq0] standard_name = tracer_concentration_of_new_state long_name = tracer concentration updated by physics diff --git a/physics/CONV/RAS/rascnv.meta b/physics/CONV/RAS/rascnv.meta index f5a707ded..bc4a61280 100644 --- a/physics/CONV/RAS/rascnv.meta +++ b/physics/CONV/RAS/rascnv.meta @@ -334,6 +334,7 @@ type = real kind = kind_phys intent = in + optional = True [tin] standard_name = air_temperature_of_new_state long_name = updated temperature @@ -482,6 +483,7 @@ type = real kind = kind_phys intent = out + optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * dt @@ -490,6 +492,7 @@ type = real kind = kind_phys intent = out + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * dt @@ -514,6 +517,7 @@ type = real kind = kind_phys intent = inout + optional = True [qicn] standard_name = mass_fraction_of_convective_cloud_ice long_name = mass fraction of convective cloud ice water @@ -522,6 +526,7 @@ type = real kind = kind_phys intent = inout + optional = True [w_upi] standard_name = vertical_velocity_for_updraft long_name = vertical velocity for updraft @@ -530,6 +535,7 @@ type = real kind = kind_phys intent = inout + optional = True [cf_upi] standard_name = convective_cloud_fraction_for_microphysics long_name = convective cloud fraction for microphysics @@ -538,6 +544,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_mfd] standard_name = detrained_mass_flux long_name = detrained mass flux @@ -546,6 +553,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_dqldt] standard_name = tendency_of_cloud_water_due_to_convective_microphysics long_name = tendency of cloud water due to convective microphysics @@ -554,6 +562,7 @@ type = real kind = kind_phys intent = inout + optional = True [clcn] standard_name = convective_cloud_volume_fraction long_name = convective cloud volume fraction @@ -562,6 +571,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_fice] standard_name = ice_fraction_in_convective_tower long_name = ice fraction in convective tower @@ -570,6 +580,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_ndrop] standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment long_name = droplet number concentration in convective detrainment @@ -578,6 +589,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_nice] standard_name = number_concentration_of_ice_crystals_for_detrainment long_name = crystal number concentration in convective detrainment @@ -586,6 +598,7 @@ type = real kind = kind_phys intent = inout + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/CONV/SAMF/samfdeepcnv.meta b/physics/CONV/SAMF/samfdeepcnv.meta index 2dbd4407c..6d307a9fd 100644 --- a/physics/CONV/SAMF/samfdeepcnv.meta +++ b/physics/CONV/SAMF/samfdeepcnv.meta @@ -85,6 +85,7 @@ type = real kind = kind_phys intent = in + optional = True [itc] standard_name = index_of_first_chemical_tracer_for_convection long_name = index of first chemical tracer transported/scavenged by convection @@ -257,6 +258,7 @@ type = real kind = kind_phys intent = in + optional = True [q] standard_name = specific_humidity long_name = water vapor specific humidity @@ -394,6 +396,7 @@ type = real kind = kind_phys intent = in + optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt @@ -402,6 +405,7 @@ type = real kind = kind_phys intent = out + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * delt @@ -442,6 +446,7 @@ type = real kind = kind_phys intent = in + optional = True [sigmaout] standard_name = updraft_area_fraction_updated_by_physics long_name = convective updraft area fraction updated by physics @@ -450,6 +455,7 @@ type = real kind = kind_phys intent = out + optional = True [betascu] standard_name = tuning_param_for_shallow_cu long_name = tuning param for shallow cu in case prognostic closure is used @@ -481,6 +487,7 @@ type = real kind = kind_phys intent = in + optional = True [do_mynnedmf] standard_name = flag_for_mellor_yamada_nakanishi_niino_pbl_scheme long_name = flag to activate MYNN-EDMF @@ -496,6 +503,7 @@ type = real kind = kind_phys intent = inout + optional = True [qicn] standard_name = mass_fraction_of_convective_cloud_ice long_name = mass fraction of convective cloud ice water @@ -504,6 +512,7 @@ type = real kind = kind_phys intent = inout + optional = True [w_upi] standard_name = vertical_velocity_for_updraft long_name = vertical velocity for updraft @@ -512,6 +521,7 @@ type = real kind = kind_phys intent = inout + optional = True [cf_upi] standard_name = convective_cloud_fraction_for_microphysics long_name = convective cloud fraction for microphysics @@ -520,6 +530,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_mfd] standard_name = detrained_mass_flux long_name = detrained mass flux @@ -528,6 +539,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_dqldt] standard_name = tendency_of_cloud_water_due_to_convective_microphysics long_name = tendency of cloud water due to convective microphysics @@ -536,6 +548,7 @@ type = real kind = kind_phys intent = inout + optional = True [clcn] standard_name = convective_cloud_volume_fraction long_name = convective cloud volume fraction @@ -544,6 +557,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_fice] standard_name = ice_fraction_in_convective_tower long_name = ice fraction in convective tower @@ -552,6 +566,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_ndrop] standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment long_name = droplet number concentration in convective detrainment @@ -560,6 +575,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_nice] standard_name = number_concentration_of_ice_crystals_for_detrainment long_name = crystal number concentration in convective detrainment @@ -568,6 +584,7 @@ type = real kind = kind_phys intent = inout + optional = True [mp_phys] standard_name = control_for_microphysics_scheme long_name = choice of microphysics scheme @@ -690,6 +707,7 @@ type = real kind = kind_phys intent = in + optional = True [rainevap] standard_name = physics_field_for_coupling long_name = physics_field_for_coupling diff --git a/physics/CONV/SAMF/samfshalcnv.meta b/physics/CONV/SAMF/samfshalcnv.meta index 4b913a05d..b809530bc 100644 --- a/physics/CONV/SAMF/samfshalcnv.meta +++ b/physics/CONV/SAMF/samfshalcnv.meta @@ -85,6 +85,7 @@ type = real kind = kind_phys intent = in + optional = True [itc] standard_name = index_of_first_chemical_tracer_for_convection long_name = index of first chemical tracer transported/scavenged by convection @@ -257,6 +258,7 @@ type = real kind = kind_phys intent = in + optional = True [q] standard_name = specific_humidity long_name = water vapor specific humidity @@ -372,6 +374,7 @@ type = real kind = kind_phys intent = in + optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt @@ -380,6 +383,7 @@ type = real kind = kind_phys intent = out + optional = True [dt_mf] standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux long_name = (detrainment mass flux) * delt @@ -474,6 +478,7 @@ type = real kind = kind_phys intent = in + optional = True [sigmaout] standard_name = updraft_area_fraction_updated_by_physics long_name = convective updraft area fraction updated by physics @@ -482,6 +487,7 @@ type = real kind = kind_phys intent = out + optional = True [betascu] standard_name = tuning_param_for_shallow_cu long_name = tuning param for shallow cu in case prognostic closure is used diff --git a/physics/CONV/SAS/sascnvn.meta b/physics/CONV/SAS/sascnvn.meta index fefa2823a..10b0f9aff 100644 --- a/physics/CONV/SAS/sascnvn.meta +++ b/physics/CONV/SAS/sascnvn.meta @@ -305,6 +305,7 @@ type = real kind = kind_phys intent = out + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * delt @@ -345,6 +346,7 @@ type = real kind = kind_phys intent = inout + optional = True [qicn] standard_name = mass_fraction_of_convective_cloud_ice long_name = mass fraction of convective cloud ice water @@ -353,6 +355,7 @@ type = real kind = kind_phys intent = inout + optional = True [w_upi] standard_name = vertical_velocity_for_updraft long_name = vertical velocity for updraft @@ -361,6 +364,7 @@ type = real kind = kind_phys intent = inout + optional = True [cf_upi] standard_name = convective_cloud_fraction_for_microphysics long_name = convective cloud fraction for microphysics @@ -369,6 +373,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_mfd] standard_name = detrained_mass_flux long_name = detrained mass flux @@ -377,6 +382,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_dqldt] standard_name = tendency_of_cloud_water_due_to_convective_microphysics long_name = tendency of cloud water due to convective microphysics @@ -385,6 +391,7 @@ type = real kind = kind_phys intent = inout + optional = True [clcn] standard_name = convective_cloud_volume_fraction long_name = convective cloud volume fraction @@ -393,6 +400,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_fice] standard_name = ice_fraction_in_convective_tower long_name = ice fraction in convective tower @@ -401,6 +409,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_ndrop] standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment long_name = droplet number concentration in convective detrainment @@ -409,6 +418,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnv_nice] standard_name = number_concentration_of_ice_crystals_for_detrainment long_name = crystal number concentration in convective detrainment @@ -417,6 +427,7 @@ type = real kind = kind_phys intent = inout + optional = True [mp_phys] standard_name = control_for_microphysics_scheme long_name = choice of microphysics scheme diff --git a/physics/CONV/SAS/shalcnv.meta b/physics/CONV/SAS/shalcnv.meta index 15324ed08..35ec3765a 100644 --- a/physics/CONV/SAS/shalcnv.meta +++ b/physics/CONV/SAS/shalcnv.meta @@ -311,6 +311,7 @@ type = real kind = kind_phys intent = in + optional = True [heat] standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness_and_vegetation long_name = kinematic surface upward sensible heat flux reduced by surface roughness and vegetation @@ -335,6 +336,7 @@ type = real kind = kind_phys intent = out + optional = True [dt_mf] standard_name = instantaneous_atmosphere_detrainment_convective_mass_flux long_name = (detrainment mass flux) * delt diff --git a/physics/CONV/nTiedtke/cu_ntiedtke.meta b/physics/CONV/nTiedtke/cu_ntiedtke.meta index b425a80ad..42ffaf669 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke.meta @@ -278,6 +278,7 @@ type = real kind = kind_phys intent = out + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * delt diff --git a/physics/CONV/nTiedtke/cu_ntiedtke_post.meta b/physics/CONV/nTiedtke/cu_ntiedtke_post.meta index 9960b6b77..282b4c9de 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke_post.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke_post.meta @@ -39,6 +39,7 @@ type = real kind = kind_phys intent = out + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta b/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta index 26392f0e6..8d1baae8d 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta @@ -76,6 +76,7 @@ type = real kind = kind_phys intent = in + optional = True [forcet] standard_name = tendency_of_air_temperature_due_to_nonphysics long_name = temperature tendency due to dynamics only diff --git a/physics/GWD/cires_ugwp.meta b/physics/GWD/cires_ugwp.meta index 28faaeadf..bf43e450b 100644 --- a/physics/GWD/cires_ugwp.meta +++ b/physics/GWD/cires_ugwp.meta @@ -38,6 +38,7 @@ type = character kind = len=* intent = in + optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile @@ -604,6 +605,7 @@ type = real kind = kind_phys intent = out + optional = True [dvsfc_ms] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from mesoscale gwd @@ -612,6 +614,7 @@ type = real kind = kind_phys intent = out + optional = True [dusfc_bl] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -620,6 +623,7 @@ type = real kind = kind_phys intent = out + optional = True [dvsfc_bl] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -628,6 +632,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_ogw] standard_name = tendency_of_x_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = instantaneous change in x wind due to orographic gw drag @@ -636,6 +641,7 @@ type = real kind = kind_phys intent = out + optional = True [dtauy2d_ms] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = instantaneous change in y wind due to orographic gw drag @@ -644,6 +650,7 @@ type = real kind = kind_phys intent = out + optional = True [dtaux2d_bl] standard_name = tendency_of_x_wind_due_to_blocking_drag long_name = x wind tendency from blocking drag @@ -652,6 +659,7 @@ type = real kind = kind_phys intent = out + optional = True [dtauy2d_bl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -660,6 +668,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_mtb] standard_name = instantaneous_change_in_x_wind_due_to_mountain_blocking_drag long_name = instantaneous change in x wind due to mountain blocking drag @@ -684,6 +693,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ogw] standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag long_name = time integral of change in x wind due to orographic gw drag @@ -692,6 +702,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_tms] standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag long_name = time integral of change in x wind due to TOFD @@ -700,6 +711,7 @@ type = real kind = kind_phys intent = inout + optional = True [dudt] standard_name = process_split_cumulative_tendency_of_x_wind long_name = zonal wind tendency due to model physics @@ -848,6 +860,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_x_wind] standard_name = index_of_x_wind_in_cumulative_change_index long_name = index of x-wind in first dimension of array cumulative change index diff --git a/physics/GWD/cires_ugwp_post.meta b/physics/GWD/cires_ugwp_post.meta index dabc40082..209209e25 100644 --- a/physics/GWD/cires_ugwp_post.meta +++ b/physics/GWD/cires_ugwp_post.meta @@ -132,6 +132,7 @@ type = real kind = kind_phys intent = in + optional = True [dudt_tms] standard_name = tendency_of_x_wind_due_to_turbulent_orographic_form_drag long_name = instantaneous change in x wind due to TOFD @@ -204,6 +205,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ogw] standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag long_name = time integral of change in x wind due to orographic gw drag @@ -212,6 +214,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_tms] standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag long_name = time integral of change in x wind due to TOFD @@ -220,6 +223,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ngw] standard_name = time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave long_name = time integral of change in x wind due to NGW @@ -228,6 +232,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3dt_ngw] standard_name = time_integral_of_change_in_y_wind_due_to_nonstationary_gravity_wave long_name = time integral of change in y wind due to NGW @@ -236,6 +241,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtdt] standard_name = process_split_cumulative_tendency_of_air_temperature long_name = air temperature tendency due to model physics diff --git a/physics/GWD/drag_suite.meta b/physics/GWD/drag_suite.meta index be0449bd5..7b65666d5 100644 --- a/physics/GWD/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -214,6 +214,7 @@ type = real kind = kind_phys intent = in + optional = True [oc1ss] standard_name = convexity_of_subgrid_orography_small_scale long_name = convexity of subgrid height_above_mean_sea_level small scale @@ -222,6 +223,7 @@ type = real kind = kind_phys intent = in + optional = True [oa4ss] standard_name = asymmetry_of_subgrid_orography_small_scale long_name = asymmetry of subgrid height_above_mean_sea_level small scale @@ -230,6 +232,7 @@ type = real kind = kind_phys intent = in + optional = True [ol4ss] standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height_small_scale long_name = horizontal fraction of grid box covered by subgrid height_above_mean_sea_level higher than critical height small scale @@ -238,6 +241,7 @@ type = real kind = kind_phys intent = in + optional = True [theta] standard_name = angle_from_east_of_maximum_subgrid_orographic_variations long_name = angle with respect to east of maximum subgrid orographic variations @@ -278,6 +282,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtauy2d_ms] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = y wind tendency from mesoscale gwd @@ -286,6 +291,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtaux2d_bl] standard_name = tendency_of_x_wind_due_to_blocking_drag long_name = x wind tendency from blocking drag @@ -294,6 +300,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtauy2d_bl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -302,6 +309,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtaux2d_ss] standard_name = tendency_of_x_wind_due_to_small_scale_gravity_wave_drag long_name = x wind tendency from small scale gwd @@ -310,6 +318,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtauy2d_ss] standard_name = tendency_of_y_wind_due_to_small_scale_gravity_wave_drag long_name = y wind tendency from small scale gwd @@ -318,6 +327,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtaux2d_fd] standard_name = tendency_of_x_wind_due_to_form_drag long_name = x wind tendency from form drag @@ -326,6 +336,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtauy2d_fd] standard_name = tendency_of_y_wind_due_to_form_drag long_name = y wind tendency from form drag @@ -334,6 +345,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc] standard_name = instantaneous_x_stress_due_to_gravity_wave_drag long_name = zonal surface stress due to orographic gravity wave drag @@ -358,6 +370,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_ms] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from mesoscale gwd @@ -366,6 +379,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_bl] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -374,6 +388,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_bl] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -382,6 +397,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_ss] standard_name = vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated x momentum flux from small scale gwd @@ -390,6 +406,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_ss] standard_name = vertically_integrated_y_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated y momentum flux from small scale gwd @@ -398,6 +415,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_fd] standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag long_name = integrated x momentum flux from form drag @@ -406,6 +424,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_fd] standard_name = vertically_integrated_y_momentum_flux_due_to_form_drag long_name = integrated y momentum flux from form drag @@ -414,6 +433,7 @@ type = real kind = kind_phys intent = inout + optional = True [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 @@ -438,6 +458,7 @@ type = real kind = kind_phys intent = in + optional = True [g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -581,6 +602,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -588,6 +610,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_orographic_gwd] standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index @@ -645,6 +668,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_gwd] standard_name = control_for_gravity_wave_drag_spp_perturbations long_name = control for gravity wave drag spp perturbations diff --git a/physics/GWD/gwdc_post.meta b/physics/GWD/gwdc_post.meta index ba179181d..fefc1bd0f 100644 --- a/physics/GWD/gwdc_post.meta +++ b/physics/GWD/gwdc_post.meta @@ -123,6 +123,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_x_wind] standard_name = index_of_x_wind_in_cumulative_change_index long_name = index of x-wind in first dimension of array cumulative change index diff --git a/physics/GWD/gwdps.meta b/physics/GWD/gwdps.meta index bbe7569d0..a7878db97 100644 --- a/physics/GWD/gwdps.meta +++ b/physics/GWD/gwdps.meta @@ -235,6 +235,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtauy2d_ms] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = instantaneous change in y wind due to orographic gw drag @@ -243,6 +244,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtaux2d_bl] standard_name = tendency_of_x_wind_due_to_blocking_drag long_name = x wind tendency from blocking drag @@ -251,6 +253,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtauy2d_bl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -259,6 +262,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_ms] standard_name = vertically_integrated_x_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated x momentum flux from mesoscale gwd @@ -267,6 +271,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_ms] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from mesoscale gwd @@ -275,6 +280,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_bl] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -283,6 +289,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_bl] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -291,6 +298,7 @@ type = real kind = kind_phys intent = inout + optional = True [g] standard_name = gravitational_acceleration long_name = gravitational acceleration diff --git a/physics/GWD/rayleigh_damp.meta b/physics/GWD/rayleigh_damp.meta index 5c5271b7d..3db1bc7be 100644 --- a/physics/GWD/rayleigh_damp.meta +++ b/physics/GWD/rayleigh_damp.meta @@ -145,6 +145,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_rayleigh_damping] standard_name = index_of_rayleigh_damping_process_in_cumulative_change_index long_name = index of rayleigh damping process in second dimension of array cumulative change index diff --git a/physics/GWD/ugwpv1_gsldrag.meta b/physics/GWD/ugwpv1_gsldrag.meta index 73d7eee1c..ba9159b2e 100644 --- a/physics/GWD/ugwpv1_gsldrag.meta +++ b/physics/GWD/ugwpv1_gsldrag.meta @@ -37,6 +37,7 @@ type = character kind = len=* intent = in + optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile @@ -545,6 +546,7 @@ type = real kind = kind_phys intent = in + optional = True [oc1ss] standard_name = convexity_of_subgrid_orography_small_scale long_name = convexity of subgrid height_above_mean_sea_level small scale @@ -553,6 +555,7 @@ type = real kind = kind_phys intent = in + optional = True [oa4ss] standard_name = asymmetry_of_subgrid_orography_small_scale long_name = asymmetry of subgrid height_above_mean_sea_level small scale @@ -561,6 +564,7 @@ type = real kind = kind_phys intent = in + optional = True [ol4ss] standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height_small_scale long_name = horizontal fraction of grid box covered by sso higher than critical height small scale @@ -569,6 +573,7 @@ type = real kind = kind_phys intent = in + optional = True [dx] standard_name = characteristic_grid_lengthscale long_name = size of the grid cell @@ -641,6 +646,7 @@ type = real kind = kind_phys intent = in + optional = True [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = vertical index at top atmospheric boundary layer @@ -752,6 +758,7 @@ type = real kind = kind_phys intent = out + optional = True [dvdt_ogw] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = y wind tendency from meso scale ogw @@ -760,6 +767,7 @@ type = real kind = kind_phys intent = out + optional = True [du_ogwcol] standard_name = vertically_integrated_x_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated x momentum flux from meso scale ogw @@ -768,6 +776,7 @@ type = real kind = kind_phys intent = out + optional = True [dv_ogwcol] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from meso scale ogw @@ -776,6 +785,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_obl] standard_name = tendency_of_x_wind_due_to_blocking_drag long_name = x wind tendency from blocking drag @@ -784,6 +794,7 @@ type = real kind = kind_phys intent = out + optional = True [dvdt_obl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -792,6 +803,7 @@ type = real kind = kind_phys intent = out + optional = True [du_oblcol] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -800,6 +812,7 @@ type = real kind = kind_phys intent = out + optional = True [dv_oblcol] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -808,6 +821,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_oss] standard_name = tendency_of_x_wind_due_to_small_scale_gravity_wave_drag long_name = x wind tendency from small scale gwd @@ -816,6 +830,7 @@ type = real kind = kind_phys intent = out + optional = True [dvdt_oss] standard_name = tendency_of_y_wind_due_to_small_scale_gravity_wave_drag long_name = y wind tendency from small scale gwd @@ -824,6 +839,7 @@ type = real kind = kind_phys intent = out + optional = True [du_osscol] standard_name = vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated x momentum flux from small scale gwd @@ -832,6 +848,7 @@ type = real kind = kind_phys intent = out + optional = True [dv_osscol] standard_name = vertically_integrated_y_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated y momentum flux from small scale gwd @@ -840,6 +857,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_ofd] standard_name = tendency_of_x_wind_due_to_form_drag long_name = x wind tendency from form drag @@ -848,6 +866,7 @@ type = real kind = kind_phys intent = out + optional = True [dvdt_ofd] standard_name = tendency_of_y_wind_due_to_form_drag long_name = y wind tendency from form drag @@ -856,6 +875,7 @@ type = real kind = kind_phys intent = out + optional = True [du_ofdcol] standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag long_name = integrated x momentum flux from form drag @@ -864,6 +884,7 @@ type = real kind = kind_phys intent = out + optional = True [dv_ofdcol] standard_name = vertically_integrated_y_momentum_flux_due_to_form_drag long_name = integrated y momentum flux from form drag @@ -872,6 +893,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_ngw] standard_name = tendency_of_x_wind_due_to_nonorographic_gravity_wave_drag long_name = zonal wind tendency due to non-stationary GWs @@ -880,6 +902,7 @@ type = real kind = kind_phys intent = out + optional = True [dvdt_ngw] standard_name = tendency_of_y_wind_due_to_nonorographic_gravity_wave_drag long_name = meridional wind tendency due to non-stationary GWs @@ -888,6 +911,7 @@ type = real kind = kind_phys intent = out + optional = True [dtdt_ngw] standard_name = tendency_of_air_temperature_due_to_nonorographic_gravity_wave_drag long_name = air temperature tendency due to non-stationary GWs @@ -896,6 +920,7 @@ type = real kind = kind_phys intent = out + optional = True [kdis_ngw] standard_name = atmosphere_momentum_diffusivity_due_to_nonorographic_gravity_wave_drag long_name = eddy mixing due to non-stationary GWs @@ -904,6 +929,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_gw] standard_name = tendency_of_x_wind_due_to_gravity_wave_drag long_name = zonal wind tendency due to all GWs @@ -1049,6 +1075,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -1056,6 +1083,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_x_wind] standard_name = index_of_x_wind_in_cumulative_change_index long_name = index of x-wind in first dimension of array cumulative change index @@ -1113,6 +1141,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_gwd] standard_name = control_for_gravity_wave_drag_spp_perturbations long_name = control for gravity wave drag spp perturbations diff --git a/physics/GWD/ugwpv1_gsldrag_post.meta b/physics/GWD/ugwpv1_gsldrag_post.meta index e1c63102d..b97db21c0 100644 --- a/physics/GWD/ugwpv1_gsldrag_post.meta +++ b/physics/GWD/ugwpv1_gsldrag_post.meta @@ -108,6 +108,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_obl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -116,6 +117,7 @@ type = real kind = kind_phys intent = in + optional = True [dudt_ofd] standard_name = tendency_of_x_wind_due_to_form_drag long_name = x wind tendency from form drag @@ -124,6 +126,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_ofd] standard_name = tendency_of_y_wind_due_to_form_drag long_name = y wind tendency from form drag @@ -132,6 +135,7 @@ type = real kind = kind_phys intent = in + optional = True [dudt_ogw] standard_name = tendency_of_x_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = x wind tendency from meso scale ogw @@ -140,6 +144,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_ogw] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = y wind tendency from meso scale ogw @@ -148,6 +153,7 @@ type = real kind = kind_phys intent = in + optional = True [dudt_oss] standard_name = tendency_of_x_wind_due_to_small_scale_gravity_wave_drag long_name = x wind tendency from small scale gwd @@ -156,6 +162,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_oss] standard_name = tendency_of_y_wind_due_to_small_scale_gravity_wave_drag long_name = y wind tendency from small scale gwd @@ -164,6 +171,7 @@ type = real kind = kind_phys intent = in + optional = True [tot_zmtb] standard_name = time_integral_of_height_of_mountain_blocking long_name = time integral of height of mountain blocking drag @@ -228,6 +236,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ogw] standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag long_name = time integral of change in x wind due to orographic gw drag @@ -236,6 +245,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_tms] standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag long_name = time integral of change in x wind due to TOFD @@ -244,6 +254,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ngw] standard_name = time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave long_name = time integral of change in x wind due to NGW @@ -252,6 +263,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3dt_ngw] standard_name = time_integral_of_change_in_y_wind_due_to_nonstationary_gravity_wave long_name = time integral of change in y wind due to NGW @@ -260,6 +272,7 @@ type = real kind = kind_phys intent = inout + optional = True [dudt_ngw] standard_name = tendency_of_x_wind_due_to_nonorographic_gravity_wave_drag long_name = zonal wind tendency due to non-stationary GWs @@ -268,6 +281,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_ngw] standard_name = tendency_of_y_wind_due_to_nonorographic_gravity_wave_drag long_name = meridional wind tendency due to non-stationary GWs @@ -276,6 +290,7 @@ type = real kind = kind_phys intent = in + optional = True [dtdt_ngw] standard_name = tendency_of_air_temperature_due_to_nonorographic_gravity_wave_drag long_name = air temperature tendency due to non-stationary GWs @@ -284,6 +299,7 @@ type = real kind = kind_phys intent = in + optional = True [ldu3dt_ngw] standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag long_name = cumulative change in x wind due to convective gravity wave drag @@ -292,6 +308,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldv3dt_ngw] standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag long_name = cumulative change in y wind due to convective gravity wave drag @@ -300,6 +317,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldt3dt_ngw] standard_name = cumulative_change_in_temperature_due_to_convective_gravity_wave_drag long_name = cumulative change in temperature due to convective gravity wave drag @@ -308,6 +326,7 @@ type = real kind = kind_phys intent = inout + optional = True [dws3dt_ogw] standard_name = cumulative_change_in_wind_speed_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative change in wind speed due to mesoscale orographic gravity wave drag @@ -316,6 +335,7 @@ type = real kind = kind_phys intent = inout + optional = True [dws3dt_obl] standard_name = cumulative_change_in_wind_speed_due_to_blocking_drag long_name = cumulative change in wind speed due to blocking drag @@ -324,6 +344,7 @@ type = real kind = kind_phys intent = inout + optional = True [dws3dt_oss] standard_name = cumulative_change_in_wind_speed_due_to_small_scale_orographic_gravity_wave_drag long_name = cumulative change in wind speed due to small scale orographic gravity wave drag @@ -332,6 +353,7 @@ type = real kind = kind_phys intent = inout + optional = True [dws3dt_ofd] standard_name = cumulative_change_in_wind_speed_due_to_turbulent_orographic_form_drag long_name = cumulative change in wind speed due to turbulent orographic form drag @@ -340,6 +362,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_ogw] standard_name = cumulative_change_in_x_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative change in x wind due to mesoscale orographic gravity wave drag @@ -348,6 +371,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_obl] standard_name = cumulative_change_in_x_wind_due_to_blocking_drag long_name = cumulative change in x wind due to blocking drag @@ -356,6 +380,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_oss] standard_name = cumulative_change_in_x_wind_due_to_small_scale_gravity_wave_drag long_name = cumulative change in x wind due to small scale gravity wave drag @@ -364,6 +389,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_ofd] standard_name = cumulative_change_in_x_wind_due_to_form_drag long_name = cumulative change in x wind due to form drag @@ -372,6 +398,7 @@ type = real kind = kind_phys intent = inout + optional = True [du_ogwcol] standard_name = vertically_integrated_x_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated x momentum flux from meso scale ogw @@ -380,6 +407,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_ogwcol] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from meso scale ogw @@ -388,6 +416,7 @@ type = real kind = kind_phys intent = in + optional = True [du_oblcol] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -396,6 +425,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_oblcol] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -404,6 +434,7 @@ type = real kind = kind_phys intent = in + optional = True [du_osscol] standard_name = vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated x momentum flux from small scale gwd @@ -412,6 +443,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_osscol] standard_name = vertically_integrated_y_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated y momentum flux from small scale gwd @@ -420,6 +452,7 @@ type = real kind = kind_phys intent = in + optional = True [du_ofdcol] standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag long_name = integrated x momentum flux from form drag @@ -428,6 +461,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_ofdcol] standard_name = vertically_integrated_y_momentum_flux_due_to_form_drag long_name = integrated y momentum flux from form drag @@ -436,6 +470,7 @@ type = real kind = kind_phys intent = in + optional = True [du3_ogwcol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative integrated x momentum flux from mesoscale orographic gravity wave drag @@ -444,6 +479,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_ogwcol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative integrated y momentum flux from mesoscale orographic gravity wave drag @@ -452,6 +488,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3_oblcol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = cumulative integrated x momentum flux from blocking drag @@ -460,6 +497,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_oblcol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = cumulative integrated y momentum flux from blocking drag @@ -468,6 +506,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3_osscol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = cumulative integrated x momentum flux from small scale gravity wave drag @@ -476,6 +515,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_osscol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_small_scale_gravity_wave_drag long_name = cumulative integrated y momentum flux from small scale gravity wave drag @@ -484,6 +524,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3_ofdcol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_form_drag long_name = cumulative integrated x momentum flux from form drag @@ -492,6 +533,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_ofdcol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_to_form_drag long_name = cumulative integrated y momentum flux from form drag @@ -500,6 +542,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtdt] standard_name = process_split_cumulative_tendency_of_air_temperature long_name = air temperature tendency due to model physics diff --git a/physics/GWD/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta index 189f7072c..42c2e00a3 100644 --- a/physics/GWD/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -39,6 +39,7 @@ type = character kind = len=* intent = in + optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile @@ -448,6 +449,7 @@ type = real kind = kind_phys intent = in + optional = True [oc1ss] standard_name = convexity_of_subgrid_orography_small_scale long_name = convexity of subgrid height_above_mean_sea_level small scale @@ -456,6 +458,7 @@ type = real kind = kind_phys intent = in + optional = True [oa4ss] standard_name = asymmetry_of_subgrid_orography_small_scale long_name = asymmetry of subgrid height_above_mean_sea_level small scale @@ -464,6 +467,7 @@ type = real kind = kind_phys intent = in + optional = True [ol4ss] standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height_small_scale long_name = horizontal fraction of grid box covered by subgrid height_above_mean_sea_level higher than critical height small scale @@ -472,6 +476,7 @@ type = real kind = kind_phys intent = in + optional = True [dx] standard_name = characteristic_grid_lengthscale long_name = size of the grid cell @@ -488,6 +493,7 @@ type = real kind = kind_phys intent = out + optional = True [dvsfc_ms] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from mesoscale gwd @@ -496,6 +502,7 @@ type = real kind = kind_phys intent = out + optional = True [dusfc_bl] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -504,6 +511,7 @@ type = real kind = kind_phys intent = out + optional = True [dvsfc_bl] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -512,6 +520,7 @@ type = real kind = kind_phys intent = out + optional = True [dusfc_ss] standard_name = vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated x momentum flux from small scale gwd @@ -520,6 +529,7 @@ type = real kind = kind_phys intent = out + optional = True [dvsfc_ss] standard_name = vertically_integrated_y_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated y momentum flux from small scale gwd @@ -528,6 +538,7 @@ type = real kind = kind_phys intent = out + optional = True [dusfc_fd] standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag long_name = integrated x momentum flux from form drag @@ -536,6 +547,7 @@ type = real kind = kind_phys intent = out + optional = True [dvsfc_fd] standard_name = vertically_integrated_y_momentum_flux_due_to_form_drag long_name = integrated y momentum flux from form drag @@ -544,6 +556,7 @@ type = real kind = kind_phys intent = out + optional = True [dtaux2d_ms] standard_name = tendency_of_x_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = instantaneous change in x wind due to orographic gw drag @@ -552,6 +565,7 @@ type = real kind = kind_phys intent = out + optional = True [dtauy2d_ms] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = instantaneous change in y wind due to orographic gw drag @@ -560,6 +574,7 @@ type = real kind = kind_phys intent = out + optional = True [dtaux2d_bl] standard_name = tendency_of_x_wind_due_to_blocking_drag long_name = x wind tendency from blocking drag @@ -568,6 +583,7 @@ type = real kind = kind_phys intent = out + optional = True [dtauy2d_bl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -576,6 +592,7 @@ type = real kind = kind_phys intent = out + optional = True [dtaux2d_ss] standard_name = tendency_of_x_wind_due_to_small_scale_gravity_wave_drag long_name = x wind tendency from small scale gwd @@ -584,6 +601,7 @@ type = real kind = kind_phys intent = out + optional = True [dtauy2d_ss] standard_name = tendency_of_y_wind_due_to_small_scale_gravity_wave_drag long_name = y wind tendency from small scale gwd @@ -592,6 +610,7 @@ type = real kind = kind_phys intent = out + optional = True [dtaux2d_fd] standard_name = tendency_of_x_wind_due_to_form_drag long_name = x wind tendency from form drag @@ -600,6 +619,7 @@ type = real kind = kind_phys intent = out + optional = True [dtauy2d_fd] standard_name = tendency_of_y_wind_due_to_form_drag long_name = y wind tendency from form drag @@ -608,6 +628,7 @@ type = real kind = kind_phys intent = out + optional = True [dudt_ngw] standard_name = tendency_of_x_wind_due_to_nonorographic_gravity_wave_drag long_name = zonal wind tendency due to non-stationary GWs @@ -616,6 +637,7 @@ type = real kind = kind_phys intent = out + optional = True [dvdt_ngw] standard_name = tendency_of_y_wind_due_to_nonorographic_gravity_wave_drag long_name = meridional wind tendency due to non-stationary GWs @@ -624,6 +646,7 @@ type = real kind = kind_phys intent = out + optional = True [dtdt_ngw] standard_name = tendency_of_air_temperature_due_to_nonorographic_gravity_wave_drag long_name = air temperature tendency due to non-stationary GWs @@ -632,6 +655,7 @@ type = real kind = kind_phys intent = out + optional = True [br1] standard_name = bulk_richardson_number_at_lowest_model_level long_name = bulk Richardson number at the surface @@ -648,6 +672,7 @@ type = real kind = kind_phys intent = in + optional = True [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 @@ -924,6 +949,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ogw] standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag long_name = time integral of change in x wind due to orographic gw drag @@ -932,6 +958,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_tms] standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag long_name = time integral of change in x wind due to TOFD @@ -940,6 +967,7 @@ type = real kind = kind_phys intent = inout + optional = True [dudt] standard_name = process_split_cumulative_tendency_of_x_wind long_name = zonal wind tendency due to model physics @@ -1096,6 +1124,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -1103,6 +1132,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -1209,6 +1239,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_gwd] standard_name = control_for_gravity_wave_drag_spp_perturbations long_name = control for gravity wave drag spp perturbations diff --git a/physics/GWD/unified_ugwp_post.meta b/physics/GWD/unified_ugwp_post.meta index 7784c28ec..d129b046f 100644 --- a/physics/GWD/unified_ugwp_post.meta +++ b/physics/GWD/unified_ugwp_post.meta @@ -139,6 +139,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_ogw] standard_name = tendency_of_y_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = y momentum tendency from meso scale ogw @@ -147,6 +148,7 @@ type = real kind = kind_phys intent = in + optional = True [dudt_tms] standard_name = tendency_of_x_wind_due_to_turbulent_orographic_form_drag long_name = instantaneous change in x wind due to TOFD @@ -219,6 +221,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ogw] standard_name = time_integral_of_change_in_x_wind_due_to_orographic_gravity_wave_drag long_name = time integral of change in x wind due to orographic gw drag @@ -227,6 +230,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_tms] standard_name = time_integral_of_change_in_x_wind_due_to_turbulent_orographic_form_drag long_name = time integral of change in x wind due to TOFD @@ -235,6 +239,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3dt_ngw] standard_name = time_integral_of_change_in_x_wind_due_to_nonstationary_gravity_wave long_name = time integral of change in x wind due to NGW @@ -243,6 +248,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3dt_ngw] standard_name = time_integral_of_change_in_y_wind_due_to_nonstationary_gravity_wave long_name = time integral of change in y wind due to NGW @@ -251,6 +257,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_ogw] standard_name = cumulative_change_in_x_wind_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative change in x wind due to mesoscale orographic gravity wave drag @@ -259,6 +266,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_obl] standard_name = cumulative_change_in_x_wind_due_to_blocking_drag long_name = cumulative change in x wind due to blocking drag @@ -267,6 +275,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_oss] standard_name = cumulative_change_in_x_wind_due_to_small_scale_gravity_wave_drag long_name = cumulative change in x wind due to small scale gravity wave drag @@ -275,6 +284,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldu3dt_ofd] standard_name = cumulative_change_in_x_wind_due_to_form_drag long_name = cumulative change in x wind due to form drag @@ -283,6 +293,7 @@ type = real kind = kind_phys intent = inout + optional = True [dudt_ngw] standard_name = tendency_of_x_wind_due_to_nonorographic_gravity_wave_drag long_name = zonal wind tendency due to non-stationary GWs @@ -291,6 +302,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_ngw] standard_name = tendency_of_y_wind_due_to_nonorographic_gravity_wave_drag long_name = meridional wind tendency due to non-stationary GWs @@ -299,6 +311,7 @@ type = real kind = kind_phys intent = in + optional = True [dtdt_ngw] standard_name = tendency_of_air_temperature_due_to_nonorographic_gravity_wave_drag long_name = air temperature tendency due to non-stationary GWs @@ -307,6 +320,7 @@ type = real kind = kind_phys intent = in + optional = True [ldu3dt_ngw] standard_name = cumulative_change_in_x_wind_due_to_convective_gravity_wave_drag long_name = cumulative change in x wind due to convective gravity wave drag @@ -315,6 +329,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldv3dt_ngw] standard_name = cumulative_change_in_y_wind_due_to_convective_gravity_wave_drag long_name = cumulative change in y wind due to convective gravity wave drag @@ -323,6 +338,7 @@ type = real kind = kind_phys intent = inout + optional = True [ldt3dt_ngw] standard_name = cumulative_change_in_temperature_due_to_convective_gravity_wave_drag long_name = cumulative change in temperature due to convective gravity wave drag @@ -331,6 +347,7 @@ type = real kind = kind_phys intent = inout + optional = True [dudt_obl] standard_name = tendency_of_x_wind_due_to_blocking_drag long_name = x wind tendency from blocking drag @@ -339,6 +356,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_obl] standard_name = tendency_of_y_wind_due_to_blocking_drag long_name = y wind tendency from blocking drag @@ -347,6 +365,7 @@ type = real kind = kind_phys intent = in + optional = True [dudt_oss] standard_name = tendency_of_x_wind_due_to_small_scale_gravity_wave_drag long_name = x wind tendency from small scale gwd @@ -355,6 +374,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_oss] standard_name = tendency_of_y_wind_due_to_small_scale_gravity_wave_drag long_name = y wind tendency from small scale gwd @@ -363,6 +383,7 @@ type = real kind = kind_phys intent = in + optional = True [dudt_ofd] standard_name = tendency_of_x_wind_due_to_form_drag long_name = x wind tendency from form drag @@ -371,6 +392,7 @@ type = real kind = kind_phys intent = in + optional = True [dvdt_ofd] standard_name = tendency_of_y_wind_due_to_form_drag long_name = y wind tendency from form drag @@ -379,6 +401,7 @@ type = real kind = kind_phys intent = in + optional = True [dws3dt_ogw] standard_name = cumulative_change_in_wind_speed_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative change in wind speed due to mesoscale orographic gravity wave drag @@ -387,6 +410,7 @@ type = real kind = kind_phys intent = inout + optional = True [dws3dt_obl] standard_name = cumulative_change_in_wind_speed_due_to_blocking_drag long_name = cumulative change in wind speed due to blocking drag @@ -395,6 +419,7 @@ type = real kind = kind_phys intent = inout + optional = True [dws3dt_oss] standard_name = cumulative_change_in_wind_speed_due_to_small_scale_orographic_gravity_wave_drag long_name = cumulative change in wind speed due to small scale orographic gravity wave drag @@ -403,6 +428,7 @@ type = real kind = kind_phys intent = inout + optional = True [dws3dt_ofd] standard_name = cumulative_change_in_wind_speed_due_to_turbulent_orographic_form_drag long_name = cumulative change in wind speed due to turbulent orographic form drag @@ -411,6 +437,7 @@ type = real kind = kind_phys intent = inout + optional = True [du_ogwcol] standard_name = vertically_integrated_x_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated x momentum flux from meso scale ogw @@ -419,6 +446,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_ogwcol] standard_name = vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = integrated y momentum flux from meso scale ogw @@ -427,6 +455,7 @@ type = real kind = kind_phys intent = in + optional = True [du_oblcol] standard_name = vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = integrated x momentum flux from blocking drag @@ -435,6 +464,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_oblcol] standard_name = vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = integrated y momentum flux from blocking drag @@ -443,6 +473,7 @@ type = real kind = kind_phys intent = in + optional = True [du_osscol] standard_name = vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated x momentum flux from small scale gwd @@ -451,6 +482,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_osscol] standard_name = vertically_integrated_y_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = integrated y momentum flux from small scale gwd @@ -459,6 +491,7 @@ type = real kind = kind_phys intent = in + optional = True [du_ofdcol] standard_name = vertically_integrated_x_momentum_flux_due_to_form_drag long_name = integrated x momentum flux from form drag @@ -467,6 +500,7 @@ type = real kind = kind_phys intent = in + optional = True [dv_ofdcol] standard_name = vertically_integrated_y_momentum_flux_due_to_form_drag long_name = integrated y momentum flux from form drag @@ -475,6 +509,7 @@ type = real kind = kind_phys intent = in + optional = True [du3_ogwcol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative integrated x momentum flux from mesoscale orographic gravity wave drag @@ -483,6 +518,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_ogwcol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_to_mesoscale_orographic_gravity_wave_drag long_name = cumulative integrated y momentum flux from mesoscale orographic gravity wave drag @@ -491,6 +527,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3_oblcol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_blocking_drag long_name = cumulative integrated x momentum flux from blocking drag @@ -499,6 +536,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_oblcol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_to_blocking_drag long_name = cumulative integrated y momentum flux from blocking drag @@ -507,6 +545,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3_osscol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_small_scale_gravity_wave_drag long_name = cumulative integrated x momentum flux from small scale gravity wave drag @@ -515,6 +554,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_osscol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_small_scale_gravity_wave_drag long_name = cumulative integrated y momentum flux from small scale gravity wave drag @@ -523,6 +563,7 @@ type = real kind = kind_phys intent = inout + optional = True [du3_ofdcol] standard_name = cumulative_vertically_integrated_x_momentum_flux_due_to_form_drag long_name = cumulative integrated x momentum flux from form drag @@ -531,6 +572,7 @@ type = real kind = kind_phys intent = inout + optional = True [dv3_ofdcol] standard_name = cumulative_vertically_integrated_y_momentum_flux_due_to_form_drag long_name = cumulative integrated y momentum flux from form drag @@ -539,6 +581,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtdt] standard_name = process_split_cumulative_tendency_of_air_temperature long_name = air temperature tendency due to model physics diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta index ab8982e11..c23eafdc7 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta @@ -138,6 +138,7 @@ type = real kind = kind_phys intent = in + optional = True [dd_mf] standard_name = instantaneous_atmosphere_downdraft_convective_mass_flux long_name = (downdraft mass flux) * delt @@ -162,6 +163,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -169,6 +171,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_dcnv] standard_name = index_of_deep_convection_process_process_in_cumulative_change_index long_name = index of deep convection process in second dimension of array cumulative change index @@ -280,6 +283,7 @@ type = real kind = kind_phys intent = inout + optional = True [dwn_mf] standard_name = cumulative_atmosphere_downdraft_convective_mass_flux long_name = cumulative downdraft mass flux @@ -288,6 +292,7 @@ type = real kind = kind_phys intent = inout + optional = True [det_mf] standard_name = cumulative_atmosphere_detrainment_convective_mass_flux long_name = cumulative detrainment mass flux @@ -296,6 +301,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnvw] standard_name = convective_cloud_water_mixing_ratio long_name = moist convective cloud water mixing ratio @@ -320,6 +326,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnvc_phy_f3d] standard_name = convective_cloud_area_fraction long_name = convective cloud cover in the phy_f3d array @@ -328,6 +335,7 @@ type = real kind = kind_phys intent = inout + optional = True [flag_for_dcnv_generic_tend] standard_name = flag_for_generic_tendency_due_to_deep_convection long_name = true if GFS_DCNV_generic should calculate tendencies @@ -447,6 +455,7 @@ dimensions = () type = integer intent = in + optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta index ec1c59810..825f56696 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta @@ -134,6 +134,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_dcnv] standard_name = index_of_deep_convection_process_process_in_cumulative_change_index long_name = index of deep convection process in second dimension of array cumulative change index @@ -260,6 +261,7 @@ dimensions = () type = integer intent = in + optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta index beca39282..90578c2fb 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta @@ -94,6 +94,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -101,6 +102,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta index dbbfc261d..609e0c259 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta @@ -76,6 +76,7 @@ type = real kind = kind_phys intent = out + optional = True [ocss] standard_name = convexity_of_subgrid_orography_small_scale long_name = convexity of subgrid height_above_mean_sea_level small scale @@ -84,6 +85,7 @@ type = real kind = kind_phys intent = out + optional = True [oa4ss] standard_name = asymmetry_of_subgrid_orography_small_scale long_name = asymmetry of subgrid height_above_mean_sea_level small scale @@ -92,6 +94,7 @@ type = real kind = kind_phys intent = out + optional = True [clxss] standard_name = fraction_of_grid_box_with_subgrid_orography_higher_than_critical_height_small_scale long_name = horizontal fraction of grid box covered by subgrid height_above_mean_sea_level higher than critical height small scale @@ -100,6 +103,7 @@ type = real kind = kind_phys intent = out + optional = True [sigma] standard_name = slope_of_subgrid_orography long_name = slope of subgrid height_above_mean_sea_level @@ -170,6 +174,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -177,6 +182,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta index 7f67aa925..724dac818 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta @@ -336,6 +336,7 @@ type = real kind = kind_phys intent = inout + optional = True [snow] standard_name = lwe_thickness_of_snow_amount_on_dynamics_timestep long_name = snow fall at this time step @@ -344,6 +345,7 @@ type = real kind = kind_phys intent = inout + optional = True [graupel] standard_name = lwe_thickness_of_graupel_amount_on_dynamics_timestep long_name = graupel fall at this time step @@ -352,6 +354,7 @@ type = real kind = kind_phys intent = inout + optional = True [frzr] standard_name = cumulative_lwe_thickness_of_surface_freezing_rain_amount long_name = accumulated surface freezing rain @@ -439,6 +442,7 @@ type = real kind = kind_phys intent = in + optional = True [ice0] standard_name = lwe_thickness_of_ice_amount long_name = ice fall on physics timestep @@ -447,6 +451,7 @@ type = real kind = kind_phys intent = in + optional = True [snow0] standard_name = lwe_thickness_of_snow_amount long_name = snow fall on physics timestep @@ -455,6 +460,7 @@ type = real kind = kind_phys intent = in + optional = True [graupel0] standard_name = lwe_thickness_of_graupel_amount long_name = graupel fall on physics timestep @@ -463,6 +469,7 @@ type = real kind = kind_phys intent = in + optional = True [del] standard_name = air_pressure_difference_between_midlayers long_name = air pressure difference between midlayers @@ -559,6 +566,7 @@ type = real kind = kind_phys intent = inout + optional = True [totsnw] standard_name = accumulated_lwe_thickness_of_snow_amount long_name = accumulated snow precipitation @@ -567,6 +575,7 @@ type = real kind = kind_phys intent = inout + optional = True [totgrp] standard_name = accumulated_lwe_thickness_of_graupel_amount long_name = accumulated graupel precipitation @@ -575,6 +584,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnvprcpb] standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket long_name = cumulative convective precipitation in bucket @@ -599,6 +609,7 @@ type = real kind = kind_phys intent = inout + optional = True [totsnwb] standard_name = accumulated_lwe_thickness_of_snow_amount_in_bucket long_name = accumulated snow precipitation in bucket @@ -607,6 +618,7 @@ type = real kind = kind_phys intent = inout + optional = True [totgrpb] standard_name = accumulated_lwe_thickness_of_graupel_amount_in_bucket long_name = accumulated graupel precipitation in bucket @@ -615,6 +627,7 @@ type = real kind = kind_phys intent = inout + optional = True [rain_cpl] standard_name = cumulative_lwe_thickness_of_precipitation_amount_for_coupling long_name = total rain precipitation @@ -623,6 +636,7 @@ type = real kind = kind_phys intent = inout + optional = True [rainc_cpl] standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_for_coupling long_name = total convective precipitation @@ -631,6 +645,7 @@ type = real kind = kind_phys intent = inout + optional = True [snow_cpl] standard_name = cumulative_lwe_thickness_of_snow_amount_for_coupling long_name = total snow precipitation @@ -639,6 +654,7 @@ type = real kind = kind_phys intent = inout + optional = True [pwat] standard_name = column_precipitable_water long_name = precipitable water @@ -655,6 +671,7 @@ type = real kind = kind_phys intent = inout + optional = True [dsnow_cpl] standard_name = tendency_of_lwe_thickness_of_snowfall_amount_on_dynamics_timestep_for_coupling long_name = change in show_cpl (coupling_type) @@ -663,6 +680,7 @@ type = real kind = kind_phys intent = inout + optional = True [lsm] standard_name = control_for_land_surface_scheme long_name = flag for land surface model @@ -692,6 +710,7 @@ type = real kind = kind_phys intent = inout + optional = True [rainncprv] standard_name = lwe_thickness_of_explicit_precipitation_amount_on_previous_timestep long_name = explicit rainfall from previous timestep @@ -700,6 +719,7 @@ type = real kind = kind_phys intent = inout + optional = True [iceprv] standard_name = lwe_thickness_of_ice_precipitation_amount_on_previous_timestep long_name = ice amount from previous timestep @@ -708,6 +728,7 @@ type = real kind = kind_phys intent = inout + optional = True [snowprv] standard_name = snow_mass_on_previous_timestep long_name = snow amount from previous timestep @@ -716,6 +737,7 @@ type = real kind = kind_phys intent = inout + optional = True [graupelprv] standard_name = lwe_thickness_of_graupel_amount_on_previous_timestep long_name = graupel amount from previous timestep @@ -724,6 +746,7 @@ type = real kind = kind_phys intent = inout + optional = True [draincprv] standard_name = convective_precipitation_rate_on_previous_timestep long_name = convective precipitation rate from previous timestep @@ -732,6 +755,7 @@ type = real kind = kind_phys intent = inout + optional = True [drainncprv] standard_name = explicit_precipitation_rate_on_previous_timestep long_name = explicit rainfall rate previous timestep @@ -740,6 +764,7 @@ type = real kind = kind_phys intent = inout + optional = True [diceprv] standard_name = ice_precipitation_rate_on_previous_timestep long_name = ice precipitation rate from previous timestep @@ -748,6 +773,7 @@ type = real kind = kind_phys intent = inout + optional = True [dsnowprv] standard_name = snowfall_rate_on_previous_timestep long_name = snow precipitation rate from previous timestep @@ -756,6 +782,7 @@ type = real kind = kind_phys intent = inout + optional = True [dgraupelprv] standard_name = graupel_precipitation_rate_on_previous_timestep long_name = graupel precipitation rate from previous timestep @@ -764,6 +791,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtp] standard_name = timestep_for_physics long_name = physics timestep @@ -809,6 +837,7 @@ type = real kind = kind_phys intent = in + optional = True [fhour] standard_name = forecast_time long_name = current forecast time @@ -840,6 +869,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -847,6 +877,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -883,6 +914,7 @@ type = real kind = kind_phys intent = inout + optional = True [prevsq] standard_name = specific_humidity_on_previous_timestep long_name = specific_humidity_on_previous_timestep @@ -891,6 +923,7 @@ type = real kind = kind_phys intent = inout + optional = True [lssav] standard_name = flag_for_diagnostics long_name = logical flag for storing diagnostics diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta index d49a885c5..105d9aa48 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta @@ -113,6 +113,7 @@ dimensions = () type = integer intent = in + optional = True [ntia] standard_name = index_of_mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_in_tracer_concentration_array long_name = tracer index for ice friendly aerosol @@ -120,6 +121,7 @@ dimensions = () type = integer intent = in + optional = True [ntgl] standard_name = index_of_graupel_mixing_ratio_in_tracer_concentration_array long_name = tracer index for graupel @@ -183,6 +185,7 @@ dimensions = () type = integer intent = in + optional = True [nthl] standard_name = index_of_hail_mixing_ratio_in_tracer_concentration_array long_name = tracer index for hail @@ -204,6 +207,7 @@ dimensions = () type = integer intent = in + optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume @@ -454,6 +458,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -490,6 +495,7 @@ type = real kind = kind_phys intent = in + optional = True [dtf] standard_name = timestep_for_dynamics long_name = dynamics timestep @@ -562,6 +568,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_cpl] standard_name = cumulative_surface_y_momentum_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc v momentum flux multiplied by timestep @@ -570,6 +577,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtsfc_cpl] standard_name = cumulative_surface_upward_sensible_heat_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc sensible heat flux multiplied by timestep @@ -578,6 +586,7 @@ type = real kind = kind_phys intent = inout + optional = True [dqsfc_cpl] standard_name = cumulative_surface_upward_latent_heat_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc latent heat flux multiplied by timestep @@ -586,6 +595,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfci_cpl] standard_name = surface_x_momentum_flux_for_coupling long_name = instantaneous sfc u momentum flux @@ -594,6 +604,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfci_cpl] standard_name = surface_y_momentum_flux_for_coupling long_name = instantaneous sfc v momentum flux @@ -602,6 +613,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtsfci_cpl] standard_name = surface_upward_sensible_heat_flux_for_coupling long_name = instantaneous sfc sensible heat flux @@ -610,6 +622,7 @@ type = real kind = kind_phys intent = inout + optional = True [dqsfci_cpl] standard_name = surface_upward_latent_heat_flux_for_coupling long_name = instantaneous sfc latent heat flux @@ -618,6 +631,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_diag] standard_name = cumulative_surface_x_momentum_flux_for_diag_multiplied_by_timestep long_name = cumulative sfc x momentum flux multiplied by timestep @@ -650,6 +664,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfci_diag] standard_name = instantaneous_surface_x_momentum_flux_for_diag long_name = instantaneous sfc x momentum flux multiplied by timestep @@ -682,6 +697,7 @@ type = real kind = kind_phys intent = inout + optional = True [rd] standard_name = gas_constant_of_dry_air long_name = ideal gas constant for dry air @@ -754,6 +770,7 @@ type = real kind = kind_phys intent = out + optional = True [oceanfrac] standard_name = sea_area_fraction long_name = fraction of horizontal grid area occupied by ocean @@ -777,6 +794,7 @@ type = real kind = kind_phys intent = in + optional = True [dvsfc_cice] standard_name = surface_y_momentum_flux_from_coupled_process long_name = sfc y momentum flux for coupling @@ -785,6 +803,7 @@ type = real kind = kind_phys intent = in + optional = True [dtsfc_cice] standard_name = surface_upward_sensible_heat_flux_from_coupled_process long_name = sfc sensible heat flux for coupling @@ -793,6 +812,7 @@ type = real kind = kind_phys intent = in + optional = True [dqsfc_cice] standard_name = surface_upward_latent_heat_flux_from_coupled_process long_name = sfc latent heat flux for coupling @@ -801,6 +821,7 @@ type = real kind = kind_phys intent = in + optional = True [use_med_flux] standard_name = do_mediator_atmosphere_ocean_fluxes long_name = flag for using atmosphere-ocean fluxes from mediator @@ -816,6 +837,7 @@ type = real kind = kind_phys intent = in + optional = True [dtsfc_med] standard_name = surface_upward_sensible_heat_flux_over_ocean_from_mediator long_name = sfc sensible heat flux input over ocean for coupling @@ -824,6 +846,7 @@ type = real kind = kind_phys intent = in + optional = True [dusfc_med] standard_name = surface_x_momentum_flux_over_ocean_from_mediator long_name = sfc x momentum flux over ocean for coupling @@ -832,6 +855,7 @@ type = real kind = kind_phys intent = in + optional = True [dvsfc_med] standard_name = surface_y_momentum_flux_over_ocean_from_mediator long_name = sfc y momentum flux over ocean for coupling @@ -840,6 +864,7 @@ type = real kind = kind_phys intent = in + optional = True [wet] standard_name = flag_nonzero_wet_surface_fraction long_name = flag indicating presence of some ocean or lake surface area fraction @@ -893,6 +918,7 @@ type = real kind = kind_phys intent = in + optional = True [ugrs1] standard_name = x_wind_at_surface_adjacent_layer long_name = zonal wind at lowest model layer diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta index 7a8e72bba..48e7e4440 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta @@ -119,6 +119,7 @@ dimensions = () type = integer intent = in + optional = True [ntia] standard_name = index_of_mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_in_tracer_concentration_array long_name = tracer index for ice friendly aerosol @@ -126,6 +127,7 @@ dimensions = () type = integer intent = in + optional = True [ntgl] standard_name = index_of_graupel_mixing_ratio_in_tracer_concentration_array long_name = tracer index for graupel @@ -189,6 +191,7 @@ dimensions = () type = integer intent = in + optional = True [nthl] standard_name = index_of_hail_mixing_ratio_in_tracer_concentration_array long_name = tracer index for hail @@ -210,6 +213,7 @@ dimensions = () type = integer intent = in + optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta index 963ad4a81..4584a3e67 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta @@ -130,6 +130,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -137,6 +138,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -187,6 +189,7 @@ dimensions = () type = logical intent = in + optional = True [rain1] standard_name = lwe_thickness_of_shallow_convective_precipitation_amount long_name = shallow convective rainfall amount on physics timestep @@ -271,6 +274,7 @@ type = real kind = kind_phys intent = inout + optional = True [cnvc_phy_f3d] standard_name = convective_cloud_area_fraction long_name = convective cloud cover in the phy_f3d array @@ -279,6 +283,7 @@ type = real kind = kind_phys intent = inout + optional = True [flag_for_scnv_generic_tend] standard_name = flag_for_generic_tendency_due_to_shallow_convection long_name = true if GFS_SCNV_generic should calculate tendencies diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta index fbd9e47d8..1ae559ba8 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta @@ -127,6 +127,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_scnv] standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index long_name = index of shallow convection process in second dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta index 576c66463..8a5ede992 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta @@ -133,6 +133,7 @@ type = real kind = kind_phys intent = in + optional = True [cloud_overlap_param] standard_name = cloud_overlap_param long_name = cloud overlap parameter @@ -141,6 +142,7 @@ type = real kind = kind_phys intent = in + optional = True [precip_overlap_param] standard_name = precip_overlap_param long_name = precipitation overlap parameter @@ -149,6 +151,7 @@ type = real kind = kind_phys intent = in + optional = True [con_pi] standard_name = pi long_name = ratio of a circle's circumference to its diameter diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta index a1990ed43..1cdcc8863 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta @@ -131,6 +131,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_o3] standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation long_name = interpolation high index for ozone @@ -138,6 +139,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_o3] standard_name = latitude_interpolation_weight_for_ozone_forcing long_name = interpolation high index for ozone @@ -146,6 +148,7 @@ type = real kind = kind_phys intent = inout + optional = True [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor @@ -153,6 +156,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_h] standard_name = upper_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation high index for stratospheric water vapor @@ -160,6 +164,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_h] standard_name = latitude_interpolation_weight_for_stratospheric_water_vapor_forcing long_name = interpolation high index for stratospheric water vapor @@ -168,6 +173,7 @@ type = real kind = kind_phys intent = inout + optional = True [h2opl] standard_name = stratospheric_water_vapor_forcing long_name = water forcing data @@ -191,6 +197,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_aer] standard_name = upper_latitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the y direction @@ -198,6 +205,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_aer] standard_name = latitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the y direction @@ -206,6 +214,7 @@ type = real kind = kind_phys intent = inout + optional = True [iindx1_aer] standard_name = lower_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation low index for prescribed aerosols in the x direction @@ -213,6 +222,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [iindx2_aer] standard_name = upper_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the x direction @@ -220,6 +230,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddx_aer] standard_name = longitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the x direction @@ -228,6 +239,7 @@ type = real kind = kind_phys intent = inout + optional = True [aer_nm] standard_name = mass_mixing_ratio_of_aerosol_from_gocart_or_merra2 long_name = mass mixing ratio of aerosol from gocart or merra2 @@ -243,6 +255,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_ci] standard_name = upper_latitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -250,6 +263,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_ci] standard_name = latitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -258,6 +272,7 @@ type = real kind = kind_phys intent = inout + optional = True [iindx1_ci] standard_name = lower_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation low index for ice and cloud condensation nuclei in the x direction @@ -265,6 +280,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [iindx2_ci] standard_name = upper_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -272,6 +288,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddx_ci] standard_name = longitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -280,6 +297,7 @@ type = real kind = kind_phys intent = inout + optional = True [imap] standard_name = map_of_block_column_number_to_global_i_index long_name = map of local index ix to global index i for this block @@ -308,6 +326,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_tau] standard_name = upper_latitude_index_of_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag_for_interpolation long_name = index2 for weight2 for tau NGWs @@ -315,6 +334,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_j1tau] standard_name = latitude_interpolation_weight_complement_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight1 for tau NGWs @@ -323,6 +343,7 @@ type = real intent = inout kind = kind_phys + optional = True [ddy_j2tau] standard_name = latitude_interpolation_weight_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight2 for tau NGWs @@ -331,6 +352,7 @@ type = real intent = inout kind = kind_phys + optional = True [isot] standard_name = control_for_soil_type_dataset long_name = soil type dataset choice @@ -368,6 +390,7 @@ type = real kind = kind_phys intent = inout + optional = True [lsm] standard_name = control_for_land_surface_scheme long_name = flag for land surface model @@ -473,6 +496,7 @@ type = real kind = kind_phys intent = inout + optional = True [tgxy] standard_name = ground_temperature long_name = ground temperature for noahmp @@ -481,6 +505,7 @@ type = real kind = kind_phys intent = inout + optional = True [tahxy] standard_name = air_temperature_in_canopy long_name = canopy air temperature @@ -489,6 +514,7 @@ type = real kind = kind_phys intent = inout + optional = True [canicexy] standard_name = canopy_intercepted_ice_mass long_name = canopy intercepted ice mass @@ -497,6 +523,7 @@ type = real kind = kind_phys intent = inout + optional = True [canliqxy] standard_name = canopy_intercepted_liquid_water long_name = canopy intercepted liquid water @@ -505,6 +532,7 @@ type = real kind = kind_phys intent = inout + optional = True [eahxy] standard_name = air_vapor_pressure_in_canopy long_name = canopy air vapor pressure @@ -513,6 +541,7 @@ type = real kind = kind_phys intent = inout + optional = True [cmxy] standard_name = surface_drag_coefficient_for_momentum_for_noahmp long_name = surface drag coefficient for momentum for noahmp @@ -521,6 +550,7 @@ type = real kind = kind_phys intent = inout + optional = True [chxy] standard_name = surface_drag_coefficient_for_heat_and_moisture_for_noahmp long_name = surface exchange coeff heat & moisture for noahmp @@ -529,6 +559,7 @@ type = real kind = kind_phys intent = inout + optional = True [fwetxy] standard_name = wet_canopy_area_fraction long_name = area fraction of canopy that is wetted/snowed @@ -537,6 +568,7 @@ type = real kind = kind_phys intent = inout + optional = True [sneqvoxy] standard_name = lwe_thickness_of_snowfall_amount_on_previous_timestep long_name = snow mass at previous time step @@ -545,6 +577,7 @@ type = real kind = kind_phys intent = inout + optional = True [alboldxy] standard_name = surface_albedo_assuming_deep_snow_on_previous_timestep long_name = snow albedo at previous time step @@ -553,6 +586,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsnowxy] standard_name = lwe_snowfall_rate long_name = snow precipitation rate at surface @@ -561,6 +595,7 @@ type = real kind = kind_phys intent = inout + optional = True [wslakexy] standard_name = water_storage_in_lake long_name = lake water storage @@ -569,6 +604,7 @@ type = real kind = kind_phys intent = inout + optional = True [taussxy] standard_name = dimensionless_age_of_surface_snow long_name = non-dimensional snow age @@ -577,6 +613,7 @@ type = real kind = kind_phys intent = inout + optional = True [waxy] standard_name = water_storage_in_aquifer long_name = water storage in aquifer @@ -585,6 +622,7 @@ type = real kind = kind_phys intent = inout + optional = True [wtxy] standard_name = water_storage_in_aquifer_and_saturated_soil long_name = water storage in aquifer and saturated soil @@ -593,6 +631,7 @@ type = real kind = kind_phys intent = inout + optional = True [zwtxy] standard_name = water_table_depth long_name = water table depth @@ -601,6 +640,7 @@ type = real kind = kind_phys intent = inout + optional = True [xlaixy] standard_name = leaf_area_index long_name = leaf area index @@ -609,6 +649,7 @@ type = real kind = kind_phys intent = inout + optional = True [xsaixy] standard_name = stem_area_index long_name = stem area index @@ -617,6 +658,7 @@ type = real kind = kind_phys intent = inout + optional = True [lfmassxy] standard_name = leaf_mass_content long_name = leaf mass @@ -625,6 +667,7 @@ type = real kind = kind_phys intent = inout + optional = True [stmassxy] standard_name = stem_mass_content long_name = stem mass @@ -633,6 +676,7 @@ type = real kind = kind_phys intent = inout + optional = True [rtmassxy] standard_name = fine_root_mass_content long_name = fine root mass @@ -641,6 +685,7 @@ type = real kind = kind_phys intent = inout + optional = True [woodxy] standard_name = wood_mass_content long_name = wood mass including woody roots @@ -649,6 +694,7 @@ type = real kind = kind_phys intent = inout + optional = True [stblcpxy] standard_name = slow_soil_pool_mass_content_of_carbon long_name = stable carbon in deep soil @@ -657,6 +703,7 @@ type = real kind = kind_phys intent = inout + optional = True [fastcpxy] standard_name = fast_soil_pool_mass_content_of_carbon long_name = short-lived carbon in shallow soil @@ -665,6 +712,7 @@ type = real kind = kind_phys intent = inout + optional = True [smcwtdxy] standard_name = volumetric_soil_moisture_between_soil_bottom_and_water_table long_name = soil water content between the bottom of the soil and the water table @@ -673,6 +721,7 @@ type = real kind = kind_phys intent = inout + optional = True [deeprechxy] standard_name = water_table_recharge_assuming_deep long_name = recharge to or from the water table when deep @@ -681,6 +730,7 @@ type = real kind = kind_phys intent = inout + optional = True [rechxy] standard_name = water_table_recharge_assuming_shallow long_name = recharge to or from the water table when shallow @@ -689,6 +739,7 @@ type = real kind = kind_phys intent = inout + optional = True [albdvis_lnd] standard_name = surface_albedo_direct_visible_over_land long_name = direct surface albedo visible band over land @@ -729,6 +780,7 @@ type = real kind = kind_phys intent = inout + optional = True [albdnir_ice] standard_name = surface_albedo_direct_NIR_over_ice long_name = direct surface albedo NIR band over ice @@ -745,6 +797,7 @@ type = real kind = kind_phys intent = inout + optional = True [albinir_ice] standard_name = surface_albedo_diffuse_NIR_over_ice long_name = diffuse surface albedo NIR band over ice @@ -777,6 +830,7 @@ type = real kind = kind_phys intent = inout + optional = True [snicexy] standard_name = lwe_thickness_of_ice_in_surface_snow long_name = snow layer ice @@ -785,6 +839,7 @@ type = real kind = kind_phys intent = inout + optional = True [snliqxy] standard_name = lwe_thickness_of_liquid_water_in_surface_snow long_name = snow layer liquid water @@ -793,6 +848,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsnoxy] standard_name = temperature_in_surface_snow long_name = temperature_in_surface_snow @@ -801,6 +857,7 @@ type = real kind = kind_phys intent = inout + optional = True [smoiseq] standard_name = volumetric_equilibrium_soil_moisture long_name = equilibrium soil water content @@ -809,6 +866,7 @@ type = real kind = kind_phys intent = inout + optional = True [zsnsoxy] standard_name = depth_from_snow_surface_at_bottom_interface long_name = depth from the top of the snow surface at the bottom of the layer @@ -817,6 +875,7 @@ type = real kind = kind_phys intent = inout + optional = True [slc] standard_name = volume_fraction_of_unfrozen_water_in_soil long_name = liquid soil moisture @@ -1194,6 +1253,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_o3] standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation long_name = interpolation high index for ozone @@ -1201,6 +1261,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_o3] standard_name = latitude_interpolation_weight_for_ozone_forcing long_name = interpolation high index for ozone @@ -1209,6 +1270,7 @@ type = real kind = kind_phys intent = in + optional = True [ozpl] standard_name = ozone_forcing long_name = ozone forcing data @@ -1224,6 +1286,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_h] standard_name = upper_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation high index for stratospheric water vapor @@ -1231,6 +1294,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_h] standard_name = latitude_interpolation_weight_for_stratospheric_water_vapor_forcing long_name = interpolation high index for stratospheric water vapor @@ -1239,6 +1303,7 @@ type = real kind = kind_phys intent = in + optional = True [h2opl] standard_name = stratospheric_water_vapor_forcing long_name = water forcing data @@ -1261,6 +1326,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_aer] standard_name = upper_latitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the y direction @@ -1268,6 +1334,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_aer] standard_name = latitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the y direction @@ -1276,6 +1343,7 @@ type = real kind = kind_phys intent = in + optional = True [iindx1_aer] standard_name = lower_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation low index for prescribed aerosols in the x direction @@ -1283,6 +1351,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [iindx2_aer] standard_name = upper_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the x direction @@ -1290,6 +1359,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddx_aer] standard_name = longitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the x direction @@ -1298,6 +1368,7 @@ type = real kind = kind_phys intent = in + optional = True [aer_nm] standard_name = mass_mixing_ratio_of_aerosol_from_gocart_or_merra2 long_name = mass mixing ratio of aerosol from gocart or merra2 @@ -1313,6 +1384,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_ci] standard_name = upper_latitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -1320,6 +1392,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_ci] standard_name = latitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -1328,6 +1401,7 @@ type = real kind = kind_phys intent = in + optional = True [iindx1_ci] standard_name = lower_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation low index for ice and cloud condensation nuclei in the x direction @@ -1335,6 +1409,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [iindx2_ci] standard_name = upper_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -1342,6 +1417,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddx_ci] standard_name = longitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -1350,6 +1426,7 @@ type = real kind = kind_phys intent = in + optional = True [in_nm] standard_name = ice_nucleation_number_from_climatology long_name = ice nucleation number in MG MP @@ -1503,6 +1580,7 @@ type = character kind = len=256 intent = in + optional = True [use_ufo] standard_name = flag_for_gcycle_surface_option long_name = flag for gcycle surface option @@ -1596,6 +1674,7 @@ type = real kind = kind_phys intent = inout + optional = True [sh2o] standard_name = volume_fraction_of_unfrozen_soil_moisture_for_land_surface_model long_name = volume fraction of unfrozen soil moisture for lsm @@ -1604,6 +1683,7 @@ type = real kind = kind_phys intent = inout + optional = True [tslb] standard_name = soil_temperature_for_land_surface_model long_name = soil temperature for land surface model @@ -1612,6 +1692,7 @@ type = real kind = kind_phys intent = inout + optional = True [tiice] standard_name = temperature_in_ice_layer long_name = sea ice internal temperature @@ -1636,6 +1717,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsfc] standard_name = surface_skin_temperature long_name = surface skin temperature @@ -1840,6 +1922,7 @@ type = real kind = kind_phys intent = inout + optional = True [cvb] standard_name = pressure_at_convective_cloud_base_between_sw_radiation_calls_from_cnvc90 long_name = convective cloud bottom pressure @@ -1918,6 +2001,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_tau] standard_name = upper_latitude_index_of_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag_for_interpolation long_name = index2 for weight2 for tau NGWs @@ -1925,6 +2009,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_j1tau] standard_name = latitude_interpolation_weight_complement_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight1 for tau NGWs @@ -1933,6 +2018,7 @@ type = real intent = in kind = kind_phys + optional = True [ddy_j2tau] standard_name = latitude_interpolation_weight_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight2 for tau NGWs @@ -1941,6 +2027,7 @@ type = real intent = in kind = kind_phys + optional = True [tau_amf] standard_name = absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = ngw_absolute_momentum_flux diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta index a9094a075..20944a8b2 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta @@ -116,6 +116,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_o3] standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation long_name = interpolation high index for ozone @@ -123,6 +124,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_o3] standard_name = latitude_interpolation_weight_for_ozone_forcing long_name = interpolation high index for ozone @@ -131,6 +133,7 @@ type = real kind = kind_phys intent = inout + optional = True [jindx1_h] standard_name = lower_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation low index for stratospheric water vapor @@ -138,6 +141,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_h] standard_name = upper_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation high index for stratospheric water vapor @@ -145,6 +149,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_h] standard_name = latitude_interpolation_weight_for_stratospheric_water_vapor_forcing long_name = interpolation high index for stratospheric water vapor @@ -153,6 +158,7 @@ type = real kind = kind_phys intent = inout + optional = True [h2opl] standard_name = stratospheric_water_vapor_forcing long_name = water forcing data @@ -176,6 +182,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_aer] standard_name = upper_latitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the y direction @@ -183,6 +190,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_aer] standard_name = latitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the y direction @@ -191,6 +199,7 @@ type = real kind = kind_phys intent = inout + optional = True [iindx1_aer] standard_name = lower_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation low index for prescribed aerosols in the x direction @@ -198,6 +207,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [iindx2_aer] standard_name = upper_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the x direction @@ -205,6 +215,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddx_aer] standard_name = longitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the x direction @@ -213,6 +224,7 @@ type = real kind = kind_phys intent = inout + optional = True [aer_nm] standard_name = mass_mixing_ratio_of_aerosol_from_gocart_or_merra2 long_name = mass mixing ratio of aerosol from gocart or merra2 @@ -228,6 +240,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_ci] standard_name = upper_latitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -235,6 +248,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_ci] standard_name = latitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -243,6 +257,7 @@ type = real kind = kind_phys intent = inout + optional = True [iindx1_ci] standard_name = lower_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation low index for ice and cloud condensation nuclei in the x direction @@ -250,6 +265,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [iindx2_ci] standard_name = upper_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -257,6 +273,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddx_ci] standard_name = longitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -265,6 +282,7 @@ type = real kind = kind_phys intent = inout + optional = True [imap] standard_name = map_of_block_column_number_to_global_i_index long_name = map of local index ix to global index i for this block @@ -293,6 +311,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [jindx2_tau] standard_name = upper_latitude_index_of_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag_for_interpolation long_name = index2 for weight2 for tau NGWs @@ -300,6 +319,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [ddy_j1tau] standard_name = latitude_interpolation_weight_complement_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight1 for tau NGWs @@ -308,6 +328,7 @@ type = real intent = inout kind = kind_phys + optional = True [ddy_j2tau] standard_name = latitude_interpolation_weight_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight2 for tau NGWs @@ -316,6 +337,7 @@ type = real intent = inout kind = kind_phys + optional = True [isot] standard_name = control_for_soil_type_dataset long_name = soil type dataset choice @@ -353,6 +375,7 @@ type = real kind = kind_phys intent = inout + optional = True [lsm] standard_name = control_for_land_surface_scheme long_name = flag for land surface model @@ -458,6 +481,7 @@ type = real kind = kind_phys intent = inout + optional = True [tgxy] standard_name = ground_temperature long_name = ground temperature for noahmp @@ -466,6 +490,7 @@ type = real kind = kind_phys intent = inout + optional = True [tahxy] standard_name = air_temperature_in_canopy long_name = canopy air temperature @@ -474,6 +499,7 @@ type = real kind = kind_phys intent = inout + optional = True [canicexy] standard_name = canopy_intercepted_ice_mass long_name = canopy intercepted ice mass @@ -482,6 +508,7 @@ type = real kind = kind_phys intent = inout + optional = True [canliqxy] standard_name = canopy_intercepted_liquid_water long_name = canopy intercepted liquid water @@ -490,6 +517,7 @@ type = real kind = kind_phys intent = inout + optional = True [eahxy] standard_name = air_vapor_pressure_in_canopy long_name = canopy air vapor pressure @@ -498,6 +526,7 @@ type = real kind = kind_phys intent = inout + optional = True [cmxy] standard_name = surface_drag_coefficient_for_momentum_for_noahmp long_name = surface drag coefficient for momentum for noahmp @@ -506,6 +535,7 @@ type = real kind = kind_phys intent = inout + optional = True [chxy] standard_name = surface_drag_coefficient_for_heat_and_moisture_for_noahmp long_name = surface exchange coeff heat & moisture for noahmp @@ -514,6 +544,7 @@ type = real kind = kind_phys intent = inout + optional = True [fwetxy] standard_name = wet_canopy_area_fraction long_name = area fraction of canopy that is wetted/snowed @@ -522,6 +553,7 @@ type = real kind = kind_phys intent = inout + optional = True [sneqvoxy] standard_name = lwe_thickness_of_snowfall_amount_on_previous_timestep long_name = snow mass at previous time step @@ -530,6 +562,7 @@ type = real kind = kind_phys intent = inout + optional = True [alboldxy] standard_name = surface_albedo_assuming_deep_snow_on_previous_timestep long_name = snow albedo at previous time step @@ -538,6 +571,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsnowxy] standard_name = lwe_snowfall_rate long_name = snow precipitation rate at surface @@ -546,6 +580,7 @@ type = real kind = kind_phys intent = inout + optional = True [wslakexy] standard_name = water_storage_in_lake long_name = lake water storage @@ -554,6 +589,7 @@ type = real kind = kind_phys intent = inout + optional = True [taussxy] standard_name = dimensionless_age_of_surface_snow long_name = non-dimensional snow age @@ -562,6 +598,7 @@ type = real kind = kind_phys intent = inout + optional = True [waxy] standard_name = water_storage_in_aquifer long_name = water storage in aquifer @@ -570,6 +607,7 @@ type = real kind = kind_phys intent = inout + optional = True [wtxy] standard_name = water_storage_in_aquifer_and_saturated_soil long_name = water storage in aquifer and saturated soil @@ -578,6 +616,7 @@ type = real kind = kind_phys intent = inout + optional = True [zwtxy] standard_name = water_table_depth long_name = water table depth @@ -586,6 +625,7 @@ type = real kind = kind_phys intent = inout + optional = True [xlaixy] standard_name = leaf_area_index long_name = leaf area index @@ -594,6 +634,7 @@ type = real kind = kind_phys intent = inout + optional = True [xsaixy] standard_name = stem_area_index long_name = stem area index @@ -602,6 +643,7 @@ type = real kind = kind_phys intent = inout + optional = True [lfmassxy] standard_name = leaf_mass_content long_name = leaf mass @@ -610,6 +652,7 @@ type = real kind = kind_phys intent = inout + optional = True [stmassxy] standard_name = stem_mass_content long_name = stem mass @@ -618,6 +661,7 @@ type = real kind = kind_phys intent = inout + optional = True [rtmassxy] standard_name = fine_root_mass_content long_name = fine root mass @@ -626,6 +670,7 @@ type = real kind = kind_phys intent = inout + optional = True [woodxy] standard_name = wood_mass_content long_name = wood mass including woody roots @@ -634,6 +679,7 @@ type = real kind = kind_phys intent = inout + optional = True [stblcpxy] standard_name = slow_soil_pool_mass_content_of_carbon long_name = stable carbon in deep soil @@ -642,6 +688,7 @@ type = real kind = kind_phys intent = inout + optional = True [fastcpxy] standard_name = fast_soil_pool_mass_content_of_carbon long_name = short-lived carbon in shallow soil @@ -650,6 +697,7 @@ type = real kind = kind_phys intent = inout + optional = True [smcwtdxy] standard_name = volumetric_soil_moisture_between_soil_bottom_and_water_table long_name = soil water content between the bottom of the soil and the water table @@ -658,6 +706,7 @@ type = real kind = kind_phys intent = inout + optional = True [deeprechxy] standard_name = water_table_recharge_assuming_deep long_name = recharge to or from the water table when deep @@ -666,6 +715,7 @@ type = real kind = kind_phys intent = inout + optional = True [rechxy] standard_name = water_table_recharge_assuming_shallow long_name = recharge to or from the water table when shallow @@ -674,6 +724,7 @@ type = real kind = kind_phys intent = inout + optional = True [albdvis_lnd] standard_name = surface_albedo_direct_visible_over_land long_name = direct surface albedo visible band over land @@ -714,6 +765,7 @@ type = real kind = kind_phys intent = inout + optional = True [albdnir_ice] standard_name = surface_albedo_direct_NIR_over_ice long_name = direct surface albedo NIR band over ice @@ -730,6 +782,7 @@ type = real kind = kind_phys intent = inout + optional = True [albinir_ice] standard_name = surface_albedo_diffuse_NIR_over_ice long_name = diffuse surface albedo NIR band over ice @@ -762,6 +815,7 @@ type = real kind = kind_phys intent = inout + optional = True [snicexy] standard_name = lwe_thickness_of_ice_in_surface_snow long_name = snow layer ice @@ -770,6 +824,7 @@ type = real kind = kind_phys intent = inout + optional = True [snliqxy] standard_name = lwe_thickness_of_liquid_water_in_surface_snow long_name = snow layer liquid water @@ -778,6 +833,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsnoxy] standard_name = temperature_in_surface_snow long_name = temperature_in_surface_snow @@ -786,6 +842,7 @@ type = real kind = kind_phys intent = inout + optional = True [smoiseq] standard_name = volumetric_equilibrium_soil_moisture long_name = equilibrium soil water content @@ -794,6 +851,7 @@ type = real kind = kind_phys intent = inout + optional = True [zsnsoxy] standard_name = depth_from_snow_surface_at_bottom_interface long_name = depth from the top of the snow surface at the bottom of the layer @@ -802,6 +860,7 @@ type = real kind = kind_phys intent = inout + optional = True [slc] standard_name = volume_fraction_of_unfrozen_water_in_soil long_name = liquid soil moisture @@ -1098,6 +1157,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_o3] standard_name = upper_latitude_index_of_ozone_forcing_for_interpolation long_name = interpolation high index for ozone @@ -1105,6 +1165,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_o3] standard_name = latitude_interpolation_weight_for_ozone_forcing long_name = interpolation high index for ozone @@ -1113,6 +1174,7 @@ type = real kind = kind_phys intent = in + optional = True [ozpl] standard_name = ozone_forcing long_name = ozone forcing data @@ -1128,6 +1190,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_h] standard_name = upper_latitude_index_of_stratospheric_water_vapor_forcing_for_interpolation long_name = interpolation high index for stratospheric water vapor @@ -1135,6 +1198,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_h] standard_name = latitude_interpolation_weight_for_stratospheric_water_vapor_forcing long_name = interpolation high index for stratospheric water vapor @@ -1143,6 +1207,7 @@ type = real kind = kind_phys intent = in + optional = True [h2opl] standard_name = stratospheric_water_vapor_forcing long_name = water forcing data @@ -1165,6 +1230,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_aer] standard_name = upper_latitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the y direction @@ -1172,6 +1238,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_aer] standard_name = latitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the y direction @@ -1180,6 +1247,7 @@ type = real kind = kind_phys intent = in + optional = True [iindx1_aer] standard_name = lower_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation low index for prescribed aerosols in the x direction @@ -1187,6 +1255,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [iindx2_aer] standard_name = upper_longitude_index_of_aerosol_forcing_for_interpolation long_name = interpolation high index for prescribed aerosols in the x direction @@ -1194,6 +1263,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddx_aer] standard_name = longitude_interpolation_weight_for_aerosol_forcing long_name = interpolation high index for prescribed aerosols in the x direction @@ -1202,6 +1272,7 @@ type = real kind = kind_phys intent = in + optional = True [aer_nm] standard_name = mass_mixing_ratio_of_aerosol_from_gocart_or_merra2 long_name = mass mixing ratio of aerosol from gocart or merra2 @@ -1217,6 +1288,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_ci] standard_name = upper_latitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -1224,6 +1296,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_ci] standard_name = latitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the y direction @@ -1232,6 +1305,7 @@ type = real kind = kind_phys intent = in + optional = True [iindx1_ci] standard_name = lower_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation low index for ice and cloud condensation nuclei in the x direction @@ -1239,6 +1313,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [iindx2_ci] standard_name = upper_longitude_index_of_cloud_nuclei_forcing_for_interpolation long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -1246,6 +1321,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddx_ci] standard_name = longitude_interpolation_weight_for_cloud_nuclei_forcing long_name = interpolation high index for ice and cloud condensation nuclei in the x direction @@ -1254,6 +1330,7 @@ type = real kind = kind_phys intent = in + optional = True [in_nm] standard_name = ice_nucleation_number_from_climatology long_name = ice nucleation number in MG MP @@ -1321,6 +1398,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [jindx2_tau] standard_name = upper_latitude_index_of_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag_for_interpolation long_name = index2 for weight2 for tau NGWs @@ -1328,6 +1406,7 @@ dimensions = (horizontal_dimension) type = integer intent = in + optional = True [ddy_j1tau] standard_name = latitude_interpolation_weight_complement_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight1 for tau NGWs @@ -1336,6 +1415,7 @@ type = real intent = in kind = kind_phys + optional = True [ddy_j2tau] standard_name = latitude_interpolation_weight_for_absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = interpolation weight2 for tau NGWs @@ -1344,6 +1424,7 @@ type = real intent = in kind = kind_phys + optional = True [tau_amf] standard_name = absolute_momentum_flux_due_to_nonorographic_gravity_wave_drag long_name = ngw_absolute_momentum_flux diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta index 758b9d8b8..c931b9639 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta @@ -29,6 +29,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -36,6 +37,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [ntoz] standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array long_name = tracer index for ozone mixing ratio diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta index 0759b7e2a..488f547b6 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.meta @@ -22,6 +22,7 @@ dimensions = (horizontal_dimension, number_of_host_provided_random_number_streams) type = integer intent = in + optional = True [lslwr] standard_name = flag_for_calling_longwave_radiation long_name = logical flags for lw radiation calls @@ -57,6 +58,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [icsdlw] standard_name = random_number_seed_for_mcica_longwave long_name = random seeds for sub-column cloud generators lw @@ -64,6 +66,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [cnx] standard_name = number_of_x_points_for_current_cubed_sphere_tile long_name = number of points in x direction for this cubed sphere face @@ -157,6 +160,7 @@ type = real kind = kind_phys intent = inout + optional = True [ps_1delt] standard_name = surface_air_pressure_on_previous_timestep long_name = surface air pressure at previous timestep @@ -165,6 +169,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_2delt] standard_name = air_temperature_two_timesteps_back long_name = air temperature two timesteps back @@ -173,6 +178,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_1delt] standard_name = air_temperature_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = air temperature at previous timestep @@ -181,6 +187,7 @@ type = real kind = kind_phys intent = inout + optional = True [qv_2delt] standard_name = specific_humidity_two_timesteps_back long_name = water vapor specific humidity two timesteps back @@ -189,6 +196,7 @@ type = real kind = kind_phys intent = inout + optional = True [qv_1delt] standard_name = specific_humidity_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = water vapor specific humidity at previous timestep @@ -197,6 +205,7 @@ type = real kind = kind_phys intent = inout + optional = True [t] standard_name = air_temperature long_name = model layer mean temperature diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta index 0759b7e2a..488f547b6 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.meta @@ -22,6 +22,7 @@ dimensions = (horizontal_dimension, number_of_host_provided_random_number_streams) type = integer intent = in + optional = True [lslwr] standard_name = flag_for_calling_longwave_radiation long_name = logical flags for lw radiation calls @@ -57,6 +58,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [icsdlw] standard_name = random_number_seed_for_mcica_longwave long_name = random seeds for sub-column cloud generators lw @@ -64,6 +66,7 @@ dimensions = (horizontal_dimension) type = integer intent = inout + optional = True [cnx] standard_name = number_of_x_points_for_current_cubed_sphere_tile long_name = number of points in x direction for this cubed sphere face @@ -157,6 +160,7 @@ type = real kind = kind_phys intent = inout + optional = True [ps_1delt] standard_name = surface_air_pressure_on_previous_timestep long_name = surface air pressure at previous timestep @@ -165,6 +169,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_2delt] standard_name = air_temperature_two_timesteps_back long_name = air temperature two timesteps back @@ -173,6 +178,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_1delt] standard_name = air_temperature_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = air temperature at previous timestep @@ -181,6 +187,7 @@ type = real kind = kind_phys intent = inout + optional = True [qv_2delt] standard_name = specific_humidity_two_timesteps_back long_name = water vapor specific humidity two timesteps back @@ -189,6 +196,7 @@ type = real kind = kind_phys intent = inout + optional = True [qv_1delt] standard_name = specific_humidity_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = water vapor specific humidity at previous timestep @@ -197,6 +205,7 @@ type = real kind = kind_phys intent = inout + optional = True [t] standard_name = air_temperature long_name = model layer mean temperature diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta index 686bd3c6c..8d1148d75 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta @@ -184,6 +184,7 @@ type = character kind = len=3 intent = in + optional = True [lndp_prt_list] standard_name = land_surface_perturbation_magnitudes long_name = magnitude of perturbations for landperts @@ -192,6 +193,7 @@ type = real kind = kind_phys intent = in + optional = True [landfrac] standard_name = land_area_fraction long_name = fraction of horizontal grid area occupied by land @@ -232,6 +234,7 @@ type = real kind = kind_phys intent = in + optional = True [fice] standard_name = sea_ice_area_fraction_of_sea_area_fraction long_name = ice fraction over open water @@ -264,6 +267,7 @@ type = real kind = kind_phys intent = in + optional = True [tsfa] standard_name = surface_air_temperature_for_radiation long_name = lowest model layer air temperature for radiation @@ -461,6 +465,7 @@ type = real kind = kind_phys intent = in + optional = True [albdnir_ice] standard_name = surface_albedo_direct_NIR_over_ice long_name = direct surface albedo NIR band over ice @@ -477,6 +482,7 @@ type = real kind = kind_phys intent = in + optional = True [albinir_ice] standard_name = surface_albedo_diffuse_NIR_over_ice long_name = diffuse surface albedo NIR band over ice diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta index 15039e822..8c1c30a89 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta @@ -224,6 +224,7 @@ dimensions = () type = integer intent = in + optional = True [ntwa] standard_name = index_of_mass_number_concentration_of_hygroscopic_aerosols_in_tracer_concentration_array long_name = tracer index for water friendly aerosol @@ -231,6 +232,7 @@ dimensions = () type = integer intent = in + optional = True [ntoz] standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array long_name = tracer index for ozone mixing ratio @@ -618,6 +620,7 @@ type = character kind = len=3 intent = in + optional = True [lsswr] standard_name = flag_for_calling_shortwave_radiation long_name = logical flags for sw radiation calls @@ -910,6 +913,7 @@ type = real kind = kind_phys intent = in + optional = True [mg_cld] standard_name = cloud_fraction_for_MG long_name = cloud fraction used by Morrison-Gettelman MP @@ -926,6 +930,7 @@ type = real kind = kind_phys intent = in + optional = True [pert_clds] standard_name = flag_for_stochastic_cloud_fraction_perturbations long_name = flag for stochastic cloud fraction physics perturbations @@ -941,6 +946,7 @@ type = real kind = kind_phys intent = in + optional = True [sppt_amp] standard_name = total_amplitude_of_sppt_perturbation long_name = total ampltidue of stochastic sppt perturbation @@ -957,6 +963,7 @@ type = real kind = kind_phys intent = in + optional = True [cnvc_in] standard_name = convective_cloud_area_fraction long_name = convective cloud cover in the phy_f3d array @@ -965,6 +972,7 @@ type = real kind = kind_phys intent = in + optional = True [qgrs] standard_name = tracer_concentration long_name = model layer mean tracer concentration @@ -1020,6 +1028,7 @@ type = real kind = kind_phys intent = inout + optional = True [effri_inout] standard_name = effective_radius_of_stratiform_cloud_ice_particle long_name = eff. radius of cloud ice water particle in micrometer @@ -1028,6 +1037,7 @@ type = real kind = kind_phys intent = inout + optional = True [effrs_inout] standard_name = effective_radius_of_stratiform_cloud_snow_particle long_name = effective radius of cloud snow particle in micrometers @@ -1036,6 +1046,7 @@ type = real kind = kind_phys intent = inout + optional = True [clouds1] standard_name = total_cloud_fraction long_name = layer total cloud fraction @@ -1084,6 +1095,7 @@ type = real kind = kind_phys intent = in + optional = True [kd] standard_name = vertical_index_difference_between_inout_and_local long_name = vertical index difference between in/out and local @@ -1135,6 +1147,7 @@ type = real kind = kind_phys intent = out + optional = True [tsfa] standard_name = surface_air_temperature_for_radiation long_name = lowest model layer air temperature for radiation @@ -1175,6 +1188,7 @@ type = real kind = kind_phys intent = out + optional = True [plvl] standard_name = air_pressure_at_interface_for_radiation_in_hPa long_name = air pressure at vertical interface for radiation calculation @@ -1515,6 +1529,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_rad] standard_name = control_for_radiation_spp_perturbations long_name = control for radiation spp perturbations diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta index f67259b87..8b30b5a69 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta @@ -108,6 +108,7 @@ dimensions = () type = integer intent = in + optional = True [doSWrad] standard_name = flag_for_calling_shortwave_radiation long_name = logical flags for sw radiation calls @@ -283,6 +284,7 @@ type = real kind = kind_phys intent = in + optional = True [t_lay] standard_name = air_temperature_at_layer_for_RRTMGP long_name = air temperature at vertical layer for radiation calculation @@ -299,6 +301,7 @@ type = real kind = kind_phys intent = in + optional = True [q_lay] standard_name = water_vapor_mixing_ratio long_name = water vaport mixing ratio @@ -307,6 +310,7 @@ type = real kind = kind_phys intent = in + optional = True [relhum] standard_name = relative_humidity long_name = layer relative humidity @@ -315,6 +319,7 @@ type = real kind = kind_phys intent = in + optional = True [effrin_cldliq] standard_name = effective_radius_of_stratiform_cloud_liquid_water_particle long_name = eff. radius of cloud liquid water particle in micrometer @@ -323,6 +328,7 @@ type = real kind = kind_phys intent = inout + optional = True [effrin_cldice] standard_name = effective_radius_of_stratiform_cloud_ice_particle long_name = eff. radius of cloud ice water particle in micrometer @@ -331,6 +337,7 @@ type = real kind = kind_phys intent = inout + optional = True [effrin_cldrain] standard_name = effective_radius_of_stratiform_cloud_rain_particle long_name = effective radius of cloud rain particle in micrometers @@ -339,6 +346,7 @@ type = real kind = kind_phys intent = in + optional = True [effrin_cldsnow] standard_name = effective_radius_of_stratiform_cloud_snow_particle long_name = effective radius of cloud snow particle in micrometers @@ -347,6 +355,7 @@ type = real kind = kind_phys intent = inout + optional = True [tracer] standard_name = tracer_concentration long_name = model layer mean tracer concentration @@ -379,6 +388,7 @@ type = real kind = kind_phys intent = in + optional = True [deltaZ] standard_name = layer_thickness long_name = layer_thickness @@ -387,6 +397,7 @@ type = real kind = kind_phys intent = in + optional = True [deltaZc] standard_name = layer_thickness_from_layer_center long_name = layer_thickness @@ -395,6 +406,7 @@ type = real kind = kind_phys intent = in + optional = True [deltaP] standard_name = layer_thickness_in_Pa long_name = layer_thickness_in_Pa @@ -403,6 +415,7 @@ type = real kind = kind_phys intent = in + optional = True [qc_mynn] standard_name = subgrid_scale_cloud_liquid_water_mixing_ratio long_name = subgrid cloud water mixing ratio from PBL scheme @@ -411,6 +424,7 @@ type = real kind = kind_phys intent = in + optional = True [qi_mynn] standard_name = subgrid_scale_cloud_ice_mixing_ratio long_name = subgrid cloud ice mixing ratio from PBL scheme @@ -419,6 +433,7 @@ type = real kind = kind_phys intent = in + optional = True [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -552,6 +567,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_cnv_lwp] standard_name = convective_cloud_liquid_water_path long_name = layer convective cloud liquid water path @@ -560,6 +576,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_cnv_iwp] standard_name = convective_cloud_ice_water_path long_name = layer convective cloud ice water path @@ -568,6 +585,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_cnv_reliq] standard_name = mean_effective_radius_for_liquid_convective_cloud long_name = mean effective radius for liquid convective cloud @@ -576,6 +594,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_cnv_reice] standard_name = mean_effective_radius_for_ice_convective_cloud long_name = mean effective radius for ice convective cloud @@ -584,6 +603,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_pbl_frac] standard_name = subgrid_scale_cloud_area_fraction_in_atmosphere_layer long_name = subgrid cloud fraction from PBL scheme @@ -592,6 +612,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_lwp] standard_name = MYNN_SGS_cloud_liquid_water_path long_name = layer convective cloud liquid water path diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta index 4d9af626d..7b0d5845e 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta @@ -84,6 +84,7 @@ type = real kind = kind_phys intent = in + optional = True [deltaZc] standard_name = layer_thickness_from_layer_center long_name = layer_thickness @@ -92,6 +93,7 @@ type = real kind = kind_phys intent = in + optional = True [con_pi] standard_name = pi long_name = ratio of a circle's circumference to its diameter @@ -255,6 +257,7 @@ type = real kind = kind_phys intent = out + optional = True [precip_overlap_param] standard_name = precip_overlap_param long_name = precipitation overlap parameter @@ -263,6 +266,7 @@ type = real kind = kind_phys intent = out + optional = True [cnv_cloud_overlap_param] standard_name = convective_cloud_overlap_param long_name = convective cloud overlap parameter @@ -271,6 +275,7 @@ type = real kind = kind_phys intent = out + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta index 5b355849a..a02ba2276 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta @@ -354,6 +354,7 @@ type = real kind = kind_phys intent = inout + optional = True [topflw] standard_name = lw_fluxes_top_atmosphere long_name = lw radiation fluxes at top diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta index bd767d14b..4b2e192fb 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta @@ -309,6 +309,7 @@ type = real kind = kind_phys intent = inout + optional = True [deltaZc] standard_name = layer_thickness_from_layer_center long_name = layer_thickness @@ -317,6 +318,7 @@ type = real kind = kind_phys intent = inout + optional = True [deltaP] standard_name = layer_thickness_in_Pa long_name = layer_thickness_in_Pa @@ -325,6 +327,7 @@ type = real kind = kind_phys intent = inout + optional = True [top_at_1] standard_name = flag_for_vertical_ordering_in_radiation long_name = flag for vertical ordering in radiation @@ -354,6 +357,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsfg] standard_name = surface_ground_temperature_for_radiation long_name = surface ground temperature for radiation @@ -362,6 +366,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsfa] standard_name = surface_air_temperature_for_radiation long_name = lowest model layer air temperature for radiation @@ -378,6 +383,7 @@ type = real kind = kind_phys intent = inout + optional = True [relhum] standard_name = relative_humidity long_name = layer relative humidity @@ -386,6 +392,7 @@ type = real kind = kind_phys intent = inout + optional = True [qs_lay] standard_name = saturation_vapor_pressure long_name = saturation vapor pressure @@ -394,6 +401,7 @@ type = real kind = kind_phys intent = inout + optional = True [q_lay] standard_name = water_vapor_mixing_ratio long_name = water vaport mixing ratio @@ -402,6 +410,7 @@ type = real kind = kind_phys intent = inout + optional = True [vmr_o2] standard_name = volume_mixing_ratio_for_o2 long_name = molar mixing ratio of o2 in with respect to dry air @@ -410,6 +419,7 @@ type = real kind = kind_phys intent = inout + optional = True [vmr_h2o] standard_name = volume_mixing_ratio_for_h2o long_name = molar mixing ratio of h2o in with respect to dry air @@ -418,6 +428,7 @@ type = real kind = kind_phys intent = inout + optional = True [vmr_o3] standard_name = volume_mixing_ratio_for_o3 long_name = molar mixing ratio of o3 in with respect to dry air @@ -426,6 +437,7 @@ type = real kind = kind_phys intent = inout + optional = True [vmr_ch4] standard_name = volume_mixing_ratio_for_ch4 long_name = molar mixing ratio of ch4 in with respect to dry air @@ -434,6 +446,7 @@ type = real kind = kind_phys intent = inout + optional = True [vmr_n2o] standard_name = volume_mixing_ratio_for_n2o long_name = molar mixing ratio of n2o in with respect to dry air @@ -442,6 +455,7 @@ type = real kind = kind_phys intent = inout + optional = True [vmr_co2] standard_name = volume_mixing_ratio_for_co2 long_name = molar mixing ratio of co2 in with respect to dry air @@ -450,6 +464,7 @@ type = real kind = kind_phys intent = inout + optional = True [active_gases_array] standard_name = list_of_active_gases_used_by_RRTMGP long_name = list of active gases used by RRTMGP diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.meta index 6c55a09de..904030522 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.meta @@ -148,6 +148,7 @@ type = real kind = kind_phys intent = in + optional = True [vfact_ca] standard_name = cellular_automata_vertical_weight long_name = vertical weight for ca @@ -172,6 +173,7 @@ type = real kind = kind_phys intent = inout + optional = True [skebu_wts] standard_name = skeb_x_wind_weights_from_coupled_process long_name = weights for stochastic skeb perturbation of x wind @@ -180,6 +182,7 @@ type = real kind = kind_phys intent = in + optional = True [skebv_wts] standard_name = skeb_y_wind_weights_from_coupled_process long_name = weights for stochastic skeb perturbation of y wind @@ -188,6 +191,7 @@ type = real kind = kind_phys intent = in + optional = True [shum_wts] standard_name = shum_weights_from_coupled_process long_name = weights for stochastic shum perturbation @@ -196,6 +200,7 @@ type = real kind = kind_phys intent = in + optional = True [diss_est] standard_name = dissipation_estimate_of_air_temperature_at_model_layers long_name = dissipation estimate model layer mean temperature @@ -316,6 +321,7 @@ type = real kind = kind_phys intent = inout + optional = True [gq0_cw] standard_name = cloud_liquid_water_mixing_ratio_of_new_state long_name = cloud condensed water mixing ratio updated by physics @@ -434,6 +440,7 @@ type = real kind = kind_phys intent = inout + optional = True [snow_cpl] standard_name = cumulative_lwe_thickness_of_snow_amount_for_coupling long_name = total snow precipitation @@ -442,6 +449,7 @@ type = real kind = kind_phys intent = inout + optional = True [drain_cpl] standard_name = tendency_of_lwe_thickness_of_rain_amount_on_dynamics_timestep_for_coupling long_name = change in rain_cpl (coupling_type) @@ -450,6 +458,7 @@ type = real kind = kind_phys intent = in + optional = True [dsnow_cpl] standard_name = tendency_of_lwe_thickness_of_snowfall_amount_on_dynamics_timestep_for_coupling long_name = change in show_cpl (coupling_type) @@ -458,6 +467,7 @@ type = real kind = kind_phys intent = in + optional = True [ntcw] standard_name = index_of_cloud_liquid_water_mixing_ratio_in_tracer_concentration_array long_name = tracer index for cloud condensate (or liquid water) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta index de4db5f9f..b89fc025f 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta @@ -148,6 +148,7 @@ type = real kind = kind_phys intent = in + optional = True [lwhd] standard_name = tendency_of_air_temperature_due_to_integrated_dynamics_through_earths_atmosphere long_name = idea sky lw heating rates @@ -291,6 +292,7 @@ type = real kind = kind_phys intent = in + optional = True [adjsfculw] standard_name = surface_upwelling_longwave_flux long_name = surface upwelling longwave flux at current time @@ -362,6 +364,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_longwave] standard_name = index_of_longwave_heating_process_in_cumulative_change_index long_name = index of longwave heating process in second dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta index 22f57e354..53bfc962e 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta @@ -244,6 +244,7 @@ type = real kind = kind_phys intent = inout + optional = True [sigmaout] standard_name = updraft_area_fraction_updated_by_physics long_name = convective updraft area fraction updated by physics @@ -252,6 +253,7 @@ type = real kind = kind_phys intent = inout + optional = True [qmicro] standard_name = instantaneous_tendency_of_specific_humidity_due_to_microphysics long_name = moisture tendency due to microphysics @@ -260,6 +262,7 @@ type = real kind = kind_phys intent = out + optional = True [imp_physics] standard_name = control_for_microphysics_scheme long_name = choice of microphysics scheme @@ -355,6 +358,7 @@ type = real kind = kind_phys intent = in + optional = True [rhcpbl] standard_name = critical_relative_humidity_at_PBL_top long_name = critical relative humidity at the PBL top @@ -363,6 +367,7 @@ type = real kind = kind_phys intent = in + optional = True [rhctop] standard_name = critical_relative_humidity_at_toa long_name = critical relative humidity at the top of atmosphere @@ -371,6 +376,7 @@ type = real kind = kind_phys intent = in + optional = True [rhcmax] standard_name = max_critical_relative_humidity long_name = maximum critical relative humidity @@ -379,6 +385,7 @@ type = real kind = kind_phys intent = in + optional = True [islmsk] standard_name = sea_land_ice_mask long_name = sea/land/ice mask (=0/1/2) @@ -446,6 +453,7 @@ type = real kind = kind_phys intent = inout + optional = True [save_qc] standard_name = cloud_condensed_water_mixing_ratio_save long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) before entering a physics scheme @@ -528,6 +536,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta index c0df52f1a..a48a84f12 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta @@ -136,6 +136,7 @@ dimensions = () type = integer intent = in + optional = True [imp_physics] standard_name = control_for_microphysics_scheme long_name = choice of microphysics scheme @@ -311,6 +312,7 @@ type = real kind = kind_phys intent = in + optional = True [spechum] standard_name = specific_humidity long_name = water vapor specific humidity @@ -326,6 +328,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [dtend] standard_name = cumulative_change_of_state_variables long_name = diagnostic tendencies for state variables @@ -334,6 +337,7 @@ type = real kind = kind_phys intent = inout + optional = True [ntk] standard_name = index_for_turbulent_kinetic_energy_convective_transport_tracer long_name = index for turbulent kinetic energy in the convectively transported tracer array diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta index 608ee83da..f2f5d2281 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.meta @@ -245,6 +245,7 @@ type = real kind = kind_phys intent = inout + optional = True [do3_dt_ozmx] standard_name = ozone_tendency_due_to_ozone_mixing_ratio long_name = ozone tendency due to ozone mixing ratio @@ -253,6 +254,7 @@ type = real kind = kind_phys intent = inout + optional = True [do3_dt_temp] standard_name = ozone_tendency_due_to_temperature long_name = ozone tendency due to temperature @@ -261,6 +263,7 @@ type = real kind = kind_phys intent = inout + optional = True [do3_dt_ohoz] standard_name = ozone_tendency_due_to_overhead_ozone_column long_name = ozone tendency due to overhead ozone column @@ -269,6 +272,7 @@ type = real kind = kind_phys intent = inout + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta index 7224d7221..d21892c75 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta @@ -768,6 +768,7 @@ type = real kind = kind_phys intent = in + optional = True [evap_lnd] standard_name = kinematic_surface_upward_latent_heat_flux_over_land long_name = kinematic surface upward latent heat flux over land @@ -776,6 +777,7 @@ type = real kind = kind_phys intent = in + optional = True [evap_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice long_name = kinematic surface upward latent heat flux over ice @@ -784,6 +786,7 @@ type = real kind = kind_phys intent = in + optional = True [hflx] standard_name = surface_upward_temperature_flux long_name = kinematic surface upward sensible heat flux diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.meta index 2c28b17d7..2c8ae74c0 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.meta @@ -448,6 +448,7 @@ type = real kind = kind_phys intent = in + optional = True [epi] standard_name = instantaneous_surface_potential_evaporation long_name = instantaneous sfc potential evaporation @@ -504,6 +505,7 @@ type = real kind = kind_phys intent = inout + optional = True [dswsfci_cpl] standard_name = surface_downwelling_shortwave_flux_for_coupling long_name = instantaneous sfc downward sw flux @@ -512,6 +514,7 @@ type = real kind = kind_phys intent = inout + optional = True [dlwsfc_cpl] standard_name = cumulative_surface_downwelling_longwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc downward lw flux mulitplied by timestep @@ -520,6 +523,7 @@ type = real kind = kind_phys intent = inout + optional = True [dswsfc_cpl] standard_name = cumulative_surface_downwelling_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc downward sw flux multiplied by timestep @@ -528,6 +532,7 @@ type = real kind = kind_phys intent = inout + optional = True [dnirbmi_cpl] standard_name = surface_downwelling_direct_nir_shortwave_flux_for_coupling long_name = instantaneous sfc nir beam downward sw flux @@ -536,6 +541,7 @@ type = real kind = kind_phys intent = inout + optional = True [dnirdfi_cpl] standard_name = surface_downwelling_diffuse_nir_shortwave_flux_for_coupling long_name = instantaneous sfc nir diff downward sw flux @@ -544,6 +550,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvisbmi_cpl] standard_name = surface_downwelling_direct_uv_and_vis_shortwave_flux_for_coupling long_name = instantaneous sfc uv+vis beam downward sw flux @@ -552,6 +559,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvisdfi_cpl] standard_name = surface_downwelling_diffuse_uv_and_vis_shortwave_flux_for_coupling long_name = instantaneous sfc uv+vis diff downward sw flux @@ -560,6 +568,7 @@ type = real kind = kind_phys intent = inout + optional = True [dnirbm_cpl] standard_name = cumulative_surface_downwelling_direct_nir_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc nir beam downward sw flux multiplied by timestep @@ -568,6 +577,7 @@ type = real kind = kind_phys intent = inout + optional = True [dnirdf_cpl] standard_name = cumulative_surface_downwelling_diffuse_nir_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc nir diff downward sw flux multiplied by timestep @@ -576,6 +586,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvisbm_cpl] standard_name = cumulative_surface_downwelling_direct_uv_and_vis_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc uv+vis beam dnwd sw flux multiplied by timestep @@ -584,6 +595,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvisdf_cpl] standard_name = cumulative_surface_downwelling_diffuse_uv_and_vis_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc uv+vis diff dnwd sw flux multiplied by timestep @@ -592,6 +604,7 @@ type = real kind = kind_phys intent = inout + optional = True [nlwsfci_cpl] standard_name = surface_net_downwelling_longwave_flux_for_coupling long_name = instantaneous net sfc downward lw flux @@ -600,6 +613,7 @@ type = real kind = kind_phys intent = inout + optional = True [nlwsfc_cpl] standard_name = cumulative_surface_net_downwelling_longwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative net downward lw flux multiplied by timestep @@ -608,6 +622,7 @@ type = real kind = kind_phys intent = inout + optional = True [t2mi_cpl] standard_name = temperature_at_2m_for_coupling long_name = instantaneous T2m @@ -616,6 +631,7 @@ type = real kind = kind_phys intent = inout + optional = True [q2mi_cpl] standard_name = specific_humidity_at_2m_for_coupling long_name = instantaneous Q2m @@ -624,6 +640,7 @@ type = real kind = kind_phys intent = inout + optional = True [u10mi_cpl] standard_name = x_wind_at_10m_for_coupling long_name = instantaneous U10m @@ -632,6 +649,7 @@ type = real kind = kind_phys intent = inout + optional = True [v10mi_cpl] standard_name = y_wind_at_10m_for_coupling long_name = instantaneous V10m @@ -640,6 +658,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsfci_cpl] standard_name = surface_skin_temperature_for_coupling long_name = instantaneous sfc temperature @@ -648,6 +667,7 @@ type = real kind = kind_phys intent = inout + optional = True [psurfi_cpl] standard_name = surface_air_pressure_for_coupling long_name = instantaneous sfc pressure @@ -656,6 +676,7 @@ type = real kind = kind_phys intent = inout + optional = True [nnirbmi_cpl] standard_name = surface_net_downwelling_direct_nir_shortwave_flux_for_coupling long_name = instantaneous net nir beam sfc downward sw flux @@ -664,6 +685,7 @@ type = real kind = kind_phys intent = inout + optional = True [nnirdfi_cpl] standard_name = surface_net_downwelling_diffuse_nir_shortwave_flux_for_coupling long_name = instantaneous net nir diff sfc downward sw flux @@ -672,6 +694,7 @@ type = real kind = kind_phys intent = inout + optional = True [nvisbmi_cpl] standard_name = surface_net_downwelling_direct_uv_and_vis_shortwave_flux_for_coupling long_name = instantaneous net uv+vis beam downward sw flux @@ -680,6 +703,7 @@ type = real kind = kind_phys intent = inout + optional = True [nvisdfi_cpl] standard_name = surface_net_downwelling_diffuse_uv_and_vis_shortwave_flux_for_coupling long_name = instantaneous net uv+vis diff downward sw flux @@ -688,6 +712,7 @@ type = real kind = kind_phys intent = inout + optional = True [nswsfci_cpl] standard_name = surface_net_downwelling_shortwave_flux_for_coupling long_name = instantaneous net sfc downward sw flux @@ -696,6 +721,7 @@ type = real kind = kind_phys intent = inout + optional = True [nswsfc_cpl] standard_name = cumulative_surface_net_downwelling_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative net downward sw flux multiplied by timestep @@ -704,6 +730,7 @@ type = real kind = kind_phys intent = inout + optional = True [nnirbm_cpl] standard_name = cumulative_surface_net_downwelling_direct_nir_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative net nir beam downward sw flux multiplied by timestep @@ -712,6 +739,7 @@ type = real kind = kind_phys intent = inout + optional = True [nnirdf_cpl] standard_name = cumulative_surface_net_downwellling_diffuse_nir_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative net nir diff downward sw flux multiplied by timestep @@ -720,6 +748,7 @@ type = real kind = kind_phys intent = inout + optional = True [nvisbm_cpl] standard_name = cumulative_surface_net_downwelling_direct_uv_and_vis_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative net uv+vis beam downward sw rad flux multiplied by timestep @@ -728,6 +757,7 @@ type = real kind = kind_phys intent = inout + optional = True [nvisdf_cpl] standard_name = cumulative_surface_net_downwelling_diffuse_uv_and_vis_shortwave_flux_for_coupling_multiplied_by_timestep long_name = cumulative net uv+vis diff downward sw rad flux multiplied by timestep @@ -736,6 +766,7 @@ type = real kind = kind_phys intent = inout + optional = True [gflux] standard_name = cumulative_surface_ground_heat_flux_multiplied_by_timestep long_name = cumulative groud conductive heat flux multiplied by timestep @@ -800,6 +831,7 @@ type = real kind = kind_phys intent = inout + optional = True [ep] standard_name = cumulative_surface_upward_potential_latent_heat_flux_multiplied_by_timestep long_name = cumulative surface upward potential latent heat flux multiplied by timestep @@ -840,6 +872,7 @@ type = real kind = kind_phys intent = in + optional = True [runoff] standard_name = total_runoff long_name = total water runoff @@ -904,6 +937,7 @@ type = real kind = kind_phys intent = inout + optional = True [lheatstrg] standard_name = flag_for_canopy_heat_storage_in_land_surface_scheme long_name = flag for canopy heat storage parameterization diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta index 2b21c606d..b04aabea0 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta @@ -312,6 +312,7 @@ type = real kind = kind_phys intent = in + optional = True [lndp_var_list] standard_name = land_surface_perturbation_variables long_name = variables to be perturbed for landperts @@ -320,6 +321,7 @@ type = character kind = len=3 intent = in + optional = True [lndp_prt_list] standard_name =land_surface_perturbation_magnitudes long_name = magnitude of perturbations for landperts @@ -328,6 +330,7 @@ type = real kind = kind_phys intent = in + optional = True [z01d] standard_name = perturbation_of_momentum_roughness_length long_name = perturbation of momentum roughness length @@ -360,6 +363,7 @@ type = real kind = kind_phys intent = out + optional = True [vegf1d] standard_name = perturbation_of_vegetation_fraction long_name = perturbation of vegetation fraction @@ -405,6 +409,7 @@ type = real kind = kind_phys intent = in + optional = True [wind] standard_name = wind_speed_at_lowest_model_layer long_name = wind speed at lowest model level @@ -437,6 +442,7 @@ type = real kind = kind_phys intent = inout + optional = True [smcwlt2] standard_name = volume_fraction_of_condensed_water_in_soil_at_wilting_point long_name = wilting point (volumetric) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta index bbf161eb5..66c205f6e 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta @@ -91,6 +91,7 @@ type = real kind = kind_phys intent = inout + optional = True [cvb] standard_name = pressure_at_convective_cloud_base_between_sw_radiation_calls_from_cnvc90 long_name = pressure at bottom of convective cloud diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta index 6f8a0eda0..a8a74ff74 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta @@ -399,6 +399,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxlwUP_jac] standard_name = RRTMGP_jacobian_of_lw_flux_upward long_name = RRTMGP Jacobian upward longwave flux profile @@ -476,6 +477,7 @@ type = real kind = kind_phys intent = in + optional = True [dtdt] standard_name = process_split_cumulative_tendency_of_air_temperature long_name = total radiative heating rate at current time @@ -492,6 +494,7 @@ type = real kind = kind_phys intent = inout + optional = True [htrlw] standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_timestep long_name = total sky longwave heating rate on physics time step @@ -500,6 +503,7 @@ type = real kind = kind_phys intent = inout + optional = True [adjsfcdsw] standard_name = surface_downwelling_shortwave_flux long_name = surface downwelling shortwave flux at current time diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta index 5d18bd9bd..73ad1a0e5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta @@ -206,6 +206,7 @@ type = real kind = kind_phys intent = inout + optional = True [rh02min] standard_name = minimum_relative_humidity_at_2m_over_maximum_hourly_time_interval long_name = minumum relative humidity at 2m over maximum hourly time interval @@ -214,6 +215,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtp] standard_name = timestep_for_physics long_name = physics timestep @@ -246,6 +248,7 @@ type = real kind = kind_phys intent = in + optional = True [qgraupel] standard_name = graupel_mixing_ratio long_name = ratio of mass of graupel to mass of dry air plus vapor (without condensates) @@ -301,6 +304,7 @@ type = real kind = kind_phys intent = inout + optional = True [ltg2_max] standard_name = lightning_threat_index_2 long_name = lightning threat index 2 @@ -309,6 +313,7 @@ type = real kind = kind_phys intent = inout + optional = True [ltg3_max] standard_name = lightning_threat_index_3 long_name = lightning threat index 3 @@ -317,6 +322,7 @@ type = real kind = kind_phys intent = inout + optional = True [prsi] standard_name = air_pressure_at_interface long_name = air pressure at model layer interfaces diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta index a9635efa5..e73fc668e 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta @@ -221,6 +221,7 @@ type = real kind = kind_phys intent = in + optional = True [qci_conv] standard_name = convective_cloud_condesate_after_rainout long_name = convective cloud condesate after rainout @@ -229,6 +230,7 @@ type = real kind = kind_phys intent = inout + optional = True [qlc] standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array @@ -305,6 +307,7 @@ type = real kind = kind_phys intent = in + optional = True [QI_BL] standard_name = subgrid_scale_cloud_ice_mixing_ratio long_name = subgrid cloud ice mixing ratio from PBL scheme @@ -313,6 +316,7 @@ type = real kind = kind_phys intent = in + optional = True [CLDFRA_BL] standard_name = subgrid_scale_cloud_area_fraction_in_atmosphere_layer long_name = subgrid cloud fraction from PBL scheme @@ -321,6 +325,7 @@ type = real kind = kind_phys intent = in + optional = True [delp] standard_name = layer_pressure_thickness_for_radiation long_name = layer pressure thickness on radiation levels @@ -424,6 +429,7 @@ type = real kind = kind_phys intent = in + optional = True [de_lgth] standard_name = cloud_decorrelation_length long_name = cloud decorrelation length diff --git a/physics/MP/Ferrier_Aligo/mp_fer_hires.meta b/physics/MP/Ferrier_Aligo/mp_fer_hires.meta index e6d2afc5b..636edf945 100644 --- a/physics/MP/Ferrier_Aligo/mp_fer_hires.meta +++ b/physics/MP/Ferrier_Aligo/mp_fer_hires.meta @@ -279,6 +279,7 @@ type = real kind = kind_phys intent = in + optional = True [dx] standard_name = characteristic_grid_lengthscale long_name = relative dx for the grid cell diff --git a/physics/MP/GFDL/fv_sat_adj.meta b/physics/MP/GFDL/fv_sat_adj.meta index c91e438b7..fbcb57c76 100644 --- a/physics/MP/GFDL/fv_sat_adj.meta +++ b/physics/MP/GFDL/fv_sat_adj.meta @@ -340,6 +340,7 @@ type = real kind = kind_dyn intent = inout + optional = True [pkz] standard_name = finite_volume_mean_edge_pressure_raised_to_the_power_of_kappa long_name = finite-volume mean edge pressure in Pa raised to the power of kappa diff --git a/physics/MP/GFDL/gfdl_cloud_microphys.meta b/physics/MP/GFDL/gfdl_cloud_microphys.meta index 719a340e5..f4233ac46 100644 --- a/physics/MP/GFDL/gfdl_cloud_microphys.meta +++ b/physics/MP/GFDL/gfdl_cloud_microphys.meta @@ -38,6 +38,7 @@ type = character kind = len=* intent = in + optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile @@ -311,6 +312,7 @@ type = real kind = kind_phys intent = out + optional = True [ice0] standard_name = lwe_thickness_of_ice_amount long_name = ice fall on physics timestep @@ -319,6 +321,7 @@ type = real kind = kind_phys intent = out + optional = True [snow0] standard_name = lwe_thickness_of_snow_amount long_name = snow fall on physics timestep @@ -327,6 +330,7 @@ type = real kind = kind_phys intent = out + optional = True [graupel0] standard_name = lwe_thickness_of_graupel_amount long_name = graupel fall on physics timestep @@ -335,6 +339,7 @@ type = real kind = kind_phys intent = out + optional = True [prcp0] standard_name = lwe_thickness_of_explicit_precipitation_amount long_name = explicit precipitation (rain, ice, snow, graupel) on physics timestep @@ -410,6 +415,7 @@ type = real kind = kind_phys intent = inout + optional = True [rei] standard_name = effective_radius_of_stratiform_cloud_ice_particle long_name = eff. radius of cloud ice water particle in micrometer @@ -418,6 +424,7 @@ type = real kind = kind_phys intent = inout + optional = True [rer] standard_name = effective_radius_of_stratiform_cloud_rain_particle long_name = effective radius of cloud rain particle in micrometers @@ -426,6 +433,7 @@ type = real kind = kind_phys intent = inout + optional = True [res] standard_name = effective_radius_of_stratiform_cloud_snow_particle long_name = effective radius of cloud snow particle in micrometers @@ -434,6 +442,7 @@ type = real kind = kind_phys intent = inout + optional = True [reg] standard_name = effective_radius_of_stratiform_cloud_graupel_particle long_name = eff. radius of cloud graupel particle in micrometer @@ -442,6 +451,7 @@ type = real kind = kind_phys intent = inout + optional = True [cplchm] standard_name = flag_for_chemistry_coupling long_name = flag controlling cplchm collection (default off) @@ -457,6 +467,7 @@ type = real kind = kind_phys intent = inout + optional = True [pfl_lsan] standard_name = liquid_flux_due_to_large_scale_precipitation long_name = instantaneous 3D flux of liquid water from nonconvective precipitation @@ -465,6 +476,7 @@ type = real kind = kind_phys intent = inout + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/MP/Morrison_Gettelman/m_micro.meta b/physics/MP/Morrison_Gettelman/m_micro.meta index 16efc5cc4..cfdda96e8 100644 --- a/physics/MP/Morrison_Gettelman/m_micro.meta +++ b/physics/MP/Morrison_Gettelman/m_micro.meta @@ -158,6 +158,7 @@ type = real kind = kind_phys intent = in + optional = True [microp_uniform] standard_name = flag_for_uniform_subcolumns long_name = flag for uniform subcolumns for MG microphysics @@ -395,6 +396,7 @@ type = real kind = kind_phys intent = in + optional = True [qils_i] standard_name = ice_water_mixing_ratio_convective_transport_tracer long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array @@ -411,6 +413,7 @@ type = real kind = kind_phys intent = in + optional = True [lwheat_i] standard_name = tendency_of_air_temperature_due_to_longwave_heating_on_radiation_timestep long_name = total sky lw heating rate @@ -435,6 +438,7 @@ type = real kind = kind_phys intent = in + optional = True [cf_upi] standard_name = convective_cloud_fraction_for_microphysics long_name = convective cloud fraction for microphysics @@ -443,6 +447,7 @@ type = real kind = kind_phys intent = in + optional = True [frland] standard_name = land_area_fraction_for_microphysics long_name = land area fraction used in microphysics schemes @@ -459,6 +464,7 @@ type = real kind = kind_phys intent = in + optional = True [cnv_mfd_i] standard_name = detrained_mass_flux long_name = detrained mass flux @@ -467,6 +473,7 @@ type = real kind = kind_phys intent = in + optional = True [cnv_dqldt_i] standard_name = tendency_of_cloud_water_due_to_convective_microphysics long_name = tendency of cloud water due to convective microphysics @@ -475,6 +482,7 @@ type = real kind = kind_phys intent = in + optional = True [clcn_i] standard_name = convective_cloud_volume_fraction long_name = convective cloud volume fraction @@ -483,6 +491,7 @@ type = real kind = kind_phys intent = in + optional = True [u_i] standard_name = x_wind_of_new_state long_name = zonal wind updated by physics @@ -539,6 +548,7 @@ type = real kind = kind_phys intent = in + optional = True [cnv_ndrop_i] standard_name = number_concentration_of_cloud_liquid_water_particles_for_detrainment long_name = droplet number concentration in convective detrainment @@ -547,6 +557,7 @@ type = real kind = kind_phys intent = in + optional = True [cnv_nice_i] standard_name = number_concentration_of_ice_crystals_for_detrainment long_name = crystal number concentration in convective detrainment @@ -555,6 +566,7 @@ type = real kind = kind_phys intent = in + optional = True [q_io] standard_name = specific_humidity_of_new_state long_name = water vapor specific humidity updated by physics @@ -611,6 +623,7 @@ type = real kind = kind_phys intent = inout + optional = True [ncpi_io] standard_name = mass_number_concentration_of_cloud_ice_water_crystals_in_air_of_new_state long_name = number concentration of ice updated by physics @@ -697,6 +710,7 @@ type = real kind = kind_phys intent = out + optional = True [cldreffi] standard_name = effective_radius_of_stratiform_cloud_ice_particle long_name = effective radius of cloud ice water particle in micrometers @@ -705,6 +719,7 @@ type = real kind = kind_phys intent = out + optional = True [cldreffr] standard_name = effective_radius_of_stratiform_cloud_rain_particle long_name = effective radius of cloud rain particle in micrometers @@ -713,6 +728,7 @@ type = real kind = kind_phys intent = out + optional = True [cldreffs] standard_name = effective_radius_of_stratiform_cloud_snow_particle long_name = effective radius of cloud snow particle in micrometers @@ -721,6 +737,7 @@ type = real kind = kind_phys intent = out + optional = True [cldreffg] standard_name = effective_radius_of_stratiform_cloud_graupel_particle long_name = effective radius of cloud graupel particle in micrometers @@ -729,6 +746,7 @@ type = real kind = kind_phys intent = out + optional = True [ntrcaer] standard_name = number_of_aerosol_tracers_MG long_name = number of aerosol tracers for Morrison Gettelman MP @@ -828,6 +846,7 @@ type = real kind = kind_phys intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/MP/Morrison_Gettelman/m_micro_post.meta b/physics/MP/Morrison_Gettelman/m_micro_post.meta index 88a4325e7..922dadc15 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_post.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_post.meta @@ -148,6 +148,7 @@ type = real kind = kind_phys intent = out + optional = True [snow] standard_name = lwe_thickness_of_snow_amount_on_dynamics_timestep long_name = snow fall at this time step @@ -156,6 +157,7 @@ type = real kind = kind_phys intent = out + optional = True [graupel] standard_name = lwe_thickness_of_graupel_amount_on_dynamics_timestep long_name = graupel fall at this time step @@ -164,6 +166,7 @@ type = real kind = kind_phys intent = out + optional = True [dtp] standard_name = timestep_for_physics long_name = physics timestep diff --git a/physics/MP/Morrison_Gettelman/m_micro_pre.meta b/physics/MP/Morrison_Gettelman/m_micro_pre.meta index b8cd2ac32..f552e14af 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_pre.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_pre.meta @@ -241,6 +241,7 @@ type = real kind = kind_phys intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/MP/NSSL/mp_nssl.meta b/physics/MP/NSSL/mp_nssl.meta index deb96569d..dce294582 100644 --- a/physics/MP/NSSL/mp_nssl.meta +++ b/physics/MP/NSSL/mp_nssl.meta @@ -118,6 +118,7 @@ type = real kind = kind_phys intent = inout + optional = True [crw] standard_name = mass_number_concentration_of_rain_water_in_air long_name = rain number concentration @@ -158,6 +159,7 @@ type = real kind = kind_phys intent = inout + optional = True [con_g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -409,6 +411,7 @@ type = real kind = kind_phys intent = inout + optional = True [cccn] standard_name = cloud_condensation_nuclei_number_concentration_of_new_state long_name = number concentration of cloud condensation nuclei updated by physics @@ -417,6 +420,7 @@ type = real kind = kind_phys intent = inout + optional = True [cccna] standard_name = activated_cloud_condensation_nuclei_number_concentration_of_new_state long_name = number concentration of activated cloud condensation nuclei updated by physics @@ -425,6 +429,7 @@ type = real kind = kind_phys intent = inout + optional = True [ccw] standard_name = mass_number_concentration_of_cloud_liquid_water_particles_in_air_of_new_state long_name = cloud droplet number concentration @@ -433,6 +438,7 @@ type = real kind = kind_phys intent = inout + optional = True [crw] standard_name = mass_number_concentration_of_rain_of_new_state long_name = rain number concentration @@ -473,6 +479,7 @@ type = real kind = kind_phys intent = inout + optional = True [vh] standard_name = graupel_volume_of_new_state long_name = graupel particle volume @@ -481,6 +488,7 @@ type = real kind = kind_phys intent = inout + optional = True [vhl] standard_name = hail_volume_of_new_state long_name = hail particle volume @@ -489,6 +497,7 @@ type = real kind = kind_phys intent = inout + optional = True [zrw] standard_name = reflectivity_of_rain_of_new_state long_name = rain reflectivity @@ -497,6 +506,7 @@ type = real kind = kind_phys intent = inout + optional = True [zhw] standard_name = reflectivity_of_graupel_of_new_state long_name = graupel reflectivity @@ -505,6 +515,7 @@ type = real kind = kind_phys intent = inout + optional = True [zhl] standard_name = reflectivity_of_hail_of_new_state long_name = hail reflectivity @@ -513,6 +524,7 @@ type = real kind = kind_phys intent = inout + optional = True [tgrs] standard_name = air_temperature_of_new_state long_name = model layer mean temperature @@ -577,6 +589,7 @@ type = real kind = kind_phys intent = inout + optional = True [graupel] standard_name = lwe_thickness_of_graupel_amount long_name = graupel fall on physics timestep @@ -585,6 +598,7 @@ type = real kind = kind_phys intent = inout + optional = True [ice] standard_name = lwe_thickness_of_ice_amount long_name = ice fall on physics timestep @@ -593,6 +607,7 @@ type = real kind = kind_phys intent = inout + optional = True [snow] standard_name = lwe_thickness_of_snow_amount long_name = snow fall on physics timestep @@ -601,6 +616,7 @@ type = real kind = kind_phys intent = inout + optional = True [sr] standard_name = ratio_of_snowfall_to_rainfall long_name = ratio of snowfall to large-scale rainfall @@ -646,6 +662,7 @@ type = real kind = kind_phys intent = inout + optional = True [re_ice] standard_name = effective_radius_of_stratiform_cloud_ice_particle long_name = eff. radius of cloud ice water particle in micrometer @@ -654,6 +671,7 @@ type = real kind = kind_phys intent = inout + optional = True [re_snow] standard_name = effective_radius_of_stratiform_cloud_snow_particle long_name = effective radius of cloud snow particle in micrometer @@ -662,6 +680,7 @@ type = real kind = kind_phys intent = inout + optional = True [re_rain] standard_name = effective_radius_of_stratiform_cloud_rain_particle long_name = effective radius of cloud rain particle in micrometers @@ -670,6 +689,7 @@ type = real kind = kind_phys intent = inout + optional = True [nleffr] standard_name = index_of_cloud_liquid_water_effective_radius_in_xyz_dimensioned_restart_array long_name = the index of cloud liquid water effective radius in phy_f3d @@ -754,6 +774,7 @@ dimensions = () type = integer intent = in + optional = True [ntccna] standard_name = index_of_activated_cloud_condensation_nuclei_number_concentration_in_tracer_concentration_array long_name = tracer index for activated cloud condensation nuclei number concentration @@ -761,6 +782,7 @@ dimensions = () type = integer intent = in + optional = True [errflg] standard_name = ccpp_error_code long_name = error code for error handling in CCPP diff --git a/physics/MP/Thompson/mp_thompson.meta b/physics/MP/Thompson/mp_thompson.meta index a9bf02210..39675f30d 100644 --- a/physics/MP/Thompson/mp_thompson.meta +++ b/physics/MP/Thompson/mp_thompson.meta @@ -276,6 +276,7 @@ type = real kind = kind_phys intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -427,6 +428,7 @@ type = real kind = kind_phys intent = inout + optional = True [nwfa] standard_name = mass_number_concentration_of_hygroscopic_aerosols_of_new_state long_name = number concentration of water-friendly aerosols @@ -435,6 +437,7 @@ type = real kind = kind_phys intent = inout + optional = True [nifa] standard_name = mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_of_new_state long_name = number concentration of ice-friendly aerosols @@ -443,6 +446,7 @@ type = real kind = kind_phys intent = inout + optional = True [nwfa2d] standard_name = tendency_of_hygroscopic_aerosols_at_surface_adjacent_layer long_name = instantaneous fake water-friendly surface aerosol source @@ -451,6 +455,7 @@ type = real kind = kind_phys intent = in + optional = True [nifa2d] standard_name = tendency_of_nonhygroscopic_ice_nucleating_aerosols_at_surface_adjacent_layer long_name = instantaneous fake ice-friendly surface aerosol source @@ -459,6 +464,7 @@ type = real kind = kind_phys intent = in + optional = True [aero_ind_fdb] standard_name = do_smoke_aerosol_indirect_feedback long_name = flag for wfa ifa emission indirect feedback @@ -572,6 +578,7 @@ type = real kind = kind_phys intent = inout + optional = True [graupel] standard_name = lwe_thickness_of_graupel_amount long_name = graupel fall on physics timestep @@ -580,6 +587,7 @@ type = real kind = kind_phys intent = inout + optional = True [ice] standard_name = lwe_thickness_of_ice_amount long_name = ice fall on physics timestep @@ -588,6 +596,7 @@ type = real kind = kind_phys intent = inout + optional = True [snow] standard_name = lwe_thickness_of_snow_amount long_name = snow fall on physics timestep @@ -596,6 +605,7 @@ type = real kind = kind_phys intent = inout + optional = True [sr] standard_name = ratio_of_snowfall_to_rainfall long_name = ratio of snowfall to large-scale rainfall @@ -685,6 +695,7 @@ type = real kind = kind_phys intent = inout + optional = True [reset_diag3d] standard_name = flag_reset_extended_diagnostics_output_arrays_from_thompson_microphysics long_name = flag for resetting extended diagnostics output arrays from thompson microphysics @@ -699,6 +710,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension) type = real intent = in + optional = True [spp_mp] standard_name = control_for_microphysics_spp_perturbations long_name = control for microphysics spp perturbations @@ -713,6 +725,7 @@ dimensions = () type = integer intent = in + optional = True [spp_prt_list] standard_name = magnitude_of_spp_perturbations long_name = magnitude of spp perturbations @@ -721,6 +734,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_stddev_cutoff] standard_name = magnitude_of_spp_standard_deviation_cutoff long_name = magnitude of spp standard deviation cutoff @@ -729,6 +743,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_var_list] standard_name = perturbed_spp_schemes long_name = perturbed spp schemes @@ -737,6 +752,7 @@ type = character kind = len=10 intent = in + optional = True [cplchm] standard_name = flag_for_chemistry_coupling long_name = flag controlling cplchm collection (default off) @@ -752,6 +768,7 @@ type = real kind = kind_phys intent = inout + optional = True [pfl_lsan] standard_name = liquid_flux_due_to_large_scale_precipitation long_name = instantaneous 3D flux of liquid water from nonconvective precipitation @@ -760,6 +777,7 @@ type = real kind = kind_phys intent = inout + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/MP/Zhao_Carr/zhaocarr_gscond.meta b/physics/MP/Zhao_Carr/zhaocarr_gscond.meta index ed57ca909..5f07f3561 100644 --- a/physics/MP/Zhao_Carr/zhaocarr_gscond.meta +++ b/physics/MP/Zhao_Carr/zhaocarr_gscond.meta @@ -141,6 +141,7 @@ type = real kind = kind_phys intent = inout + optional = True [qp] standard_name = specific_humidity_two_timesteps_back long_name = water vapor specific humidity two timesteps back @@ -149,6 +150,7 @@ type = real kind = kind_phys intent = inout + optional = True [psp] standard_name = surface_air_pressure_two_timesteps_back long_name = surface air pressure two timesteps back @@ -157,6 +159,7 @@ type = real kind = kind_phys intent = inout + optional = True [psat] standard_name = saturation_pressure_at_triple_point_of_water long_name = saturation pressure at triple point of water @@ -245,6 +248,7 @@ type = real kind = kind_phys intent = inout + optional = True [qp1] standard_name = specific_humidity_on_previous_timestep_in_xyz_dimensioned_restart_array long_name = water vapor specific humidity at previous timestep @@ -253,6 +257,7 @@ type = real kind = kind_phys intent = inout + optional = True [psp1] standard_name = surface_air_pressure_on_previous_timestep long_name = surface air surface pressure at previous timestep @@ -261,6 +266,7 @@ type = real kind = kind_phys intent = inout + optional = True [u] standard_name = critical_relative_humidity long_name = critical relative humidity @@ -269,6 +275,7 @@ type = real kind = kind_phys intent = in + optional = True [lprnt] standard_name = flag_print long_name = flag for printing diagnostics to output diff --git a/physics/MP/Zhao_Carr/zhaocarr_precpd.meta b/physics/MP/Zhao_Carr/zhaocarr_precpd.meta index 86e6c7d67..c82d8e040 100644 --- a/physics/MP/Zhao_Carr/zhaocarr_precpd.meta +++ b/physics/MP/Zhao_Carr/zhaocarr_precpd.meta @@ -198,6 +198,7 @@ type = real kind = kind_phys intent = in + optional = True [psautco] standard_name = autoconversion_to_snow_coefficient long_name = conversion coefficient from cloud ice to snow diff --git a/physics/PBL/HEDMF/hedmf.meta b/physics/PBL/HEDMF/hedmf.meta index a5c6d73d9..b872639d2 100644 --- a/physics/PBL/HEDMF/hedmf.meta +++ b/physics/PBL/HEDMF/hedmf.meta @@ -356,6 +356,7 @@ type = real kind = kind_phys intent = out + optional = True [hpbl] standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness @@ -364,6 +365,7 @@ type = real kind = kind_phys intent = out + optional = True [hgamt] standard_name = countergradient_mixing_term_for_temperature long_name = countergradient mixing term for temperature @@ -531,6 +533,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -538,6 +541,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_pbl] standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index diff --git a/physics/PBL/MYJ/myjpbl_wrapper.meta b/physics/PBL/MYJ/myjpbl_wrapper.meta index 281396eed..fa863b50a 100644 --- a/physics/PBL/MYJ/myjpbl_wrapper.meta +++ b/physics/PBL/MYJ/myjpbl_wrapper.meta @@ -342,6 +342,7 @@ type = real kind = kind_phys intent = out + optional = True [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = PBL top model level index @@ -500,6 +501,7 @@ type = real kind = kind_phys intent = out + optional = True [dkt] standard_name = atmosphere_heat_diffusivity long_name = atmospheric heat diffusivity @@ -601,6 +603,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta index 00589dfe5..c55d4fd54 100644 --- a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta +++ b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta @@ -320,6 +320,7 @@ type = real kind = kind_phys intent = in + optional = True [qgrs_cloud_ice_num_conc] standard_name = mass_number_concentration_of_cloud_ice_water_crystals_in_air long_name = number concentration of ice @@ -344,6 +345,7 @@ type = real kind = kind_phys intent = in + optional = True [qgrs_ice_aer_num_conc] standard_name = mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols long_name = number concentration of ice-friendly aerosols @@ -352,6 +354,7 @@ type = real kind = kind_phys intent = in + optional = True [qgrs_cccn] standard_name = cloud_condensation_nuclei_number_concentration long_name = number concentration of cloud condensation nuclei @@ -360,6 +363,7 @@ type = real kind = kind_phys intent = inout + optional = True [prsl] standard_name = air_pressure long_name = mean layer pressure @@ -480,6 +484,7 @@ type = real kind = kind_phys intent = out + optional = True [dusfc1] standard_name = instantaneous_surface_x_momentum_flux long_name = surface momentum flux in the x-direction valid for current call @@ -528,6 +533,7 @@ type = real kind = kind_phys intent = out + optional = True [dusfc_diag] standard_name = cumulative_surface_x_momentum_flux_for_diag_multiplied_by_timestep long_name = cumulative sfc x momentum flux multiplied by timestep @@ -560,6 +566,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_cice] standard_name = surface_x_momentum_flux_from_coupled_process long_name = sfc x momentum flux for coupling @@ -568,6 +575,7 @@ type = real kind = kind_phys intent = in + optional = True [dvsfc_cice] standard_name = surface_y_momentum_flux_from_coupled_process long_name = sfc y momentum flux for coupling @@ -576,6 +584,7 @@ type = real kind = kind_phys intent = in + optional = True [dtsfc_cice] standard_name = surface_upward_sensible_heat_flux_from_coupled_process long_name = sfc sensible heat flux for coupling @@ -584,6 +593,7 @@ type = real kind = kind_phys intent = in + optional = True [dqsfc_cice] standard_name = surface_upward_latent_heat_flux_from_coupled_process long_name = sfc latent heat flux for coupling @@ -592,6 +602,7 @@ type = real kind = kind_phys intent = in + optional = True [hflx_wat] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water @@ -608,6 +619,7 @@ type = real kind = kind_phys intent = in + optional = True [stress_wat] standard_name = surface_wind_stress_over_water long_name = surface wind stress over water @@ -661,6 +673,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfci_cpl] standard_name = surface_y_momentum_flux_for_coupling long_name = instantaneous sfc v momentum flux @@ -669,6 +682,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtsfci_cpl] standard_name = surface_upward_sensible_heat_flux_for_coupling long_name = instantaneous sfc sensible heat flux @@ -677,6 +691,7 @@ type = real kind = kind_phys intent = inout + optional = True [dqsfci_cpl] standard_name = surface_upward_latent_heat_flux_for_coupling long_name = instantaneous sfc latent heat flux @@ -685,6 +700,7 @@ type = real kind = kind_phys intent = inout + optional = True [dusfc_cpl] standard_name = cumulative_surface_x_momentum_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc u momentum flux multiplied by timestep @@ -693,6 +709,7 @@ type = real kind = kind_phys intent = inout + optional = True [dvsfc_cpl] standard_name = cumulative_surface_y_momentum_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc v momentum flux multiplied by timestep @@ -701,6 +718,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtsfc_cpl] standard_name = cumulative_surface_upward_sensible_heat_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc sensible heat flux multiplied by timestep @@ -709,6 +727,7 @@ type = real kind = kind_phys intent = inout + optional = True [dqsfc_cpl] standard_name = cumulative_surface_upward_latent_heat_flux_for_coupling_multiplied_by_timestep long_name = cumulative sfc latent heat flux multiplied by timestep @@ -717,6 +736,7 @@ type = real kind = kind_phys intent = inout + optional = True [recmol] standard_name = reciprocal_of_obukhov_length long_name = one over obukhov length @@ -725,6 +745,7 @@ type = real kind = kind_phys intent = in + optional = True [qke] standard_name = nonadvected_turbulent_kinetic_energy_multiplied_by_2 long_name = 2 x tke at mass points @@ -733,6 +754,7 @@ type = real kind = kind_phys intent = inout + optional = True [qke_adv] standard_name = turbulent_kinetic_energy long_name = turbulent kinetic energy @@ -749,6 +771,7 @@ type = real kind = kind_phys intent = out + optional = True [qsq] standard_name = variance_of_specific_humidity long_name = water vapor fluctuation squared @@ -757,6 +780,7 @@ type = real kind = kind_phys intent = out + optional = True [cov] standard_name = covariance_of_air_temperature_and_specific_humidity long_name = covariance of temperature and moisture @@ -765,6 +789,7 @@ type = real kind = kind_phys intent = out + optional = True [el_pbl] standard_name = turbulent_mixing_length long_name = mixing length in meters @@ -773,6 +798,7 @@ type = real kind = kind_phys intent = inout + optional = True [Sh3D] standard_name = stability_function_for_heat long_name = stability function for heat @@ -781,6 +807,7 @@ type = real kind = kind_phys intent = inout + optional = True [Sm3D] standard_name = stability_function_for_momentum long_name = stability function for momentum @@ -789,6 +816,7 @@ type = real kind = kind_phys intent = inout + optional = True [exch_h] standard_name = atmosphere_heat_diffusivity_for_mynnedmf long_name = diffusivity for heat for MYNN PBL (defined for all mass levels) @@ -797,6 +825,7 @@ type = real kind = kind_phys intent = out + optional = True [exch_m] standard_name = atmosphere_momentum_diffusivity_for_mynnedmf long_name = diffusivity for momentum for MYNN PBL (defined for all mass levels) @@ -805,6 +834,7 @@ type = real kind = kind_phys intent = out + optional = True [dqke] standard_name = total_time_rate_of_change_of_tke long_name = total tke tendency @@ -813,6 +843,7 @@ type = real kind = kind_phys intent = out + optional = True [qwt] standard_name = tke_tendency_due_to_vertical_transport long_name = tke tendency due to vertical transport and diffusion @@ -821,6 +852,7 @@ type = real kind = kind_phys intent = out + optional = True [qshear] standard_name = tke_tendency_due_to_shear long_name = tke tendency due to shear @@ -829,6 +861,7 @@ type = real kind = kind_phys intent = out + optional = True [qbuoy] standard_name = tke_tendency_due_to_buoyancy long_name = tke tendency due to buoyancy production or consumption @@ -837,6 +870,7 @@ type = real kind = kind_phys intent = out + optional = True [qdiss] standard_name = tke_tendency_due_to_dissipation long_name = tke tendency due to the dissipation of tke @@ -845,6 +879,7 @@ type = real kind = kind_phys intent = out + optional = True [PBLH] standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness @@ -853,6 +888,7 @@ type = real kind = kind_phys intent = inout + optional = True [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = PBL top model level index @@ -868,6 +904,7 @@ type = real kind = kind_phys intent = inout + optional = True [QI_BL] standard_name = subgrid_scale_cloud_ice_mixing_ratio long_name = subgrid cloud ice mixing ratio from PBL scheme @@ -876,6 +913,7 @@ type = real kind = kind_phys intent = inout + optional = True [CLDFRA_BL] standard_name = subgrid_scale_cloud_area_fraction_in_atmosphere_layer long_name = subgrid cloud fraction from PBL scheme @@ -884,6 +922,7 @@ type = real kind = kind_phys intent = inout + optional = True [edmf_a] standard_name = emdf_updraft_area long_name = updraft area from mass flux scheme @@ -892,6 +931,7 @@ type = real kind = kind_phys intent = inout + optional = True [edmf_w] standard_name = emdf_updraft_vertical_velocity long_name = updraft vertical velocity from mass flux scheme @@ -900,6 +940,7 @@ type = real kind = kind_phys intent = inout + optional = True [edmf_qt] standard_name = emdf_updraft_total_water long_name = updraft total water from mass flux scheme @@ -908,6 +949,7 @@ type = real kind = kind_phys intent = inout + optional = True [edmf_thl] standard_name = emdf_updraft_theta_l long_name = updraft theta-l from mass flux scheme @@ -916,6 +958,7 @@ type = real kind = kind_phys intent = inout + optional = True [edmf_ent] standard_name = emdf_updraft_entrainment_rate long_name = updraft entrainment rate from mass flux scheme @@ -924,6 +967,7 @@ type = real kind = kind_phys intent = inout + optional = True [edmf_qc] standard_name = emdf_updraft_cloud_water long_name = updraft cloud water from mass flux scheme @@ -932,6 +976,7 @@ type = real kind = kind_phys intent = inout + optional = True [sub_thl] standard_name = theta_subsidence_tendency long_name = updraft theta subsidence tendency @@ -940,6 +985,7 @@ type = real kind = kind_phys intent = inout + optional = True [sub_sqv] standard_name = water_vapor_subsidence_tendency long_name = updraft water vapor subsidence tendency @@ -948,6 +994,7 @@ type = real kind = kind_phys intent = inout + optional = True [det_thl] standard_name = theta_detrainment_tendency long_name = updraft theta detrainment tendency @@ -956,6 +1003,7 @@ type = real kind = kind_phys intent = inout + optional = True [det_sqv] standard_name = water_vapor_detrainment_tendency long_name = updraft water vapor detrainment tendency @@ -964,6 +1012,7 @@ type = real kind = kind_phys intent = inout + optional = True [maxwidth] standard_name = maximum_width_of_plumes long_name = maximum width of plumes per grid column @@ -972,6 +1021,7 @@ type = real kind = kind_phys intent = out + optional = True [maxMF] standard_name = maximum_mass_flux long_name = maximum mass flux within a column @@ -980,6 +1030,7 @@ type = real kind = kind_phys intent = out + optional = True [ztop_plume] standard_name = height_of_tallest_plume_in_a_column long_name = height of tallest plume in a column @@ -988,6 +1039,7 @@ type = real kind = kind_phys intent = out + optional = True [ktop_plume] standard_name = k_level_of_highest_plume long_name = k-level of highest plume @@ -995,6 +1047,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout + optional = True [dudt] standard_name = process_split_cumulative_tendency_of_x_wind long_name = updated tendency of the x wind @@ -1067,6 +1120,7 @@ type = real kind = kind_phys intent = inout + optional = True [dqdt_ice_num_conc] standard_name = process_split_cumulative_tendency_of_mass_number_concentration_of_cloud_ice_water_crystals_in_air long_name = number conc. of ice tendency due to model physics @@ -1083,6 +1137,7 @@ type = real kind = kind_phys intent = inout + optional = True [dqdt_ice_aer_num_conc] standard_name = process_split_cumulative_tendency_of_mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols long_name = number conc. of ice-friendly aerosols tendency due to model physics @@ -1091,6 +1146,7 @@ type = real kind = kind_phys intent = inout + optional = True [dqdt_cccn] standard_name = tendency_of_cloud_condensation_nuclei_number_concentration_due_to_model_physics long_name = number concentration of cloud condensation nuclei tendency due to model physics @@ -1099,6 +1155,7 @@ type = real kind = kind_phys intent = inout + optional = True [flag_for_pbl_generic_tend] standard_name = flag_for_generic_tendency_due_to_planetary_boundary_layer long_name = true if GFS_PBL_generic should calculate tendencies @@ -1121,6 +1178,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -1205,6 +1263,7 @@ dimensions = () type = integer intent = in + optional = True [ntia] standard_name = index_of_mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_in_tracer_concentration_array long_name = tracer index for ice friendly aerosol @@ -1212,6 +1271,7 @@ dimensions = () type = integer intent = in + optional = True [index_of_process_pbl] standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index @@ -1391,6 +1451,7 @@ type = real kind = kind_phys intent = inout + optional = True [frp] standard_name = frp_hourly long_name = hourly fire radiative power @@ -1399,6 +1460,7 @@ type = real kind = kind_phys intent = inout + optional = True [rrfs_sd] standard_name = do_smoke_coupling long_name = flag controlling rrfs_sd collection (default off) @@ -1442,6 +1504,7 @@ type = real kind = kind_phys intent = in + optional = True [smoke_dbg] standard_name = do_smoke_debug long_name = flag for rrfs smoke plumerise debug @@ -1471,6 +1534,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_pbl] standard_name = control_for_pbl_spp_perturbations long_name = control for pbl spp perturbations diff --git a/physics/PBL/SATMEDMF/satmedmfvdif.meta b/physics/PBL/SATMEDMF/satmedmfvdif.meta index b94e74d6c..2ea9a30ff 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdif.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdif.meta @@ -457,6 +457,7 @@ type = real kind = kind_phys intent = out + optional = True [hpbl] standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness @@ -465,6 +466,7 @@ type = real kind = kind_phys intent = out + optional = True [kinver] standard_name = index_of_highest_temperature_inversion long_name = index of highest temperature inversion @@ -504,6 +506,7 @@ type = real kind = kind_phys intent = in + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -511,6 +514,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.meta b/physics/PBL/SATMEDMF/satmedmfvdifq.meta index e203187aa..b2f401c76 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.meta @@ -502,6 +502,7 @@ type = real kind = kind_phys intent = out + optional = True [hpbl] standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness @@ -510,6 +511,7 @@ type = real kind = kind_phys intent = out + optional = True [dkt] standard_name = atmosphere_heat_diffusivity long_name = atmospheric heat diffusivity @@ -626,6 +628,7 @@ type = real kind = kind_phys intent = in + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -633,6 +636,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/SHOC/moninshoc.meta b/physics/PBL/SHOC/moninshoc.meta index 474689ea0..65b033d90 100644 --- a/physics/PBL/SHOC/moninshoc.meta +++ b/physics/PBL/SHOC/moninshoc.meta @@ -347,6 +347,7 @@ type = real kind = kind_phys intent = out + optional = True [dkt] standard_name = atmosphere_heat_diffusivity long_name = atmospheric heat diffusivity @@ -363,6 +364,7 @@ type = real kind = kind_phys intent = out + optional = True [kinver] standard_name = index_of_highest_temperature_inversion long_name = index of highest temperature inversion @@ -457,6 +459,7 @@ type = real kind = kind_phys intent = in + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index @@ -464,6 +467,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/SHOC/shoc.meta b/physics/PBL/SHOC/shoc.meta index a1550ce11..88903fb09 100644 --- a/physics/PBL/SHOC/shoc.meta +++ b/physics/PBL/SHOC/shoc.meta @@ -208,6 +208,7 @@ type = real kind = kind_phys intent = in + optional = True [supice] standard_name = tunable_parameter_for_ice_supersaturation long_name = ice supersaturation parameter for PDF clouds diff --git a/physics/PBL/YSU/ysuvdif.meta b/physics/PBL/YSU/ysuvdif.meta index 20e96a92d..0095b8a77 100644 --- a/physics/PBL/YSU/ysuvdif.meta +++ b/physics/PBL/YSU/ysuvdif.meta @@ -243,6 +243,7 @@ type = real kind = kind_phys intent = out + optional = True [psim] standard_name = Monin_Obukhov_similarity_function_for_momentum long_name = Monin-Obukhov similarity function for momentum @@ -386,6 +387,7 @@ type = real kind = kind_phys intent = out + optional = True [dt] standard_name = timestep_for_physics long_name = time step for physics @@ -474,6 +476,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/saYSU/shinhongvdif.meta b/physics/PBL/saYSU/shinhongvdif.meta index 8b1d48605..0002a38b9 100644 --- a/physics/PBL/saYSU/shinhongvdif.meta +++ b/physics/PBL/saYSU/shinhongvdif.meta @@ -219,6 +219,7 @@ type = real kind = kind_phys intent = out + optional = True [psim] standard_name = Monin_Obukhov_similarity_function_for_momentum long_name = Monin-Obukhov similarity function for momentum @@ -362,6 +363,7 @@ type = real kind = kind_phys intent = out + optional = True [dt] standard_name = timestep_for_physics long_name = time step for physics @@ -451,6 +453,7 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in + optional = True [index_of_process_pbl] standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index diff --git a/physics/Radiation/RRTMG/radlw_main.meta b/physics/Radiation/RRTMG/radlw_main.meta index f7c80fb20..453c63529 100644 --- a/physics/Radiation/RRTMG/radlw_main.meta +++ b/physics/Radiation/RRTMG/radlw_main.meta @@ -134,6 +134,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [aeraod] standard_name = aerosol_optical_depth_for_longwave_bands_01_16 long_name = aerosol optical depth for longwave bands 01-16 @@ -166,6 +167,7 @@ type = real kind = kind_phys intent = in + optional = True [dzlyr] standard_name = layer_thickness_for_radiation long_name = layer thickness @@ -174,6 +176,7 @@ type = real kind = kind_phys intent = in + optional = True [delpin] standard_name = layer_pressure_thickness_for_radiation long_name = layer pressure thickness diff --git a/physics/Radiation/RRTMG/radsw_main.meta b/physics/Radiation/RRTMG/radsw_main.meta index 2169a26f0..76d55c520 100644 --- a/physics/Radiation/RRTMG/radsw_main.meta +++ b/physics/Radiation/RRTMG/radsw_main.meta @@ -134,6 +134,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [aeraod] standard_name = aerosol_optical_depth_for_shortwave_bands_01_16 long_name = aerosol optical depth for shortwave bands 01-16 @@ -198,6 +199,7 @@ type = real kind = kind_phys intent = in + optional = True [delpin] standard_name = layer_pressure_thickness_for_radiation long_name = layer pressure thickness diff --git a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta index 37ec2e9a0..ab49beebc 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta @@ -112,6 +112,7 @@ type = real kind = kind_phys intent = in + optional = True [relhum] standard_name = relative_humidity long_name = layer relative humidity @@ -120,6 +121,7 @@ type = real kind = kind_phys intent = in + optional = True [lsmask] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 diff --git a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta index d71e37592..255f2388a 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta @@ -289,6 +289,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [semis] standard_name = surface_longwave_emissivity long_name = surface lw emissivity in fraction @@ -305,6 +306,7 @@ type = real kind = kind_phys intent = in + optional = True [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP long_name = air pressure at vertical layer for radiation calculation @@ -345,6 +347,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_h2o] standard_name = volume_mixing_ratio_for_h2o long_name = molar mixing ratio of h2o in with respect to dry air @@ -353,6 +356,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_o3] standard_name = volume_mixing_ratio_for_o3 long_name = molar mixing ratio of o3 in with respect to dry air @@ -361,6 +365,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_ch4] standard_name = volume_mixing_ratio_for_ch4 long_name = molar mixing ratio of ch4 in with respect to dry air @@ -369,6 +374,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_n2o] standard_name = volume_mixing_ratio_for_n2o long_name = molar mixing ratio of n2o in with respect to dry air @@ -377,6 +383,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_co2] standard_name = volume_mixing_ratio_for_co2 long_name = molar mixing ratio of co2 in with respect to dry air @@ -385,6 +392,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction @@ -465,6 +473,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_lwp] standard_name = convective_cloud_liquid_water_path long_name = layer convective cloud liquid water path @@ -473,6 +482,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_iwp] standard_name = convective_cloud_ice_water_path long_name = layer convective cloud ice water path @@ -481,6 +491,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_reliq] standard_name = mean_effective_radius_for_liquid_convective_cloud long_name = mean effective radius for liquid convective cloud @@ -489,6 +500,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_reice] standard_name = mean_effective_radius_for_ice_convective_cloud long_name = mean effective radius for ice convective cloud @@ -497,6 +509,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_lwp] standard_name = MYNN_SGS_cloud_liquid_water_path long_name = layer convective cloud liquid water path @@ -537,6 +550,7 @@ type = real kind = kind_phys intent = in + optional = True [active_gases_array] standard_name = list_of_active_gases_used_by_RRTMGP long_name = list of active gases used by RRTMGP diff --git a/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta index 68e84b924..fdcb95ce0 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta @@ -297,6 +297,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP long_name = air pressure at vertical layer for radiation calculation @@ -337,6 +338,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_h2o] standard_name = volume_mixing_ratio_for_h2o long_name = molar mixing ratio of h2o in with respect to dry air @@ -345,6 +347,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_o3] standard_name = volume_mixing_ratio_for_o3 long_name = molar mixing ratio of o3 in with respect to dry air @@ -353,6 +356,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_ch4] standard_name = volume_mixing_ratio_for_ch4 long_name = molar mixing ratio of ch4 in with respect to dry air @@ -361,6 +365,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_n2o] standard_name = volume_mixing_ratio_for_n2o long_name = molar mixing ratio of n2o in with respect to dry air @@ -369,6 +374,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_co2] standard_name = volume_mixing_ratio_for_co2 long_name = molar mixing ratio of co2 in with respect to dry air @@ -377,6 +383,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction @@ -457,6 +464,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_lwp] standard_name = convective_cloud_liquid_water_path long_name = layer convective cloud liquid water path @@ -465,6 +473,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_iwp] standard_name = convective_cloud_ice_water_path long_name = layer convective cloud ice water path @@ -473,6 +482,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_reliq] standard_name = mean_effective_radius_for_liquid_convective_cloud long_name = mean effective radius for liquid convective cloud @@ -481,6 +491,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_cnv_reice] standard_name = mean_effective_radius_for_ice_convective_cloud long_name = mean effective radius for ice convective cloud @@ -489,6 +500,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_lwp] standard_name = MYNN_SGS_cloud_liquid_water_path long_name = layer convective cloud liquid water path @@ -529,6 +541,7 @@ type = real kind = kind_phys intent = in + optional = True [sfc_alb_nir_dir] standard_name = surface_albedo_due_to_near_IR_direct long_name = surface albedo due to near IR direct beam diff --git a/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta index 0ae09985e..538e8d1f1 100644 --- a/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta +++ b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta @@ -325,6 +325,7 @@ type = real kind = kind_phys intent = inout + optional = True [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 diff --git a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta index 0e1c96c02..74dc319b8 100644 --- a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta +++ b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta @@ -281,6 +281,7 @@ type = real kind = kind_phys intent = in + optional = True [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 @@ -670,6 +671,7 @@ type = real kind = kind_phys intent = inout + optional = True [qflx_lnd] standard_name = kinematic_surface_upward_latent_heat_flux_over_land long_name = kinematic surface upward latent heat flux over land @@ -678,6 +680,7 @@ type = real kind = kind_phys intent = inout + optional = True [qflx_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice long_name = kinematic surface upward latent heat flux over ice @@ -686,6 +689,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsfc] standard_name = surface_specific_humidity long_name = surface air saturation specific humidity @@ -702,6 +706,7 @@ type = real kind = kind_phys intent = in + optional = True [qsfc_ice_ruc] standard_name = water_vapor_mixing_ratio_at_surface_over_ice long_name = water vapor mixing ratio at surface over ice @@ -710,6 +715,7 @@ type = real kind = kind_phys intent = in + optional = True [ustm] standard_name = surface_friction_velocity_for_momentum long_name = friction velocity isolated for momentum only @@ -718,6 +724,7 @@ type = real kind = kind_phys intent = inout + optional = True [zol] standard_name = ratio_of_height_to_monin_obukhov_length long_name = monin obukhov surface stability parameter @@ -726,6 +733,7 @@ type = real kind = kind_phys intent = inout + optional = True [mol] standard_name = surface_temperature_scale long_name = temperature flux divided by ustar (temperature scale) @@ -734,6 +742,7 @@ type = real kind = kind_phys intent = inout + optional = True [rmol] standard_name = reciprocal_of_obukhov_length long_name = one over obukhov length @@ -742,6 +751,7 @@ type = real kind = kind_phys intent = inout + optional = True [wspd] standard_name = wind_speed_at_lowest_model_layer long_name = wind speed at lowest model level @@ -782,6 +792,7 @@ type = real kind = kind_phys intent = inout + optional = True [flhc] standard_name = surface_exchange_coefficient_for_heat long_name = surface exchange coefficient for heat @@ -790,6 +801,7 @@ type = real kind = kind_phys intent = inout + optional = True [flqc] standard_name = surface_exchange_coefficient_for_moisture long_name = surface exchange coefficient for moisture @@ -798,6 +810,7 @@ type = real kind = kind_phys intent = inout + optional = True [u10] standard_name = x_wind_at_10m long_name = 10 meter u wind speed @@ -846,6 +859,7 @@ type = real kind = kind_phys intent = inout + optional = True [chs2] standard_name = surface_exchange_coefficient_for_heat_at_2m long_name = exchange coefficient for heat at 2 meters @@ -854,6 +868,7 @@ type = real kind = kind_phys intent = inout + optional = True [cqs2] standard_name = surface_exchange_coefficient_for_moisture_at_2m long_name = exchange coefficient for moisture at 2 meters @@ -862,6 +877,7 @@ type = real kind = kind_phys intent = inout + optional = True [spp_wts_sfc] standard_name = spp_weights_for_surface_layer_scheme long_name = spp weights for surface layer scheme @@ -870,6 +886,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_sfc] standard_name = control_for_surface_layer_spp_perturbations long_name = control for surface layer spp perturbations diff --git a/physics/SFC_Layer/UFS/sfc_diag.meta b/physics/SFC_Layer/UFS/sfc_diag.meta index 4fdf37916..d00d14596 100644 --- a/physics/SFC_Layer/UFS/sfc_diag.meta +++ b/physics/SFC_Layer/UFS/sfc_diag.meta @@ -271,6 +271,7 @@ type = real kind = kind_phys intent = in + optional = True [diag_flux] standard_name = flag_for_flux_method_in_2m_diagnostics long_name = flag for flux method in 2-m diagnostics @@ -301,6 +302,7 @@ type = real kind = kind_phys intent = in + optional = True [cdq] standard_name = surface_drag_coefficient_for_heat_and_moisture_in_air long_name = surface exchange coeff heat & moisture diff --git a/physics/SFC_Layer/UFS/sfc_diag_post.meta b/physics/SFC_Layer/UFS/sfc_diag_post.meta index 4abb3bac0..34c3fd049 100644 --- a/physics/SFC_Layer/UFS/sfc_diag_post.meta +++ b/physics/SFC_Layer/UFS/sfc_diag_post.meta @@ -97,6 +97,7 @@ type = real kind = kind_phys intent = out + optional = True [q2mp] standard_name = specific_humidity_at_2m_from_noahmp long_name = 2 meter specific humidity from noahmp @@ -105,6 +106,7 @@ type = real kind = kind_phys intent = out + optional = True [t2m] standard_name = air_temperature_at_2m long_name = 2 meter temperature diff --git a/physics/SFC_Layer/UFS/sfc_nst.meta b/physics/SFC_Layer/UFS/sfc_nst.meta index 80f468803..e35119972 100644 --- a/physics/SFC_Layer/UFS/sfc_nst.meta +++ b/physics/SFC_Layer/UFS/sfc_nst.meta @@ -181,6 +181,7 @@ type = real kind = kind_phys intent = in + optional = True [cm] standard_name = surface_drag_coefficient_for_momentum_in_air_over_water long_name = surface exchange coeff for momentum over water @@ -441,6 +442,7 @@ type = real kind = kind_phys intent = inout + optional = True [xs] standard_name = sea_water_salinity_in_diurnal_thermocline long_name = salinity content in diurnal thermocline layer @@ -449,6 +451,7 @@ type = real kind = kind_phys intent = inout + optional = True [xu] standard_name = x_current_in_diurnal_thermocline long_name = u-current content in diurnal thermocline layer @@ -457,6 +460,7 @@ type = real kind = kind_phys intent = inout + optional = True [xv] standard_name = y_current_in_diurnal_thermocline long_name = v-current content in diurnal thermocline layer @@ -465,6 +469,7 @@ type = real kind = kind_phys intent = inout + optional = True [xz] standard_name = diurnal_thermocline_layer_thickness long_name = diurnal thermocline layer thickness @@ -473,6 +478,7 @@ type = real kind = kind_phys intent = inout + optional = True [zm] standard_name = ocean_mixed_layer_thickness long_name = mixed layer thickness @@ -481,6 +487,7 @@ type = real kind = kind_phys intent = inout + optional = True [xtts] standard_name = derivative_of_heat_content_in_diurnal_thermocline_wrt_surface_skin_temperature long_name = d(xt)/d(ts) @@ -489,6 +496,7 @@ type = real kind = kind_phys intent = inout + optional = True [xzts] standard_name = derivative_of_diurnal_thermocline_layer_thickness_wrt_surface_skin_temperature long_name = d(xz)/d(ts) @@ -497,6 +505,7 @@ type = real kind = kind_phys intent = inout + optional = True [dt_cool] standard_name = molecular_sublayer_temperature_correction_in_sea_water long_name = sub-layer cooling amount @@ -505,6 +514,7 @@ type = real kind = kind_phys intent = inout + optional = True [z_c] standard_name = molecular_sublayer_thickness_in_sea_water long_name = sub-layer cooling thickness @@ -513,6 +523,7 @@ type = real kind = kind_phys intent = inout + optional = True [c_0] standard_name = coefficient_c_0 long_name = coefficient1 to calculate d(tz)/d(ts) @@ -521,6 +532,7 @@ type = real kind = kind_phys intent = inout + optional = True [c_d] standard_name = coefficient_c_d long_name = coefficient2 to calculate d(tz)/d(ts) @@ -529,6 +541,7 @@ type = real kind = kind_phys intent = inout + optional = True [w_0] standard_name = coefficient_w_0 long_name = coefficient3 to calculate d(tz)/d(ts) @@ -537,6 +550,7 @@ type = real kind = kind_phys intent = inout + optional = True [w_d] standard_name = coefficient_w_d long_name = coefficient4 to calculate d(tz)/d(ts) @@ -545,6 +559,7 @@ type = real kind = kind_phys intent = inout + optional = True [d_conv] standard_name = free_convection_layer_thickness_in_sea_water long_name = thickness of free convection layer @@ -553,6 +568,7 @@ type = real kind = kind_phys intent = inout + optional = True [ifd] standard_name = control_for_diurnal_thermocline_calculation long_name = index to start dtlm run or not @@ -561,6 +577,7 @@ type = real kind = kind_phys intent = inout + optional = True [qrain] standard_name = surface_sensible_heat_due_to_rainfall long_name = sensible heat flux due to rainfall @@ -569,6 +586,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsurf] standard_name = surface_specific_humidity_over_water long_name = surface air saturation specific humidity over water @@ -609,6 +627,7 @@ type = real kind = kind_phys intent = inout + optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water diff --git a/physics/SFC_Layer/UFS/sfc_nst_post.meta b/physics/SFC_Layer/UFS/sfc_nst_post.meta index caa487384..ce4bee4e4 100644 --- a/physics/SFC_Layer/UFS/sfc_nst_post.meta +++ b/physics/SFC_Layer/UFS/sfc_nst_post.meta @@ -104,6 +104,7 @@ type = real kind = kind_phys intent = in + optional = True [xz] standard_name = diurnal_thermocline_layer_thickness long_name = diurnal thermocline layer thickness @@ -112,6 +113,7 @@ type = real kind = kind_phys intent = in + optional = True [dt_cool] standard_name = molecular_sublayer_temperature_correction_in_sea_water long_name = sub-layer cooling amount @@ -120,6 +122,7 @@ type = real kind = kind_phys intent = in + optional = True [z_c] standard_name = molecular_sublayer_thickness_in_sea_water long_name = sub-layer cooling thickness @@ -128,6 +131,7 @@ type = real kind = kind_phys intent = in + optional = True [tref] standard_name = reference_sea_surface_temperature long_name = reference/foundation temperature @@ -136,6 +140,7 @@ type = real kind = kind_phys intent = in + optional = True [xlon] standard_name = longitude long_name = longitude diff --git a/physics/SFC_Layer/UFS/sfc_nst_pre.meta b/physics/SFC_Layer/UFS/sfc_nst_pre.meta index e9cdef0d1..3b26fe52d 100644 --- a/physics/SFC_Layer/UFS/sfc_nst_pre.meta +++ b/physics/SFC_Layer/UFS/sfc_nst_pre.meta @@ -62,6 +62,7 @@ type = real kind = kind_phys intent = in + optional = True [xz] standard_name = diurnal_thermocline_layer_thickness long_name = diurnal thermocline layer thickness @@ -70,6 +71,7 @@ type = real kind = kind_phys intent = in + optional = True [dt_cool] standard_name = molecular_sublayer_temperature_correction_in_sea_water long_name = sub-layer cooling amount @@ -78,6 +80,7 @@ type = real kind = kind_phys intent = in + optional = True [z_c] standard_name = molecular_sublayer_thickness_in_sea_water long_name = sub-layer cooling thickness @@ -86,6 +89,7 @@ type = real kind = kind_phys intent = in + optional = True [tref] standard_name = reference_sea_surface_temperature long_name = reference/foundation temperature @@ -94,6 +98,7 @@ type = real kind = kind_phys intent = inout + optional = True [cplflx] standard_name = flag_for_surface_flux_coupling long_name = flag controlling cplflx collection (default off) diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.meta b/physics/SFC_Models/Lake/CLM/clm_lake.meta index 7b3bc0a49..abb361859 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.meta +++ b/physics/SFC_Models/Lake/CLM/clm_lake.meta @@ -273,6 +273,7 @@ type = real kind = kind_phys intent = in + optional = True [rainncprv] standard_name = lwe_thickness_of_explicit_precipitation_amount_on_previous_timestep long_name = explicit rainfall from previous timestep @@ -281,6 +282,7 @@ type = real kind = kind_phys intent = in + optional = True [oro_lakedepth] standard_name = lake_depth long_name = lake depth @@ -342,6 +344,7 @@ type = real kind = kind_phys intent = inout + optional = True [evap_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice long_name = kinematic surface upward latent heat flux over ice @@ -350,6 +353,7 @@ type = real kind = kind_phys intent = inout + optional = True [hflx_wat] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water @@ -526,6 +530,7 @@ type = real kind = kind_phys intent = inout + optional = True [albedo] standard_name = mid_day_surface_albedo_over_lake long_name = mid day surface albedo over lake @@ -558,6 +563,7 @@ type = real kind = kind_phys intent = out + optional = True [lake_q2m] standard_name = specific_humidity_at_2m_from_clm_lake long_name = specific humidity at 2m from clm lake @@ -566,6 +572,7 @@ type = real kind = kind_phys intent = out + optional = True [weasd] standard_name = lwe_thickness_of_surface_snow_amount long_name = water equiv of acc snow depth over land and sea ice diff --git a/physics/SFC_Models/Lake/Flake/flake_driver.meta b/physics/SFC_Models/Lake/Flake/flake_driver.meta index 22ab62d1e..6269e1873 100644 --- a/physics/SFC_Models/Lake/Flake/flake_driver.meta +++ b/physics/SFC_Models/Lake/Flake/flake_driver.meta @@ -93,6 +93,7 @@ type = real kind = kind_phys intent = in + optional = True [xlat] standard_name = latitude long_name = latitude @@ -239,6 +240,7 @@ type = real kind = kind_phys intent = inout + optional = True [lflx] standard_name = surface_upward_potential_latent_heat_flux_over_water long_name = surface upward potential latent heat flux over water @@ -311,6 +313,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_wML] standard_name = lake_mixed_layer_temperature long_name = temperature of lake mixing layer @@ -319,6 +322,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_mnw] standard_name = mean_temperature_of_the_water_column long_name = thee mean temperature of the water column @@ -327,6 +331,7 @@ type = real kind = kind_phys intent = inout + optional = True [H_B] standard_name = the_thermally_active_layer_depth_of_the_bottom_sediment long_name = the depth of the thermally active layer of the bottom sediment @@ -335,6 +340,7 @@ type = real kind = kind_phys intent = inout + optional = True [T_B] standard_name = temperature_at_the_bottom_of_the_sediment_upper_layer long_name = the temperature at the bottom of the sediment upper layer @@ -343,6 +349,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_bot1] standard_name = lake_bottom_temperature long_name = the temperature at the water-bottom sediment interface @@ -351,6 +358,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_bot2] standard_name = temperature_for_bottom_layer_of_water long_name = the temperature at the lake bottom layer water @@ -359,6 +367,7 @@ type = real kind = kind_phys intent = inout + optional = True [c_t] standard_name = shape_factor_of_water_temperature_vertical_profile long_name = the shape factor of water temperature vertical profile @@ -367,6 +376,7 @@ type = real kind = kind_phys intent = inout + optional = True [T_snow] standard_name = temperature_of_snow_on_lake long_name = the temperature of snow on a lake @@ -375,6 +385,7 @@ type = real kind = kind_phys intent = inout + optional = True [T_ice] standard_name = surface_skin_temperature_over_ice long_name = surface skin temperature over ice @@ -447,6 +458,7 @@ type = real kind = kind_phys intent = in + optional = True [t_wML] standard_name = lake_mixed_layer_temperature long_name = temperature of lake mixing layer @@ -455,6 +467,7 @@ type = real kind = kind_phys intent = in + optional = True [xz] standard_name = diurnal_thermocline_layer_thickness long_name = diurnal thermocline layer thickness @@ -463,6 +476,7 @@ type = real kind = kind_phys intent = out + optional = True [zm] standard_name = ocean_mixed_layer_thickness long_name = mixed layer thickness @@ -471,6 +485,7 @@ type = real kind = kind_phys intent = out + optional = True [tref] standard_name = reference_sea_surface_temperature long_name = reference/foundation temperature @@ -479,6 +494,7 @@ type = real kind = kind_phys intent = out + optional = True [tfco] standard_name = sea_surface_temperature long_name = sea surface temperature diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.meta b/physics/SFC_Models/Land/Noah/lsm_noah.meta index f3ce1d19b..391d2e1dc 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.meta +++ b/physics/SFC_Models/Land/Noah/lsm_noah.meta @@ -407,6 +407,7 @@ type = real kind = kind_phys intent = in + optional = True [vegfpert] standard_name = perturbation_of_vegetation_fraction long_name = perturbation of vegetation fraction @@ -638,6 +639,7 @@ type = real kind = kind_phys intent = inout + optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land @@ -750,6 +752,7 @@ type = real kind = kind_phys intent = inout + optional = True [lai] standard_name = leaf_area_index long_name = leaf area index @@ -758,6 +761,7 @@ type = real kind = kind_phys intent = inout + optional = True [rca] standard_name = aerodynamic_resistance_in_canopy long_name = canopy resistance diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 39eed1493..7d6f81245 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -302,6 +302,7 @@ type = real kind = kind_phys intent = in + optional = True [dry] standard_name = flag_nonzero_land_surface_fraction long_name = flag indicating presence of some land surface area fraction @@ -516,6 +517,7 @@ type = real kind = kind_phys intent = in + optional = True [rainc_mp] standard_name = convective_precipitation_rate_on_previous_timestep long_name = convective precipitation rate from previous timestep @@ -524,6 +526,7 @@ type = real kind = kind_phys intent = in + optional = True [snow_mp] standard_name = snowfall_rate_on_previous_timestep long_name = snow precipitation rate from previous timestep @@ -532,6 +535,7 @@ type = real kind = kind_phys intent = in + optional = True [graupel_mp] standard_name = graupel_precipitation_rate_on_previous_timestep long_name = graupel precipitation rate from previous timestep @@ -540,6 +544,7 @@ type = real kind = kind_phys intent = in + optional = True [ice_mp] standard_name = ice_precipitation_rate_on_previous_timestep long_name = ice precipitation rate from previous timestep @@ -548,6 +553,7 @@ type = real kind = kind_phys intent = in + optional = True [rhonewsn1] standard_name = surface_frozen_precipitation_density long_name = density of precipitation ice @@ -809,6 +815,7 @@ type = real kind = kind_phys intent = inout + optional = True [flhc1] standard_name = surface_exchange_coefficient_for_heat long_name = surface exchange coefficient for heat @@ -817,6 +824,7 @@ type = real kind = kind_phys intent = inout + optional = True [flqc1] standard_name = surface_exchange_coefficient_for_moisture long_name = surface exchange coefficient for moisture @@ -825,6 +833,7 @@ type = real kind = kind_phys intent = inout + optional = True [do_mynnsfclay] standard_name = flag_for_mellor_yamada_nakanishi_niino_surface_layer_scheme long_name = flag to activate MYNN surface layer @@ -840,6 +849,7 @@ type = real kind = kind_phys intent = inout + optional = True [tvxy] standard_name = canopy_temperature long_name = vegetation temperature @@ -848,6 +858,7 @@ type = real kind = kind_phys intent = inout + optional = True [tgxy] standard_name = ground_temperature long_name = ground temperature for noahmp @@ -856,6 +867,7 @@ type = real kind = kind_phys intent = inout + optional = True [canicexy] standard_name = canopy_intercepted_ice_mass long_name = canopy intercepted ice mass @@ -864,6 +876,7 @@ type = real kind = kind_phys intent = inout + optional = True [canliqxy] standard_name = canopy_intercepted_liquid_water long_name = canopy intercepted liquid water @@ -872,6 +885,7 @@ type = real kind = kind_phys intent = inout + optional = True [eahxy] standard_name = air_vapor_pressure_in_canopy long_name = canopy air vapor pressure @@ -880,6 +894,7 @@ type = real kind = kind_phys intent = inout + optional = True [tahxy] standard_name = air_temperature_in_canopy long_name = canopy air temperature @@ -888,6 +903,7 @@ type = real kind = kind_phys intent = inout + optional = True [cmxy] standard_name = surface_drag_coefficient_for_momentum_for_noahmp long_name = surface drag coefficient for momentum for noahmp @@ -896,6 +912,7 @@ type = real kind = kind_phys intent = inout + optional = True [chxy] standard_name = surface_drag_coefficient_for_heat_and_moisture_for_noahmp long_name = surface exchange coeff heat & moisture for noahmp @@ -904,6 +921,7 @@ type = real kind = kind_phys intent = inout + optional = True [fwetxy] standard_name = wet_canopy_area_fraction long_name = area fraction of canopy that is wetted/snowed @@ -912,6 +930,7 @@ type = real kind = kind_phys intent = inout + optional = True [sneqvoxy] standard_name = lwe_thickness_of_snowfall_amount_on_previous_timestep long_name = snow mass at previous time step @@ -920,6 +939,7 @@ type = real kind = kind_phys intent = inout + optional = True [alboldxy] standard_name = surface_albedo_assuming_deep_snow_on_previous_timestep long_name = snow albedo at previous time step @@ -928,6 +948,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsnowxy] standard_name = lwe_snowfall_rate long_name = snow precipitation rate at surface @@ -936,6 +957,7 @@ type = real kind = kind_phys intent = inout + optional = True [wslakexy] standard_name = water_storage_in_lake long_name = lake water storage @@ -944,6 +966,7 @@ type = real kind = kind_phys intent = inout + optional = True [zwtxy] standard_name = water_table_depth long_name = water table depth @@ -952,6 +975,7 @@ type = real kind = kind_phys intent = inout + optional = True [waxy] standard_name = water_storage_in_aquifer long_name = water storage in aquifer @@ -960,6 +984,7 @@ type = real kind = kind_phys intent = inout + optional = True [wtxy] standard_name = water_storage_in_aquifer_and_saturated_soil long_name = water storage in aquifer and saturated soil @@ -968,6 +993,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsnoxy] standard_name = temperature_in_surface_snow long_name = temperature_in_surface_snow @@ -976,6 +1002,7 @@ type = real kind = kind_phys intent = inout + optional = True [zsnsoxy] standard_name = depth_from_snow_surface_at_bottom_interface long_name = depth from the top of the snow surface at the bottom of the layer @@ -984,6 +1011,7 @@ type = real kind = kind_phys intent = inout + optional = True [snicexy] standard_name = lwe_thickness_of_ice_in_surface_snow long_name = lwe_thickness_of_ice_in_surface_snow @@ -992,6 +1020,7 @@ type = real kind = kind_phys intent = inout + optional = True [snliqxy] standard_name = lwe_thickness_of_liquid_water_in_surface_snow long_name = snow layer liquid water @@ -1000,6 +1029,7 @@ type = real kind = kind_phys intent = inout + optional = True [lfmassxy] standard_name = leaf_mass_content long_name = leaf mass @@ -1008,6 +1038,7 @@ type = real kind = kind_phys intent = inout + optional = True [rtmassxy] standard_name = fine_root_mass_content long_name = fine root mass @@ -1016,6 +1047,7 @@ type = real kind = kind_phys intent = inout + optional = True [stmassxy] standard_name = stem_mass_content long_name = stem mass @@ -1024,6 +1056,7 @@ type = real kind = kind_phys intent = inout + optional = True [woodxy] standard_name = wood_mass_content long_name = wood mass including woody roots @@ -1032,6 +1065,7 @@ type = real kind = kind_phys intent = inout + optional = True [stblcpxy] standard_name = slow_soil_pool_mass_content_of_carbon long_name = stable carbon in deep soil @@ -1040,6 +1074,7 @@ type = real kind = kind_phys intent = inout + optional = True [fastcpxy] standard_name = fast_soil_pool_mass_content_of_carbon long_name = short-lived carbon in shallow soil @@ -1048,6 +1083,7 @@ type = real kind = kind_phys intent = inout + optional = True [xlaixy] standard_name = leaf_area_index long_name = leaf area index @@ -1056,6 +1092,7 @@ type = real kind = kind_phys intent = inout + optional = True [xsaixy] standard_name = stem_area_index long_name = stem area index @@ -1064,6 +1101,7 @@ type = real kind = kind_phys intent = inout + optional = True [taussxy] standard_name = dimensionless_age_of_surface_snow long_name = non-dimensional snow age @@ -1072,6 +1110,7 @@ type = real kind = kind_phys intent = inout + optional = True [smoiseq] standard_name = volumetric_equilibrium_soil_moisture long_name = equilibrium soil water content @@ -1080,6 +1119,7 @@ type = real kind = kind_phys intent = inout + optional = True [smcwtdxy] standard_name = volumetric_soil_moisture_between_soil_bottom_and_water_table long_name = soil water content between the bottom of the soil and the water table @@ -1088,6 +1128,7 @@ type = real kind = kind_phys intent = inout + optional = True [deeprechxy] standard_name = water_table_recharge_assuming_deep long_name = recharge to or from the water table when deep @@ -1096,6 +1137,7 @@ type = real kind = kind_phys intent = inout + optional = True [rechxy] standard_name = water_table_recharge_assuming_shallow long_name = recharge to or from the water table when shallow @@ -1104,6 +1146,7 @@ type = real kind = kind_phys intent = inout + optional = True [albdvis] standard_name = surface_albedo_direct_visible_over_land long_name = direct surface albedo visible band over land @@ -1184,6 +1227,7 @@ type = real kind = kind_phys intent = out + optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land @@ -1328,6 +1372,7 @@ type = real kind = kind_phys intent = out + optional = True [t2mmp] standard_name = temperature_at_2m_from_noahmp long_name = 2 meter temperature from noahmp @@ -1336,6 +1381,7 @@ type = real kind = kind_phys intent = out + optional = True [q2mp] standard_name = specific_humidity_at_2m_from_noahmp long_name = 2 meter specific humidity from noahmp @@ -1344,6 +1390,7 @@ type = real kind = kind_phys intent = out + optional = True [zvfun] standard_name = function_of_surface_roughness_length_and_green_vegetation_fraction long_name = function of surface roughness length and green vegetation fraction diff --git a/physics/SFC_Models/Land/RUC/lsm_ruc.meta b/physics/SFC_Models/Land/RUC/lsm_ruc.meta index bc4d358e3..88dd81001 100644 --- a/physics/SFC_Models/Land/RUC/lsm_ruc.meta +++ b/physics/SFC_Models/Land/RUC/lsm_ruc.meta @@ -256,6 +256,7 @@ type = real kind = kind_phys intent = in + optional = True [snoalb] standard_name = upper_bound_of_max_albedo_assuming_deep_snow long_name = maximum snow albedo @@ -320,6 +321,7 @@ type = real kind = kind_phys intent = inout + optional = True [sfcqv_ice] standard_name = water_vapor_mixing_ratio_at_surface_over_ice long_name = water vapor mixing ratio at surface over ice @@ -328,6 +330,7 @@ type = real kind = kind_phys intent = inout + optional = True [sfalb_lnd_bck] standard_name =surface_snow_free_albedo_over_land long_name = surface snow-free albedo over ice @@ -400,6 +403,7 @@ type = real kind = kind_phys intent = inout + optional = True [albdnir_ice] standard_name = surface_albedo_direct_NIR_over_ice long_name = direct surface albedo NIR band over ice @@ -416,6 +420,7 @@ type = real kind = kind_phys intent = inout + optional = True [albinir_ice] standard_name = surface_albedo_diffuse_NIR_over_ice long_name = diffuse surface albedo NIR band over ice @@ -440,6 +445,7 @@ type = real kind = kind_phys intent = inout + optional = True [smfrkeep] standard_name = volume_fraction_of_frozen_soil_moisture_for_land_surface_model long_name = volume fraction of frozen soil moisture for lsm @@ -456,6 +462,7 @@ type = real kind = kind_phys intent = inout + optional = True [smois] standard_name = volume_fraction_of_soil_moisture_for_land_surface_model long_name = volumetric fraction of soil moisture for lsm @@ -464,6 +471,7 @@ type = real kind = kind_phys intent = inout + optional = True [wetness] standard_name = normalized_soil_wetness_for_land_surface_model long_name = normalized soil wetness @@ -472,6 +480,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsice] standard_name = temperature_in_ice_layer long_name = sea ice internal temperature @@ -705,6 +714,7 @@ dimensions = () type = logical intent = in + optional = True [xlat_d] standard_name = latitude_in_degree long_name = latitude in degree north @@ -815,6 +825,7 @@ type = real kind = kind_phys intent = inout + optional = True [dlwflx] standard_name = surface_downwelling_longwave_flux long_name = surface downwelling longwave flux at current time @@ -876,6 +887,7 @@ type = real kind = kind_phys intent = in + optional = True [rainc] standard_name = lwe_thickness_of_convective_precipitation_amount_on_previous_timestep long_name = convective_precipitation_amount from previous timestep @@ -884,6 +896,7 @@ type = real kind = kind_phys intent = in + optional = True [ice] standard_name = lwe_thickness_of_ice_precipitation_amount_on_previous_timestep long_name = ice amount from previous timestep @@ -892,6 +905,7 @@ type = real kind = kind_phys intent = in + optional = True [snow] standard_name = snow_mass_on_previous_timestep long_name = snow amount from previous timestep @@ -900,6 +914,7 @@ type = real kind = kind_phys intent = in + optional = True [graupel] standard_name = lwe_thickness_of_graupel_amount_on_previous_timestep long_name = graupel amount from previous timestep @@ -908,6 +923,7 @@ type = real kind = kind_phys intent = in + optional = True [prsl1] standard_name = air_pressure_at_surface_adjacent_layer long_name = mean pressure at lowest model layer @@ -1202,6 +1218,7 @@ type = real kind = kind_phys intent = inout + optional = True [weasd_ice] standard_name = water_equivalent_accumulated_snow_depth_over_ice long_name = water equiv of acc snow depth over ice @@ -1234,6 +1251,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsice] standard_name = temperature_in_ice_layer long_name = sea ice internal temperature @@ -1250,6 +1268,7 @@ type = real kind = kind_phys intent = inout + optional = True [sh2o] standard_name = volume_fraction_of_unfrozen_soil_moisture_for_land_surface_model long_name = volume fraction of unfrozen soil moisture for lsm @@ -1258,6 +1277,7 @@ type = real kind = kind_phys intent = inout + optional = True [keepfr] standard_name = control_for_frozen_soil_physics long_name = flag for frozen soil physics (RUC) @@ -1306,6 +1326,7 @@ type = real kind = kind_phys intent = inout + optional = True [z0rl_lnd] standard_name = surface_roughness_length_over_land long_name = surface roughness length over land (temporary use as interstitial) @@ -1330,6 +1351,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsurf_lnd] standard_name = surface_specific_humidity_over_land long_name = surface air saturation specific humidity over land @@ -1354,6 +1376,7 @@ type = real kind = kind_phys intent = inout + optional = True [hflx_lnd] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land @@ -1442,6 +1465,7 @@ type = real kind = kind_phys intent = inout + optional = True [snowfallac_lnd] standard_name = surface_snow_amount_assuming_variable_snow_density_over_land long_name = run-total snow accumulation on the ground with variable snow density over land @@ -1522,6 +1546,7 @@ type = real kind = kind_phys intent = inout + optional = True [tsurf_ice] standard_name = surface_skin_temperature_after_iteration_over_ice long_name = surface skin temperature after iteration over ice @@ -1538,6 +1563,7 @@ type = real kind = kind_phys intent = inout + optional = True [z0rl_ice] standard_name = surface_roughness_length_over_ice long_name = surface roughness length over ice (temporary use as interstitial) @@ -1570,6 +1596,7 @@ type = real kind = kind_phys intent = inout + optional = True [ep1d_ice] standard_name = surface_upward_potential_latent_heat_flux_over_ice long_name = surface upward potential latent heat flux over ice @@ -1634,6 +1661,7 @@ type = real kind = kind_phys intent = out + optional = True [albdnir_ice] standard_name = surface_albedo_direct_NIR_over_ice long_name = direct surface albedo NIR band over ice @@ -1650,6 +1678,7 @@ type = real kind = kind_phys intent = out + optional = True [albinir_ice] standard_name = surface_albedo_diffuse_NIR_over_ice long_name = diffuse surface albedo NIR band over ice diff --git a/physics/SFC_Models/Land/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta index 6a4bd8fbe..151905280 100644 --- a/physics/SFC_Models/Land/sfc_land.meta +++ b/physics/SFC_Models/Land/sfc_land.meta @@ -50,6 +50,7 @@ type = real kind = kind_phys intent = in + optional = True [qsurf_lnd] standard_name = surface_specific_humidity_over_land_from_land long_name = surface air saturation specific humidity over land @@ -58,6 +59,7 @@ type = real kind = kind_phys intent = in + optional = True [evap_lnd] standard_name = surface_upward_latent_heat_flux_over_land_from_land long_name = sfc latent heat flux input over land for coupling @@ -66,6 +68,7 @@ type = real kind = kind_phys intent = in + optional = True [hflx_lnd] standard_name = surface_upward_sensible_heat_flux_over_land_from_land long_name = sfc sensible heat flux input over land for coupling @@ -74,6 +77,7 @@ type = real kind = kind_phys intent = in + optional = True [ep_lnd] standard_name = surface_upward_potential_latent_heat_flux_over_land_from_land long_name = surface upward potential latent heat flux over land for coupling @@ -82,6 +86,7 @@ type = real kind = kind_phys intent = in + optional = True [t2mmp_lnd] standard_name = temperature_at_2m_over_land_from_land long_name = 2 meter temperature over land for coupling @@ -90,6 +95,7 @@ type = real kind = kind_phys intent = in + optional = True [q2mp_lnd] standard_name = specific_humidity_at_2m_over_land_from_land long_name = 2 meter specific humidity over land for coupling @@ -98,6 +104,7 @@ type = real kind = kind_phys intent = in + optional = True [gflux_lnd] standard_name = upward_heat_flux_in_soil_over_land_from_land long_name = soil heat flux over land for coupling @@ -106,6 +113,7 @@ type = real kind = kind_phys intent = in + optional = True [runoff_lnd] standard_name = surface_runoff_flux_from_land long_name = surface runoff flux over land for coupling @@ -114,6 +122,7 @@ type = real kind = kind_phys intent = in + optional = True [drain_lnd] standard_name = subsurface_runoff_flux_from_land long_name = subsurface runoff flux over land for coupling @@ -122,6 +131,7 @@ type = real kind = kind_phys intent = in + optional = True [cmm_lnd] standard_name = surface_drag_wind_speed_for_momentum_in_air_over_land_from_land long_name = momentum exchange coefficient over land for coupling @@ -130,6 +140,7 @@ type = real kind = kind_phys intent = out + optional = True [chh_lnd] standard_name = surface_drag_mass_flux_for_heat_and_moisture_in_air_over_land_from_land long_name = thermal exchange coefficient over land for coupling @@ -138,6 +149,7 @@ type = real kind = kind_phys intent = in + optional = True [zvfun_lnd] standard_name = function_of_surface_roughness_length_and_green_vegetation_fraction_from_land long_name = function of surface roughness length and green vegetation fraction @@ -146,6 +158,7 @@ type = real kind = kind_phys intent = in + optional = True [sncovr1] standard_name = surface_snow_area_fraction_over_land long_name = surface snow area fraction @@ -170,6 +183,7 @@ type = real kind = kind_phys intent = inout + optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land @@ -194,6 +208,7 @@ type = real kind = kind_phys intent = inout + optional = True [q2mp] standard_name = specific_humidity_at_2m_from_noahmp long_name = 2 meter specific humidity from noahmp @@ -202,6 +217,7 @@ type = real kind = kind_phys intent = inout + optional = True [gflux] standard_name = upward_heat_flux_in_soil_over_land long_name = soil heat flux over land diff --git a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta index 15d9fb5c4..532f0f2fa 100644 --- a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta +++ b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta @@ -232,6 +232,7 @@ type = real kind = kind_phys intent = in + optional = True [dtsfc_med] standard_name = surface_upward_sensible_heat_flux_over_ocean_from_mediator long_name = sfc sensible heat flux input over ocean for coupling @@ -240,6 +241,7 @@ type = real kind = kind_phys intent = in + optional = True [qsurf] standard_name = surface_specific_humidity_over_water long_name = surface air saturation specific humidity over water @@ -280,6 +282,7 @@ type = real kind = kind_phys intent = inout + optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water diff --git a/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta index c44f9d6b5..d1ce6f512 100644 --- a/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta +++ b/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta @@ -124,6 +124,7 @@ type = real kind = kind_phys intent = in + optional = True [dtsfc] standard_name = surface_upward_sensible_heat_flux_from_coupled_process long_name = sfc sensible heat flux for coupling @@ -132,6 +133,7 @@ type = real kind = kind_phys intent = in + optional = True [dusfc] standard_name = surface_x_momentum_flux_from_coupled_process long_name = sfc x momentum flux for coupling @@ -140,6 +142,7 @@ type = real kind = kind_phys intent = in + optional = True [dvsfc] standard_name = surface_y_momentum_flux_from_coupled_process long_name = sfc y momentum flux for coupling @@ -148,6 +151,7 @@ type = real kind = kind_phys intent = in + optional = True [snowd] standard_name = lwe_surface_snow_from_coupled_process long_name = sfc snow depth in meters over sea ice for coupling @@ -188,6 +192,7 @@ type = real kind = kind_phys intent = inout + optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice long_name = kinematic surface upward sensible heat flux over ice diff --git a/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta index 828a83939..e6929b496 100644 --- a/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta +++ b/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta @@ -393,6 +393,7 @@ type = real kind = kind_phys intent = in + optional = True [evapw] standard_name = kinematic_surface_upward_latent_heat_flux_over_water long_name = kinematic surface upward latent heat flux over water @@ -401,6 +402,7 @@ type = real kind = kind_phys intent = in + optional = True [hflxi] standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice long_name = kinematic surface upward sensible heat flux over ice diff --git a/physics/smoke_dust/rrfs_smoke_postpbl.meta b/physics/smoke_dust/rrfs_smoke_postpbl.meta index 8d7481ec4..9a18616b1 100755 --- a/physics/smoke_dust/rrfs_smoke_postpbl.meta +++ b/physics/smoke_dust/rrfs_smoke_postpbl.meta @@ -64,6 +64,7 @@ type = real kind = kind_phys intent = inout + optional = True [rrfs_sd] standard_name = do_smoke_coupling long_name = flag controlling rrfs_sd collection (default off) diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index cbc25a611..521e72c6a 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -307,6 +307,7 @@ type = real kind = kind_phys intent = in + optional = True [t2m] standard_name = air_temperature_at_2m long_name = 2 meter temperature @@ -410,6 +411,7 @@ type = real kind = kind_phys intent = inout + optional = True [tslb] standard_name = soil_temperature_for_land_surface_model long_name = soil temperature for land surface model @@ -418,6 +420,7 @@ type = real kind = kind_phys intent = in + optional = True [vegtype_dom] standard_name = vegetation_type_classification long_name = vegetation type at each grid cell @@ -487,6 +490,7 @@ type = real kind = kind_phys intent = in + optional = True [idat] standard_name = date_and_time_at_model_initialization_in_iso_order long_name = initialization date and time @@ -621,6 +625,7 @@ type = real kind = kind_phys intent = inout + optional = True [tile_num] standard_name = index_of_cubed_sphere_tile long_name = tile number @@ -671,6 +676,7 @@ type = real kind = kind_phys intent = inout + optional = True [nifa] standard_name = mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_of_new_state long_name = number concentration of ice-friendly aerosols @@ -679,6 +685,7 @@ type = real kind = kind_phys intent = inout + optional = True [emanoc] standard_name = emission_of_anothropogenic_for_mp_indir_fdb long_name = emission of anothropogenic for mp indirect feedabck @@ -719,6 +726,7 @@ type = real kind = kind_phys intent = inout + optional = True [coef_bb] standard_name = coef_bb_dc long_name = coef to estimate the fire emission @@ -803,6 +811,7 @@ type = real kind = kind_phys intent = inout + optional = True [drydep_flux_out] standard_name = dry_deposition_flux long_name = rrfs dry deposition flux @@ -843,6 +852,7 @@ type = real kind = kind_phys intent = in + optional = True [ndvel] standard_name = number_of_chemical_species_deposited long_name = number of chemical pbl deposited @@ -858,6 +868,7 @@ type = real kind = kind_phys intent = inout + optional = True [peak_hr_out] standard_name = peak_hr_fire long_name = time_of_peak_fire_emissions diff --git a/physics/tools/get_phi_fv3.meta b/physics/tools/get_phi_fv3.meta index 5c162c746..2bae1e7c9 100644 --- a/physics/tools/get_phi_fv3.meta +++ b/physics/tools/get_phi_fv3.meta @@ -54,6 +54,7 @@ type = real kind = kind_phys intent = inout + optional = True [phii] standard_name = geopotential_at_interface long_name = interface geopotential diff --git a/physics/tools/get_prs_fv3.meta b/physics/tools/get_prs_fv3.meta index 4cdad7566..9352b07cf 100644 --- a/physics/tools/get_prs_fv3.meta +++ b/physics/tools/get_prs_fv3.meta @@ -77,6 +77,7 @@ type = real kind = kind_phys intent = out + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 778930dbaef2b52601f78a4f62df5a1eca5163d6 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 3 Apr 2024 17:24:40 -0600 Subject: [PATCH 181/249] Add missing optional attribute to conditionally allocated variables, part 2 --- .../CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta | 1 + .../UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta | 2 ++ .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta | 2 ++ .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta | 2 ++ .../UFS_SCM_NEPTUNE/GFS_radiation_surface.meta | 2 ++ .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta | 1 + .../UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta | 8 ++++++++ .../GFS_rrtmgp_cloud_overlap.meta | 3 +++ .../UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta | 9 +++++++++ .../UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta | 7 +++++++ .../Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta | 3 +++ physics/MP/GFDL/fv_sat_adj.meta | 1 + physics/MP/Morrison_Gettelman/m_micro.meta | 1 + physics/MP/Morrison_Gettelman/m_micro_pre.meta | 1 + .../Radiation/RRTMGP/rrtmgp_aerosol_optics.meta | 2 ++ physics/Radiation/RRTMGP/rrtmgp_lw_main.meta | 17 +++++++++++++++++ physics/Radiation/RRTMGP/rrtmgp_sw_main.meta | 14 ++++++++++++++ physics/SFC_Models/Land/RUC/lsm_ruc.meta | 4 ++++ 18 files changed, 80 insertions(+) diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta index 54350dbac..230add227 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta @@ -134,6 +134,7 @@ type = real kind = kind_phys intent = inout + optional = True [subcldfrac] standard_name = subgrid_scale_cloud_fraction_from_shoc long_name = subgrid-scale cloud fraction from the SHOC scheme diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta index 8a5ede992..daf1bddee 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.meta @@ -109,6 +109,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_frac] standard_name = total_cloud_fraction long_name = layer total cloud fraction @@ -125,6 +126,7 @@ type = real kind = kind_phys intent = in + optional = True [deltaZ] standard_name = layer_thickness long_name = layer_thickness diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta index 1cdcc8863..2a15cf16f 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta @@ -789,6 +789,7 @@ type = real kind = kind_phys intent = inout + optional = True [albivis_ice] standard_name = surface_albedo_diffuse_visible_over_ice long_name = diffuse surface albedo visible band over ice @@ -806,6 +807,7 @@ type = real kind = kind_phys intent = inout + optional = True [emiss_lnd] standard_name = surface_longwave_emissivity_over_land long_name = surface lw emissivity in fraction over land diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta index 20944a8b2..2eddb777b 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta @@ -774,6 +774,7 @@ type = real kind = kind_phys intent = inout + optional = True [albivis_ice] standard_name = surface_albedo_diffuse_visible_over_ice long_name = diffuse surface albedo visible band over ice @@ -791,6 +792,7 @@ type = real kind = kind_phys intent = inout + optional = True [emiss_lnd] standard_name = surface_longwave_emissivity_over_land long_name = surface lw emissivity in fraction over land diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta index 8d1148d75..ac5e9e3fe 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta @@ -474,6 +474,7 @@ type = real kind = kind_phys intent = in + optional = True [albivis_ice] standard_name = surface_albedo_diffuse_visible_over_ice long_name = diffuse surface albedo visible band over ice @@ -491,6 +492,7 @@ type = real kind = kind_phys intent = in + optional = True [semisbase] standard_name = baseline_surface_longwave_emissivity long_name = baseline surface lw emissivity in fraction diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta index 8c1c30a89..b53647af5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta @@ -922,6 +922,7 @@ type = real kind = kind_phys intent = in + optional = True [effrr_in] standard_name = effective_radius_of_stratiform_cloud_rain_particle long_name = effective radius of cloud rain particle in micrometers diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta index 8b30b5a69..87cc1c7d0 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta @@ -268,6 +268,7 @@ type = real kind = kind_phys intent = in + optional = True [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP long_name = air pressure at vertical layer for radiation calculation @@ -276,6 +277,7 @@ type = real kind = kind_phys intent = in + optional = True [tv_lay] standard_name = virtual_temperature long_name = layer virtual temperature @@ -293,6 +295,7 @@ type = real kind = kind_phys intent = in + optional = True [qs_lay] standard_name = saturation_vapor_pressure long_name = saturation vapor pressure @@ -380,6 +383,7 @@ type = real kind = kind_phys intent = inout + optional = True [qci_conv] standard_name = convective_cloud_condesate_after_rainout long_name = convective cloud condesate after rainout @@ -621,6 +625,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_pbl_iwp] standard_name = MYNN_SGS_cloud_ice_water_path long_name = layer convective cloud ice water path @@ -629,6 +634,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_pbl_reliq] standard_name = mean_effective_radius_for_liquid_MYNN_SGS_cloud long_name = mean effective radius for liquid MYNN_SGS cloud @@ -637,6 +643,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_pbl_reice] standard_name = mean_effective_radius_for_ice_MYNN_SGS_cloud long_name = mean effective radius for ice MYNN_SGS cloud @@ -645,6 +652,7 @@ type = real kind = kind_phys intent = inout + optional = True [lwp_ex] standard_name = liq_water_path_from_microphysics long_name = total liquid water path from explicit microphysics diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta index 7b0d5845e..5b2907492 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta @@ -68,6 +68,7 @@ type = real kind = kind_phys intent = in + optional = True [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP long_name = air pressure at vertical layer for radiation calculation @@ -76,6 +77,7 @@ type = real kind = kind_phys intent = in + optional = True [tv_lay] standard_name = virtual_temperature long_name = layer virtual temperature @@ -213,6 +215,7 @@ type = real kind = kind_phys intent = in + optional = True [top_at_1] standard_name = flag_for_vertical_ordering_in_radiation long_name = flag for vertical ordering in radiation diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta index a02ba2276..5d67afcd8 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.meta @@ -166,6 +166,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxlwUP_allsky] standard_name = RRTMGP_lw_flux_profile_upward_allsky long_name = RRTMGP upward longwave all-sky flux profile @@ -174,6 +175,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxlwDOWN_allsky] standard_name = RRTMGP_lw_flux_profile_downward_allsky long_name = RRTMGP downward longwave all-sky flux profile @@ -182,6 +184,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxlwUP_clrsky] standard_name = RRTMGP_lw_flux_profile_upward_clrsky long_name = RRTMGP upward longwave clr-sky flux profile @@ -190,6 +193,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxlwDOWN_clrsky] standard_name = RRTMGP_lw_flux_profile_downward_clrsky long_name = RRTMGP downward longwave clr-sky flux profile @@ -198,6 +202,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxswUP_allsky] standard_name = RRTMGP_sw_flux_profile_upward_allsky long_name = RRTMGP upward shortwave all-sky flux profile @@ -206,6 +211,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxswDOWN_allsky] standard_name = RRTMGP_sw_flux_profile_downward_allsky long_name = RRTMGP downward shortwave all-sky flux profile @@ -214,6 +220,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxswUP_clrsky] standard_name = RRTMGP_sw_flux_profile_upward_clrsky long_name = RRTMGP upward shortwave clr-sky flux profile @@ -222,6 +229,7 @@ type = real kind = kind_phys intent = in + optional = True [fluxswDOWN_clrsky] standard_name = RRTMGP_sw_flux_profile_downward_clrsky long_name = RRTMGP downward shortwave clr-sky flux profile @@ -230,6 +238,7 @@ type = real kind = kind_phys intent = in + optional = True [raddt] standard_name = time_step_for_radiation long_name = radiation time step diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta index 4b2e192fb..59d7cd68a 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta @@ -32,6 +32,7 @@ type = character kind = len=128 intent = out + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -277,6 +278,7 @@ type = real kind = kind_phys intent = inout + optional = True [p_lev] standard_name = air_pressure_at_interface_for_RRTMGP long_name = air pressure at vertical interface for radiation calculation @@ -285,6 +287,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_lay] standard_name = air_temperature_at_layer_for_RRTMGP long_name = air temperature at vertical layer for radiation calculation @@ -293,6 +296,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_lev] standard_name = air_temperature_at_interface_for_RRTMGP long_name = air temperature at vertical interface for radiation calculation @@ -301,6 +305,7 @@ type = real kind = kind_phys intent = inout + optional = True [deltaZ] standard_name = layer_thickness long_name = layer_thickness @@ -473,6 +478,7 @@ type = character kind = len=* intent = in + optional = True [coszdg] standard_name = cosine_of_solar_zenith_angle_on_radiation_timestep long_name = daytime mean cosz over rad call period @@ -505,6 +511,7 @@ type = real kind = kind_phys intent = inout + optional = True [nday] standard_name = daytime_points_dimension long_name = daytime points dimension diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta index a8a74ff74..b2187f0c5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.meta @@ -408,6 +408,7 @@ type = real kind = kind_phys intent = in + optional = True [t_lay] standard_name = air_temperature_of_new_state long_name = model layer mean temperature updated by physics @@ -440,6 +441,7 @@ type = real kind = kind_phys intent = in + optional = True [flux2D_lwDOWN] standard_name = RRTMGP_lw_flux_profile_downward_allsky_on_radiation_timestep long_name = RRTMGP downward longwave all-sky flux profile @@ -448,6 +450,7 @@ type = real kind = kind_phys intent = in + optional = True [pert_radtend] standard_name = flag_for_stochastic_radiative_heating_perturbations long_name = flag for stochastic radiative heating perturbations diff --git a/physics/MP/GFDL/fv_sat_adj.meta b/physics/MP/GFDL/fv_sat_adj.meta index fbcb57c76..d5194bf99 100644 --- a/physics/MP/GFDL/fv_sat_adj.meta +++ b/physics/MP/GFDL/fv_sat_adj.meta @@ -252,6 +252,7 @@ type = real kind = kind_dyn intent = inout + optional = True [qv] standard_name = water_vapor_specific_humidity_at_Lagrangian_surface long_name = water vapor specific humidity updated by fast physics at Lagrangian surface diff --git a/physics/MP/Morrison_Gettelman/m_micro.meta b/physics/MP/Morrison_Gettelman/m_micro.meta index cfdda96e8..4a1fa98a6 100644 --- a/physics/MP/Morrison_Gettelman/m_micro.meta +++ b/physics/MP/Morrison_Gettelman/m_micro.meta @@ -695,6 +695,7 @@ type = real kind = kind_phys intent = inout + optional = True [kcbl] standard_name = vertical_index_at_cloud_base long_name = vertical index at cloud base diff --git a/physics/MP/Morrison_Gettelman/m_micro_pre.meta b/physics/MP/Morrison_Gettelman/m_micro_pre.meta index f552e14af..313ef0c63 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_pre.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_pre.meta @@ -217,6 +217,7 @@ type = real kind = kind_phys intent = inout + optional = True [clw_water] standard_name = cloud_condensed_water_mixing_ratio_convective_transport_tracer long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array diff --git a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta index ab49beebc..4212adcc6 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.meta @@ -88,6 +88,7 @@ type = real kind = kind_phys intent = in + optional = True [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP long_name = air pressure at vertical layer for radiation calculation @@ -96,6 +97,7 @@ type = real kind = kind_phys intent = in + optional = True [p_lk] standard_name = dimensionless_exner_function long_name = dimensionless Exner function at model layer centers diff --git a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta index 255f2388a..b49130bd6 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta @@ -115,6 +115,7 @@ type = character kind = len=* intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -315,6 +316,7 @@ type = real kind = kind_phys intent = in + optional = True [p_lev] standard_name = air_pressure_at_interface_for_RRTMGP long_name = air pressure at vertical interface for radiation calculation @@ -323,6 +325,7 @@ type = real kind = kind_phys intent = in + optional = True [t_lay] standard_name = air_temperature_at_layer_for_RRTMGP long_name = air temperature at vertical layer for radiation calculation @@ -331,6 +334,7 @@ type = real kind = kind_phys intent = in + optional = True [t_lev] standard_name = air_temperature_at_interface_for_RRTMGP long_name = air temperature at vertical interface for radiation calculation @@ -339,6 +343,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_o2] standard_name = volume_mixing_ratio_for_o2 long_name = molar mixing ratio of o2 in with respect to dry air @@ -518,6 +523,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_iwp] standard_name = MYNN_SGS_cloud_ice_water_path long_name = layer convective cloud ice water path @@ -526,6 +532,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_reliq] standard_name = mean_effective_radius_for_liquid_MYNN_SGS_cloud long_name = mean effective radius for liquid MYNN_SGS cloud @@ -534,6 +541,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_reice] standard_name = mean_effective_radius_for_ice_MYNN_SGS_cloud long_name = mean effective radius for ice MYNN_SGS cloud @@ -542,6 +550,7 @@ type = real kind = kind_phys intent = in + optional = True [cloud_overlap_param] standard_name = cloud_overlap_param long_name = cloud overlap parameter @@ -559,6 +568,7 @@ type = character kind = len=* intent = in + optional = True [aerlw_tau] standard_name = aerosol_optical_depth_for_longwave_bands_01_16 long_name = aerosol optical depth for longwave bands 01-16 @@ -591,6 +601,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxlwDOWN_radtime] standard_name = RRTMGP_lw_flux_profile_downward_allsky_on_radiation_timestep long_name = RRTMGP downward longwave all-sky flux profile @@ -599,6 +610,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxlwUP_allsky] standard_name = RRTMGP_lw_flux_profile_upward_allsky long_name = RRTMGP upward longwave all-sky flux profile @@ -607,6 +619,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxlwDOWN_allsky] standard_name = RRTMGP_lw_flux_profile_downward_allsky long_name = RRTMGP downward longwave all-sky flux profile @@ -615,6 +628,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxlwUP_clrsky] standard_name = RRTMGP_lw_flux_profile_upward_clrsky long_name = RRTMGP upward longwave clr-sky flux profile @@ -623,6 +637,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxlwDOWN_clrsky] standard_name = RRTMGP_lw_flux_profile_downward_clrsky long_name = RRTMGP downward longwave clr-sky flux profile @@ -631,6 +646,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxlwUP_jac] standard_name = RRTMGP_jacobian_of_lw_flux_upward long_name = RRTMGP Jacobian upward longwave flux profile @@ -639,6 +655,7 @@ type = real kind = kind_phys intent = inout + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta index fdcb95ce0..9bfda6fa1 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_sw_main.meta @@ -115,6 +115,7 @@ type = character kind = len=* intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP @@ -306,6 +307,7 @@ type = real kind = kind_phys intent = in + optional = True [p_lev] standard_name = air_pressure_at_interface_for_RRTMGP long_name = air pressure at vertical interface for radiation calculation @@ -314,6 +316,7 @@ type = real kind = kind_phys intent = in + optional = True [t_lay] standard_name = air_temperature_at_layer_for_RRTMGP long_name = air temperature at vertical layer for radiation calculation @@ -322,6 +325,7 @@ type = real kind = kind_phys intent = in + optional = True [t_lev] standard_name = air_temperature_at_interface_for_RRTMGP long_name = air temperature at vertical interface for radiation calculation @@ -330,6 +334,7 @@ type = real kind = kind_phys intent = in + optional = True [vmr_o2] standard_name = volume_mixing_ratio_for_o2 long_name = molar mixing ratio of o2 in with respect to dry air @@ -509,6 +514,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_iwp] standard_name = MYNN_SGS_cloud_ice_water_path long_name = layer convective cloud ice water path @@ -517,6 +523,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_reliq] standard_name = mean_effective_radius_for_liquid_MYNN_SGS_cloud long_name = mean effective radius for liquid MYNN_SGS cloud @@ -525,6 +532,7 @@ type = real kind = kind_phys intent = in + optional = True [cld_pbl_reice] standard_name = mean_effective_radius_for_ice_MYNN_SGS_cloud long_name = mean effective radius for ice MYNN_SGS cloud @@ -533,6 +541,7 @@ type = real kind = kind_phys intent = in + optional = True [cloud_overlap_param] standard_name = cloud_overlap_param long_name = cloud overlap parameter @@ -582,6 +591,7 @@ type = character kind = len=* intent = in + optional = True [aersw_tau] standard_name = aerosol_optical_depth_for_shortwave_bands_01_16 long_name = aerosol optical depth for shortwave bands 01-16 @@ -629,6 +639,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxswDOWN_allsky] standard_name = RRTMGP_sw_flux_profile_downward_allsky long_name = RRTMGP downward shortwave all-sky flux profile @@ -637,6 +648,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxswUP_clrsky] standard_name = RRTMGP_sw_flux_profile_upward_clrsky long_name = RRTMGP upward shortwave clr-sky flux profile @@ -645,6 +657,7 @@ type = real kind = kind_phys intent = inout + optional = True [fluxswDOWN_clrsky] standard_name = RRTMGP_sw_flux_profile_downward_clrsky long_name = RRTMGP downward shortwave clr-sky flux profile @@ -653,6 +666,7 @@ type = real kind = kind_phys intent = inout + optional = True [cldtausw] standard_name = cloud_optical_depth_layers_at_0p55mu_band long_name = approx .55mu band layer cloud optical depth diff --git a/physics/SFC_Models/Land/RUC/lsm_ruc.meta b/physics/SFC_Models/Land/RUC/lsm_ruc.meta index 88dd81001..8cb4ec106 100644 --- a/physics/SFC_Models/Land/RUC/lsm_ruc.meta +++ b/physics/SFC_Models/Land/RUC/lsm_ruc.meta @@ -412,6 +412,7 @@ type = real kind = kind_phys intent = inout + optional = True [albivis_ice] standard_name = surface_albedo_diffuse_visible_over_ice long_name = diffuse surface albedo visible band over ice @@ -429,6 +430,7 @@ type = real kind = kind_phys intent = inout + optional = True [zs] standard_name = depth_of_soil_layers long_name = depth of soil levels for land surface model @@ -1670,6 +1672,7 @@ type = real kind = kind_phys intent = out + optional = True [albivis_ice] standard_name = surface_albedo_diffuse_visible_over_ice long_name = diffuse surface albedo visible band over ice @@ -1687,6 +1690,7 @@ type = real kind = kind_phys intent = out + optional = True [rhosnf] standard_name = lsm_internal_surface_frozen_precipitation_density long_name = density of frozen precipitation From d1e97a1ad74bd87c2787569ddb512b9ceb07a8f9 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 3 Apr 2024 19:22:20 -0600 Subject: [PATCH 182/249] Add missing optional attribute to conditionally allocated variables, part 3 --- physics/CONV/C3/cu_c3_driver.meta | 8 +++++++ physics/CONV/C3/cu_c3_driver_post.meta | 6 +++++ physics/CONV/C3/cu_c3_driver_pre.meta | 7 ++++++ physics/CONV/Chikira_Sugiyama/cs_conv.meta | 1 + .../CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta | 1 + physics/CONV/Grell_Freitas/cu_gf_driver.meta | 10 ++++++++ .../CONV/Grell_Freitas/cu_gf_driver_post.meta | 5 ++++ .../CONV/Grell_Freitas/cu_gf_driver_pre.meta | 7 ++++++ physics/CONV/nTiedtke/cu_ntiedtke.meta | 2 ++ physics/CONV/nTiedtke/cu_ntiedtke_post.meta | 1 + physics/CONV/nTiedtke/cu_ntiedtke_pre.meta | 3 +++ physics/MP/Morrison_Gettelman/m_micro.meta | 6 +++++ .../MP/Morrison_Gettelman/m_micro_post.meta | 6 +++++ .../MP/Morrison_Gettelman/m_micro_pre.meta | 7 ++++++ physics/PBL/SHOC/shoc.meta | 1 + physics/SFC_Models/Lake/CLM/clm_lake.meta | 21 ++++++++++++++++ physics/SFC_Models/Land/RUC/lsm_ruc.meta | 14 +++++++++++ physics/smoke_dust/rrfs_smoke_wrapper.meta | 24 +++++++++++++++++++ 18 files changed, 130 insertions(+) diff --git a/physics/CONV/C3/cu_c3_driver.meta b/physics/CONV/C3/cu_c3_driver.meta index 338954ae3..f6dc927c0 100644 --- a/physics/CONV/C3/cu_c3_driver.meta +++ b/physics/CONV/C3/cu_c3_driver.meta @@ -156,6 +156,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout + optional = True [cactiv_m] standard_name = counter_for_grell_freitas_mid_level_convection long_name = mid-level cloud convective activity memory @@ -163,6 +164,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout + optional = True [g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -219,6 +221,7 @@ type = real kind = kind_phys intent = in + optional = True [forceqv_spechum] standard_name = tendendy_of_specific_humidity_due_to_nonphysics long_name = moisture tendency due to dynamics only @@ -227,6 +230,7 @@ type = real kind = kind_phys intent = in + optional = True [tmf] standard_name = tendency_of_vertically_diffused_tracer_concentration long_name = updated tendency of the tracers due to vertical diffusion in PBL scheme @@ -441,6 +445,7 @@ type = real kind = kind_phys intent = inout + optional = True [cliw] standard_name = ice_water_mixing_ratio_convective_transport_tracer long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array @@ -639,6 +644,7 @@ dimensions = () type = logical intent = in + optional = True [fh_dfi_radar] standard_name = forecast_lead_times_bounding_radar_derived_temperature_or_convection_suppression_intervals long_name = forecast lead times bounding radar derived temperature or convection suppression intervals @@ -669,6 +675,7 @@ type = real kind = kind_phys intent = in + optional = True [ca_deep] standard_name = cellular_automata_area_fraction_for_deep_convection_from_coupled_process long_name = fraction of cellular automata for deep convection @@ -694,6 +701,7 @@ type = real kind = kind_phys intent = out + optional = True [maxMF] standard_name = maximum_mass_flux long_name = maximum mass flux within a column diff --git a/physics/CONV/C3/cu_c3_driver_post.meta b/physics/CONV/C3/cu_c3_driver_post.meta index b1c5e8b49..4e4122b69 100644 --- a/physics/CONV/C3/cu_c3_driver_post.meta +++ b/physics/CONV/C3/cu_c3_driver_post.meta @@ -45,6 +45,7 @@ type = real kind = kind_phys intent = out + optional = True [prevsq] standard_name = specific_humidity_on_previous_timestep long_name = moisture from previous time step @@ -61,6 +62,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [cactiv_m] standard_name = counter_for_grell_freitas_mid_level_convection long_name = midlevel convective activity memory @@ -68,6 +70,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [conv_act] standard_name = consecutive_calls_for_grell_freitas_convection long_name = Memory counter for GF @@ -76,6 +79,7 @@ type = real kind = kind_phys intent = out + optional = True [conv_act_m] standard_name = consecutive_calls_for_grell_freitas_mid_level_convection long_name = Memory counter for GF midlevel @@ -84,6 +88,7 @@ type = real kind = kind_phys intent = out + optional = True [dt] standard_name = timestep_for_physics long_name = physics time step @@ -116,6 +121,7 @@ type = real kind = kind_phys intent = in + optional = True [refl_10cm] standard_name = radar_reflectivity_10cm long_name = instantaneous refl_10cm diff --git a/physics/CONV/C3/cu_c3_driver_pre.meta b/physics/CONV/C3/cu_c3_driver_pre.meta index c1d46d6db..6e0b30045 100644 --- a/physics/CONV/C3/cu_c3_driver_pre.meta +++ b/physics/CONV/C3/cu_c3_driver_pre.meta @@ -68,6 +68,7 @@ type = real kind = kind_phys intent = in + optional = True [prevsq] standard_name = specific_humidity_on_previous_timestep long_name = moisture from previous time step @@ -85,6 +86,7 @@ type = real kind = kind_phys intent = out + optional = True [forceq] standard_name = tendendy_of_specific_humidity_due_to_nonphysics long_name = moisture tendency due to dynamics only @@ -93,6 +95,7 @@ type = real kind = kind_phys intent = out + optional = True [cactiv] standard_name = counter_for_grell_freitas_convection long_name = convective activity memory @@ -100,6 +103,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = out + optional = True [cactiv_m] standard_name = counter_for_grell_freitas_mid_level_convection long_name = midlevel convective activity memory @@ -107,6 +111,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = out + optional = True [conv_act] standard_name = consecutive_calls_for_grell_freitas_convection long_name = Memory counter for GF @@ -115,6 +120,7 @@ type = real kind = kind_phys intent = in + optional = True [conv_act_m] standard_name = consecutive_calls_for_grell_freitas_mid_level_convection long_name = Memory counter for GF midlevel @@ -123,6 +129,7 @@ type = real kind = kind_phys intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv.meta b/physics/CONV/Chikira_Sugiyama/cs_conv.meta index 08d348562..ee8e1de55 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv.meta @@ -216,6 +216,7 @@ type = real kind = kind_phys intent = inout + optional = True [mype] standard_name = mpi_rank long_name = current MPI rank diff --git a/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta index 230add227..88c3d27c7 100644 --- a/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta +++ b/physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.meta @@ -143,6 +143,7 @@ type = real kind = kind_phys intent = inout + optional = True [prcp] standard_name = lwe_thickness_of_explicit_precipitation_amount long_name = explicit precipitation (rain, ice, snow, graupel, ...) on physics timestep diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.meta b/physics/CONV/Grell_Freitas/cu_gf_driver.meta index 4c737c1c6..d84f6f8b1 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.meta @@ -128,6 +128,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout + optional = True [cactiv_m] standard_name = counter_for_grell_freitas_mid_level_convection long_name = mid-level cloud convective activity memory @@ -135,6 +136,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout + optional = True [g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -175,6 +177,7 @@ type = real kind = kind_phys intent = in + optional = True [forceqv_spechum] standard_name = tendendy_of_specific_humidity_due_to_nonphysics long_name = moisture tendency due to dynamics only @@ -183,6 +186,7 @@ type = real kind = kind_phys intent = in + optional = True [phil] standard_name = geopotential long_name = layer geopotential @@ -331,6 +335,7 @@ type = real kind = kind_phys intent = inout + optional = True [cliw] standard_name = ice_water_mixing_ratio_convective_transport_tracer long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) in the convectively transported tracer array @@ -529,6 +534,7 @@ dimensions = () type = logical intent = in + optional = True [fh_dfi_radar] standard_name = forecast_lead_times_bounding_radar_derived_temperature_or_convection_suppression_intervals long_name = forecast lead times bounding radar derived temperature or convection suppression intervals @@ -559,6 +565,7 @@ type = real kind = kind_phys intent = in + optional = True [maxupmf] standard_name = maximum_convective_updraft_mass_flux long_name = maximum convective updraft mass flux within a column @@ -567,6 +574,7 @@ type = real kind = kind_phys intent = out + optional = True [maxMF] standard_name = maximum_mass_flux long_name = maximum mass flux within a column @@ -612,6 +620,7 @@ type = real kind = kind_phys intent = in + optional = True [spp_cu_deep] standard_name = control_for_deep_convection_spp_perturbations long_name = control for deep convection spp perturbations @@ -658,6 +667,7 @@ type = real kind = kind_phys intent = inout + optional = True [kdt] standard_name = index_of_timestep long_name = current forecast iteration diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta b/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta index e3034403c..302fec1d7 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_post.meta @@ -45,6 +45,7 @@ type = real kind = kind_phys intent = out + optional = True [prevsq] standard_name = specific_humidity_on_previous_timestep long_name = moisture from previous time step @@ -61,6 +62,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [cactiv_m] standard_name = counter_for_grell_freitas_mid_level_convection long_name = midlevel convective activity memory @@ -68,6 +70,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = in + optional = True [conv_act] standard_name = consecutive_calls_for_grell_freitas_convection long_name = Memory counter for GF @@ -76,6 +79,7 @@ type = real kind = kind_phys intent = out + optional = True [conv_act_m] standard_name = consecutive_calls_for_grell_freitas_mid_level_convection long_name = Memory counter for GF midlevel @@ -84,6 +88,7 @@ type = real kind = kind_phys intent = out + optional = True [rrfs_sd] standard_name = do_smoke_coupling long_name = flag controlling rrfs_sd collection diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta index 23d753feb..105461758 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver_pre.meta @@ -68,6 +68,7 @@ type = real kind = kind_phys intent = in + optional = True [prevsq] standard_name = specific_humidity_on_previous_timestep long_name = moisture from previous time step @@ -85,6 +86,7 @@ type = real kind = kind_phys intent = out + optional = True [forceq] standard_name = tendendy_of_specific_humidity_due_to_nonphysics long_name = moisture tendency due to dynamics only @@ -93,6 +95,7 @@ type = real kind = kind_phys intent = out + optional = True [cactiv] standard_name = counter_for_grell_freitas_convection long_name = convective activity memory @@ -100,6 +103,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = out + optional = True [cactiv_m] standard_name = counter_for_grell_freitas_mid_level_convection long_name = midlevel convective activity memory @@ -107,6 +111,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = out + optional = True [conv_act] standard_name = consecutive_calls_for_grell_freitas_convection long_name = Memory counter for GF @@ -115,6 +120,7 @@ type = real kind = kind_phys intent = in + optional = True [conv_act_m] standard_name = consecutive_calls_for_grell_freitas_mid_level_convection long_name = Memory counter for GF midlevel @@ -123,6 +129,7 @@ type = real kind = kind_phys intent = in + optional = True [rrfs_sd] standard_name = do_smoke_coupling long_name = flag controlling rrfs_sd collection diff --git a/physics/CONV/nTiedtke/cu_ntiedtke.meta b/physics/CONV/nTiedtke/cu_ntiedtke.meta index 42ffaf669..3e1755a5a 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke.meta @@ -125,6 +125,7 @@ type = real kind = kind_phys intent = in + optional = True [ptf] standard_name = tendency_of_air_temperature_due_to_nonphysics long_name = temperature tendency due to dynamics only @@ -133,6 +134,7 @@ type = real kind = kind_phys intent = in + optional = True [clw] standard_name = convective_transportable_tracers long_name = array to contain cloud water and other tracers diff --git a/physics/CONV/nTiedtke/cu_ntiedtke_post.meta b/physics/CONV/nTiedtke/cu_ntiedtke_post.meta index 282b4c9de..db51223d3 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke_post.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke_post.meta @@ -31,6 +31,7 @@ type = real kind = kind_phys intent = out + optional = True [prevsq] standard_name = specific_humidity_on_previous_timestep long_name = moisture from previous time step diff --git a/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta b/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta index 8d1baae8d..1938ee711 100644 --- a/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta +++ b/physics/CONV/nTiedtke/cu_ntiedtke_pre.meta @@ -68,6 +68,7 @@ type = real kind = kind_phys intent = in + optional = True [prevsq] standard_name = specific_humidity_on_previous_timestep long_name = moisture from previous time step @@ -85,6 +86,7 @@ type = real kind = kind_phys intent = out + optional = True [forceq] standard_name = tendendy_of_specific_humidity_due_to_nonphysics long_name = moisture tendency due to dynamics only @@ -93,6 +95,7 @@ type = real kind = kind_phys intent = out + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/MP/Morrison_Gettelman/m_micro.meta b/physics/MP/Morrison_Gettelman/m_micro.meta index 4a1fa98a6..f1e13a78c 100644 --- a/physics/MP/Morrison_Gettelman/m_micro.meta +++ b/physics/MP/Morrison_Gettelman/m_micro.meta @@ -647,6 +647,7 @@ type = real kind = kind_phys intent = inout + optional = True [snw_io] standard_name = local_snow_water_mixing_ratio long_name = ratio of mass of snow water to mass of dry air plus vapor (without condensates) local to physics @@ -655,6 +656,7 @@ type = real kind = kind_phys intent = inout + optional = True [qgl_io] standard_name = local_graupel_mixing_ratio long_name = ratio of mass of graupel to mass of dry air plus vapor (without condensates) local to physics @@ -663,6 +665,7 @@ type = real kind = kind_phys intent = inout + optional = True [ncpr_io] standard_name = local_rain_number_concentration long_name = number concentration of rain local to physics @@ -671,6 +674,7 @@ type = real kind = kind_phys intent = inout + optional = True [ncps_io] standard_name = local_snow_number_concentration long_name = number concentration of snow local to physics @@ -679,6 +683,7 @@ type = real kind = kind_phys intent = inout + optional = True [ncgl_io] standard_name = local_graupel_number_concentration long_name = number concentration of graupel local to physics @@ -687,6 +692,7 @@ type = real kind = kind_phys intent = inout + optional = True [clls_io] standard_name = cloud_fraction_for_MG long_name = cloud fraction used by Morrison-Gettelman MP diff --git a/physics/MP/Morrison_Gettelman/m_micro_post.meta b/physics/MP/Morrison_Gettelman/m_micro_post.meta index 922dadc15..c41a07909 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_post.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_post.meta @@ -44,6 +44,7 @@ type = real kind = kind_phys intent = in + optional = True [ncps] standard_name = local_snow_number_concentration long_name = number concentration of snow local to physics @@ -52,6 +53,7 @@ type = real kind = kind_phys intent = in + optional = True [ncgl] standard_name = local_graupel_number_concentration long_name = number concentration of graupel local to physics @@ -60,6 +62,7 @@ type = real kind = kind_phys intent = in + optional = True [qrn] standard_name = local_rain_water_mixing_ratio long_name = ratio of mass of rain water to mass of dry air plus vapor (without condensates) local to physics @@ -68,6 +71,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsnw] standard_name = local_snow_water_mixing_ratio long_name = ratio of mass of snow water to mass of dry air plus vapor (without condensates) local to physics @@ -76,6 +80,7 @@ type = real kind = kind_phys intent = inout + optional = True [qgl] standard_name = local_graupel_mixing_ratio long_name = ratio of mass of graupel to mass of dry air plus vapor (without condensates) local to physics @@ -84,6 +89,7 @@ type = real kind = kind_phys intent = inout + optional = True [gq0_ice] standard_name = cloud_ice_mixing_ratio_of_new_state long_name = ratio of mass of ice water to mass of dry air plus vapor (without condensates) updated by physics diff --git a/physics/MP/Morrison_Gettelman/m_micro_pre.meta b/physics/MP/Morrison_Gettelman/m_micro_pre.meta index 313ef0c63..2b10edba2 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_pre.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_pre.meta @@ -121,6 +121,7 @@ type = real kind = kind_phys intent = in + optional = True [cnvc] standard_name = convective_cloud_cover long_name = convective cloud cover @@ -169,6 +170,7 @@ type = real kind = kind_phys intent = inout + optional = True [qsnw] standard_name = local_snow_water_mixing_ratio long_name = ratio of mass of snow water to mass of dry air plus vapor (without condensates) local to physics @@ -177,6 +179,7 @@ type = real kind = kind_phys intent = inout + optional = True [qgl] standard_name = local_graupel_mixing_ratio long_name = ratio of mass of graupel to mass of dry air plus vapor (without condensates) local to physics @@ -185,6 +188,7 @@ type = real kind = kind_phys intent = inout + optional = True [ncpr] standard_name = local_rain_number_concentration long_name = number concentration of rain local to physics @@ -193,6 +197,7 @@ type = real kind = kind_phys intent = inout + optional = True [ncps] standard_name = local_snow_number_concentration long_name = number concentration of snow local to physics @@ -201,6 +206,7 @@ type = real kind = kind_phys intent = inout + optional = True [ncgl] standard_name = local_graupel_number_concentration long_name = number concentration of graupel local to physics @@ -209,6 +215,7 @@ type = real kind = kind_phys intent = inout + optional = True [cld_frc_MG] standard_name = cloud_fraction_for_MG long_name = cloud fraction used by Morrison-Gettelman MP diff --git a/physics/PBL/SHOC/shoc.meta b/physics/PBL/SHOC/shoc.meta index 88903fb09..7bfb3fd9b 100644 --- a/physics/PBL/SHOC/shoc.meta +++ b/physics/PBL/SHOC/shoc.meta @@ -368,6 +368,7 @@ type = real kind = kind_phys intent = inout + optional = True [tke] standard_name = turbulent_kinetic_energy_convective_transport_tracer long_name = turbulent kinetic energy in the convectively transported tracer array diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.meta b/physics/SFC_Models/Lake/CLM/clm_lake.meta index abb361859..965981e91 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.meta +++ b/physics/SFC_Models/Lake/CLM/clm_lake.meta @@ -101,6 +101,7 @@ dimensions = () type = logical intent = in + optional = True [dtp] standard_name = timestep_for_physics long_name = physics timestep @@ -124,6 +125,7 @@ type = real kind = kind_phys intent = inout + optional = True [frac_grid] standard_name = flag_for_fractional_landmask long_name = flag for fractional grid @@ -299,6 +301,7 @@ type = real kind = kind_phys intent = inout + optional = True [wind] standard_name = wind_speed_at_lowest_model_layer long_name = wind speed at lowest model level @@ -539,6 +542,7 @@ type = real kind = kind_phys intent = inout + optional = True [zorlw] standard_name = surface_roughness_length_over_water long_name = surface roughness length over water @@ -611,6 +615,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout + optional = True [cannot_freeze] standard_name = clm_lake_cannot_freeze long_name = lake at this point is so salty it cannot freeze @@ -618,6 +623,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = inout + optional = True [savedtke12d] standard_name = top_level_eddy_conductivity_from_previous_timestep_in_clm_lake_model long_name = top level eddy conductivity from previous timestep in clm lake model @@ -626,6 +632,7 @@ type = real kind = kind_phys intent = inout + optional = True [snowdp2d] standard_name = actual_snow_depth_in_clm_lake_model long_name = actual acc snow depth over lake in clm lake model @@ -634,6 +641,7 @@ type = real kind = kind_phys intent = inout + optional = True [h2osno2d] standard_name = water_equivalent_accumulated_snow_depth_in_clm_lake_model long_name = water equiv of acc snow depth over lake in clm lake model @@ -642,6 +650,7 @@ type = real kind = kind_phys intent = inout + optional = True [snl2d] standard_name = snow_layers_in_clm_lake_model long_name = snow layers in clm lake model (treated as integer) @@ -650,6 +659,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_grnd2d] standard_name = skin_temperature_from_lake_model long_name = skin_temperature_from_lake_model @@ -658,6 +668,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_lake3d] standard_name = lake_layer_temperature_from_clm_lake_model long_name = lake layer temperature from clm lake model @@ -666,6 +677,7 @@ type = real kind = kind_phys intent = inout + optional = True [lake_icefrac3d] standard_name = lake_fractional_ice_cover_on_clm_lake_levels long_name = lake fractional ice cover on clm lake levels @@ -674,6 +686,7 @@ type = real kind = kind_phys intent = inout + optional = True [t_soisno3d] standard_name = soil_or_snow_layer_temperature_from_clm_lake_model long_name = soil or snow layer temperature from clm lake model @@ -682,6 +695,7 @@ type = real kind = kind_phys intent = inout + optional = True [h2osoi_ice3d] standard_name = soil_ice_water_content_in_clm_lake_model long_name = soil ice water content in clm lake model @@ -690,6 +704,7 @@ type = real kind = kind_phys intent = inout + optional = True [h2osoi_liq3d] standard_name = soil_liquid_water_content_in_clm_lake_model long_name = soil liquid water content in clm lake model @@ -698,6 +713,7 @@ type = real kind = kind_phys intent = inout + optional = True [h2osoi_vol3d] standard_name = volumetric_soil_water_in_clm_lake_model long_name = volumetric soil water in clm lake model @@ -706,6 +722,7 @@ type = real kind = kind_phys intent = inout + optional = True [z3d] standard_name = snow_level_depth_in_clm_lake_model long_name = snow level depth in clm lake model @@ -714,6 +731,7 @@ type = real kind = kind_phys intent = inout + optional = True [dz3d] standard_name = snow_level_thickness_in_clm_lake_model long_name = snow level thickness in clm lake model @@ -722,6 +740,7 @@ type = real kind = kind_phys intent = inout + optional = True [zi3d] standard_name = snow_interface_depth_in_clm_lake_model long_name = snow interface_depth in clm lake model @@ -730,6 +749,7 @@ type = real kind = kind_phys intent = inout + optional = True [clm_lakedepth] standard_name = clm_lake_depth long_name = clm internal copy of lake depth with 10.0 replaced by default lake depth @@ -738,6 +758,7 @@ type = real kind = kind_phys intent = in + optional = True [t1] standard_name = air_temperature_at_surface_adjacent_layer long_name = mean temperature at lowest model layer diff --git a/physics/SFC_Models/Land/RUC/lsm_ruc.meta b/physics/SFC_Models/Land/RUC/lsm_ruc.meta index 8cb4ec106..c1074b585 100644 --- a/physics/SFC_Models/Land/RUC/lsm_ruc.meta +++ b/physics/SFC_Models/Land/RUC/lsm_ruc.meta @@ -339,6 +339,7 @@ type = real kind = kind_phys intent = inout + optional = True [semisbase] standard_name = baseline_surface_longwave_emissivity long_name = baseline surface lw emissivity in fraction @@ -456,6 +457,7 @@ type = real kind = kind_phys intent = inout + optional = True [tslb] standard_name = soil_temperature_for_land_surface_model long_name = soil temperature for land surface model @@ -982,6 +984,7 @@ type = real kind = kind_phys intent = in + optional = True [snoalb] standard_name = upper_bound_of_max_albedo_assuming_deep_snow long_name = maximum snow albedo @@ -1172,6 +1175,7 @@ type = real kind = kind_phys intent = inout + optional = True [sfalb_ice] standard_name = surface_diffused_shortwave_albedo_over_ice long_name = mean surface diffused sw albedo over ice @@ -1180,6 +1184,7 @@ type = real kind = kind_phys intent = inout + optional = True [sncovr1_lnd] standard_name = surface_snow_area_fraction_over_land long_name = surface snow area fraction over land @@ -1288,6 +1293,7 @@ type = real kind = kind_phys intent = inout + optional = True [smfrkeep] standard_name = volume_fraction_of_frozen_soil_moisture_for_land_surface_model long_name = volume fraction of frozen soil moisture for lsm @@ -1296,6 +1302,7 @@ type = real kind = kind_phys intent = inout + optional = True [canopy] standard_name = canopy_water_amount long_name = canopy water amount @@ -1345,6 +1352,7 @@ type = real kind = kind_phys intent = inout + optional = True [sfcqv_lnd] standard_name = water_vapor_mixing_ratio_at_surface_over_land long_name = water vapor mixing ratio at surface over land @@ -1476,6 +1484,7 @@ type = real kind = kind_phys intent = inout + optional = True [acsnow_lnd] standard_name = surface_snow_lwe_thickness_amount_over_land long_name = run-total snowfall water equivalent over land @@ -1540,6 +1549,7 @@ type = real kind = kind_phys intent = inout + optional = True [sfcqv_ice] standard_name = water_vapor_mixing_ratio_at_surface_over_ice long_name = water vapor mixing ratio at surface over ice @@ -1639,6 +1649,7 @@ type = real kind = kind_phys intent = inout + optional = True [acsnow_ice] standard_name = surface_snow_lwe_thickness_amount_over_ice long_name = run-total snowfall water equivalent over ice @@ -1699,6 +1710,7 @@ type = real kind = kind_phys intent = inout + optional = True [sbsno] standard_name = snow_deposition_sublimation_upward_latent_heat_flux long_name = latent heat flux from snow depo/subl @@ -1796,6 +1808,7 @@ type = real kind = kind_phys intent = in + optional = True [frac_grid_burned_out] standard_name = fraction_of_grid_cell_burning long_name = ration of the burnt area to the grid cell area @@ -1804,6 +1817,7 @@ type = real kind = kind_phys intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index 521e72c6a..cacba07e9 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -570,6 +570,7 @@ type = real kind = kind_phys intent = in + optional = True [emi_ant_in] standard_name = anthropogenic_background_input long_name = anthropogenic background input @@ -578,6 +579,7 @@ type = real kind = kind_phys intent = in + optional = True [smoke_RRFS] standard_name = emission_smoke_RRFS long_name = emission fire RRFS @@ -586,6 +588,7 @@ type = real kind = kind_phys intent = in + optional = True [smoke2d_RRFS] standard_name = emission_smoke_prvd_RRFS long_name = emission fire RRFS daily @@ -594,6 +597,7 @@ type = real kind = kind_phys intent = in + optional = True [ntrac] standard_name = number_of_tracers long_name = number of tracers @@ -694,6 +698,7 @@ type = real kind = kind_phys intent = inout + optional = True [emdust] standard_name = emission_of_dust_for_smoke long_name = emission of dust for smoke @@ -702,6 +707,7 @@ type = real kind = kind_phys intent = inout + optional = True [emseas] standard_name = emission_of_sea_salt_for_mp_indir_fdb long_name = emission of sea salt for mp indirect feedabck @@ -710,6 +716,7 @@ type = real kind = kind_phys intent = inout + optional = True [ebb_smoke_in] standard_name = surface_smoke_emission long_name = emission of surface smoke @@ -718,6 +725,7 @@ type = real kind = kind_phys intent = inout + optional = True [frp_output] standard_name = frp_hourly long_name = hourly fire radiative power @@ -735,6 +743,7 @@ type = real kind = kind_phys intent = inout + optional = True [fire_type_out] standard_name = fire_type long_name = type of fire @@ -742,6 +751,7 @@ dimensions = (horizontal_loop_extent) type = integer intent = out + optional = True [ebu_smoke] standard_name = ebu_smoke long_name = buffer of vertical fire emission @@ -750,6 +760,7 @@ type = real kind = kind_phys intent = inout + optional = True [fhist] standard_name = fire_hist long_name = coefficient to scale the fire activity depending on the fire duration @@ -758,6 +769,7 @@ type = real kind = kind_phys intent = inout + optional = True [min_fplume] standard_name = minimum_fire_plume_sigma_pressure_level long_name = minimum model level of fire plumerise @@ -766,6 +778,7 @@ type = real kind = kind_phys intent = inout + optional = True [max_fplume] standard_name = maximum_fire_plume_sigma_pressure_level long_name = maximum model level of fire plumerise @@ -774,6 +787,7 @@ type = real kind = kind_phys intent = inout + optional = True [mpicomm] standard_name = mpi_communicator long_name = MPI communicator @@ -803,6 +817,7 @@ type = real kind = kind_phys intent = inout + optional = True [hpbl_thetav] standard_name = atmosphere_boundary_layer_thickness_from_modified_parcel long_name = pbl height based on modified parcel method @@ -820,6 +835,7 @@ type = real kind = kind_phys intent = inout + optional = True [wetdpr] standard_name = mp_wet_deposition_smoke_dust long_name = large scale wet deposition of smoke and dust @@ -828,6 +844,7 @@ type = real kind = kind_phys intent = inout + optional = True [hwp] standard_name = hourly_wildfire_potential long_name = rrfs hourly fire weather potential @@ -836,6 +853,7 @@ type = real kind = kind_phys intent = out + optional = True [hwp_ave] standard_name = hourly_wildfire_potential_average long_name = rrfs hourly fire weather potential average @@ -844,6 +862,7 @@ type = real kind = kind_phys intent = inout + optional = True [wetness] standard_name = normalized_soil_wetness_for_land_surface_model long_name = normalized soil wetness @@ -877,6 +896,7 @@ type = real kind = kind_phys intent = out + optional = True [lu_nofire_out] standard_name = sum_of_land_use_fractions_for_no_fire_pixels long_name = land use of no fire pixels for type @@ -885,6 +905,7 @@ type = real kind = kind_phys intent = out + optional = True [lu_qfire_out] standard_name = sum_of_land_use_fractions_for_cropland_fire_pixels long_name = land use of fire pixels for type @@ -893,6 +914,7 @@ type = real kind = kind_phys intent = out + optional = True [fire_heat_flux_out] standard_name = surface_fire_heat_flux long_name = heat flux of fire at the surface @@ -901,6 +923,7 @@ type = real kind = kind_phys intent = out + optional = True [frac_grid_burned_out] standard_name = fraction_of_grid_cell_burning long_name = ration of the burnt area to the grid cell area @@ -909,6 +932,7 @@ type = real kind = kind_phys intent = out + optional = True [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = PBL top model level index From bbc16cdf3ba6590f02fb8f4c1e8e10777127539f Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Sat, 13 Apr 2024 20:53:03 -0600 Subject: [PATCH 183/249] Add missing optional attribute to conditionally allocated variables, part 4 --- physics/GWD/cires_ugwp.meta | 1 + physics/GWD/gwdc_post.meta | 1 + physics/GWD/rayleigh_damp.meta | 1 + .../Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta | 1 + physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta | 4 ++++ .../UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta | 1 + physics/MP/Thompson/mp_thompson.meta | 5 +++++ physics/PBL/MYJ/myjpbl_wrapper.meta | 1 + physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta | 1 + physics/PBL/YSU/ysuvdif.meta | 1 + physics/PBL/saYSU/shinhongvdif.meta | 1 + 11 files changed, 18 insertions(+) diff --git a/physics/GWD/cires_ugwp.meta b/physics/GWD/cires_ugwp.meta index bf43e450b..b0f122db5 100644 --- a/physics/GWD/cires_ugwp.meta +++ b/physics/GWD/cires_ugwp.meta @@ -853,6 +853,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/GWD/gwdc_post.meta b/physics/GWD/gwdc_post.meta index fefc1bd0f..a68e70c20 100644 --- a/physics/GWD/gwdc_post.meta +++ b/physics/GWD/gwdc_post.meta @@ -116,6 +116,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/GWD/rayleigh_damp.meta b/physics/GWD/rayleigh_damp.meta index 3db1bc7be..b247d1de7 100644 --- a/physics/GWD/rayleigh_damp.meta +++ b/physics/GWD/rayleigh_damp.meta @@ -138,6 +138,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta index 105d9aa48..9d7e13072 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta @@ -451,6 +451,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta index c931b9639..1e8f4c244 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta @@ -130,6 +130,7 @@ type = real kind = kind_phys intent = in + optional = True [do3_dt_ozmx] standard_name = ozone_tendency_due_to_ozone_mixing_ratio long_name = ozone tendency due to ozone mixing ratio @@ -138,6 +139,7 @@ type = real kind = kind_phys intent = in + optional = True [do3_dt_temp] standard_name = ozone_tendency_due_to_temperature long_name = ozone tendency due to temperature @@ -146,6 +148,7 @@ type = real kind = kind_phys intent = in + optional = True [do3_dt_ohoz] standard_name = ozone_tendency_due_to_overhead_ozone_column long_name = ozone tendency due to overhead ozone column @@ -154,6 +157,7 @@ type = real kind = kind_phys intent = in + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta index b89fc025f..485b9b223 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta @@ -357,6 +357,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/MP/Thompson/mp_thompson.meta b/physics/MP/Thompson/mp_thompson.meta index 39675f30d..ba6e2a515 100644 --- a/physics/MP/Thompson/mp_thompson.meta +++ b/physics/MP/Thompson/mp_thompson.meta @@ -161,6 +161,7 @@ type = real kind = kind_phys intent = inout + optional = True [nwfa2d] standard_name = tendency_of_hygroscopic_aerosols_at_surface_adjacent_layer long_name = instantaneous fake water-friendly surface aerosol source @@ -169,6 +170,7 @@ type = real kind = kind_phys intent = inout + optional = True [nifa2d] standard_name = tendency_of_nonhygroscopic_ice_nucleating_aerosols_at_surface_adjacent_layer long_name = instantaneous fake ice-friendly surface aerosol source @@ -177,6 +179,7 @@ type = real kind = kind_phys intent = inout + optional = True [nwfa] standard_name = mass_number_concentration_of_hygroscopic_aerosols long_name = number concentration of water-friendly aerosols @@ -185,6 +188,7 @@ type = real kind = kind_phys intent = inout + optional = True [nifa] standard_name = mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols long_name = number concentration of ice-friendly aerosols @@ -193,6 +197,7 @@ type = real kind = kind_phys intent = inout + optional = True [tgrs] standard_name = air_temperature long_name = model layer mean temperature diff --git a/physics/PBL/MYJ/myjpbl_wrapper.meta b/physics/PBL/MYJ/myjpbl_wrapper.meta index fa863b50a..ea6c76fa3 100644 --- a/physics/PBL/MYJ/myjpbl_wrapper.meta +++ b/physics/PBL/MYJ/myjpbl_wrapper.meta @@ -596,6 +596,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta index c55d4fd54..5731da63f 100644 --- a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta +++ b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta @@ -1171,6 +1171,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/PBL/YSU/ysuvdif.meta b/physics/PBL/YSU/ysuvdif.meta index 0095b8a77..06efaefce 100644 --- a/physics/PBL/YSU/ysuvdif.meta +++ b/physics/PBL/YSU/ysuvdif.meta @@ -469,6 +469,7 @@ type = real kind = kind_phys intent = in + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/PBL/saYSU/shinhongvdif.meta b/physics/PBL/saYSU/shinhongvdif.meta index 0002a38b9..10fbea566 100644 --- a/physics/PBL/saYSU/shinhongvdif.meta +++ b/physics/PBL/saYSU/shinhongvdif.meta @@ -446,6 +446,7 @@ type = real kind = kind_phys intent = inout + optional = True [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index From e5b77dbf45f2c799613f1dc03ad9983da0df45ab Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 18 Apr 2024 13:07:10 -0600 Subject: [PATCH 184/249] Bug fix for physics/MP/GFDL/fv_sat_adj.*: use correct allocation of variables but internally bend everything back to where it's expected (affects some, but not all variables) --- physics/MP/GFDL/fv_sat_adj.F90 | 6 +++- physics/MP/GFDL/fv_sat_adj.meta | 54 +++++++++++++++++++++++++-------- 2 files changed, 46 insertions(+), 14 deletions(-) diff --git a/physics/MP/GFDL/fv_sat_adj.F90 b/physics/MP/GFDL/fv_sat_adj.F90 index 53543485b..2207f5755 100644 --- a/physics/MP/GFDL/fv_sat_adj.F90 +++ b/physics/MP/GFDL/fv_sat_adj.F90 @@ -230,7 +230,7 @@ end subroutine fv_sat_adj_finalize !! \section arg_table_fv_sat_adj_run Argument Table !! \htmlinclude fv_sat_adj_run.html !! -subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, jsd, jed, & +subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc, iec, kmp, km, kmdelz, js, je, jsd, jed, jsc, jec, & ng, hydrostatic, fast_mp_consv, te0_2d, te0, ngas, qvi, qv, ql, qi, qr, & qs, qg, hs, peln, delz, delp, pt, pkz, q_con, akap, cappa, area, dtdt, & out_dt, last_step, do_qa, qa, & @@ -245,6 +245,8 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, integer, intent(in) :: ie integer, intent(in) :: isd integer, intent(in) :: ied + integer, intent(in) :: isc + integer, intent(in) :: iec integer, intent(in) :: kmp integer, intent(in) :: km integer, intent(in) :: kmdelz @@ -252,6 +254,8 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, kmp, km, kmdelz, js, je, integer, intent(in) :: je integer, intent(in) :: jsd integer, intent(in) :: jed + integer, intent(in) :: jsc + integer, intent(in) :: jec integer, intent(in) :: ng logical, intent(in) :: hydrostatic logical, intent(in) :: fast_mp_consv diff --git a/physics/MP/GFDL/fv_sat_adj.meta b/physics/MP/GFDL/fv_sat_adj.meta index d5194bf99..16b4791c3 100644 --- a/physics/MP/GFDL/fv_sat_adj.meta +++ b/physics/MP/GFDL/fv_sat_adj.meta @@ -137,6 +137,20 @@ dimensions = () type = integer intent = in +[isc] + standard_name = starting_x_direction_index_alloc + long_name = starting X direction index for allocation + units = count + dimensions = () + type = integer + intent = in +[iec] + standard_name = ending_x_direction_index_alloc + long_name = ending X direction index for allocation + units = count + dimensions = () + type = integer + intent = in [isd] standard_name = starting_x_direction_index_domain long_name = starting X direction index for domain @@ -200,6 +214,20 @@ dimensions = () type = integer intent = in +[jsc] + standard_name = starting_y_direction_index_alloc + long_name = starting X direction index for allocation + units = count + dimensions = () + type = integer + intent = in +[jec] + standard_name = ending_y_direction_index_alloc + long_name = ending X direction index for allocation + units = count + dimensions = () + type = integer + intent = in [ng] standard_name = number_of_ghost_zones long_name = number of ghost zones defined in fv_mp @@ -248,7 +276,7 @@ standard_name = gas_tracers_for_multi_gas_physics_at_Lagrangian_surface long_name = gas tracers for multi gas physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics) type = real kind = kind_dyn intent = inout @@ -257,7 +285,7 @@ standard_name = water_vapor_specific_humidity_at_Lagrangian_surface long_name = water vapor specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -265,7 +293,7 @@ standard_name = cloud_liquid_water_specific_humidity_at_Lagrangian_surface long_name = cloud liquid water specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -273,7 +301,7 @@ standard_name = cloud_ice_specific_humidity_at_Lagrangian_surface long_name = cloud ice specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -281,7 +309,7 @@ standard_name = cloud_rain_specific_humidity_at_Lagrangian_surface long_name = cloud rain specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -289,7 +317,7 @@ standard_name = cloud_snow_specific_humidity_at_Lagrangian_surface long_name = cloud snow specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -297,7 +325,7 @@ standard_name = cloud_graupel_specific_humidity_at_Lagrangian_surface long_name = cloud graupel specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -305,7 +333,7 @@ standard_name = surface_geopotential_at_Lagrangian_surface long_name = surface geopotential at Lagrangian surface units = m2 s-2 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc) type = real kind = kind_dyn intent = in @@ -329,7 +357,7 @@ standard_name = pressure_thickness_at_Lagrangian_surface long_name = pressure thickness at Lagrangian surface units = Pa - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = in @@ -337,7 +365,7 @@ standard_name = virtual_temperature_at_Lagrangian_surface long_name = virtual temperature at Lagrangian surface units = K - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -354,7 +382,7 @@ standard_name = cloud_condensed_water_specific_humidity_at_Lagrangian_surface long_name = cloud condensed water specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_condensed_water_at_Lagrangian_surface) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_condensed_water_at_Lagrangian_surface) type = real kind = kind_dyn intent = inout @@ -378,7 +406,7 @@ standard_name = cell_area_for_fast_physics long_name = area of the grid cell for fast physics units = m2 - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc) type = real kind = kind_grid intent = in @@ -415,7 +443,7 @@ standard_name = cloud_fraction_at_Lagrangian_surface long_name = cloud fraction at Lagrangian surface units = none - dimensions = (starting_x_direction_index_domain:ending_x_direction_index_domain,starting_y_direction_index_domain:ending_y_direction_index_domain,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = out From c0f1c606f8afe30dd4d317910e84686f1813f3cc Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 19 Apr 2024 09:54:50 -0600 Subject: [PATCH 185/249] Revert many false optional arguments in metadata files --- physics/CONV/C3/cu_c3_driver.meta | 3 --- physics/CONV/Grell_Freitas/cu_gf_driver.meta | 3 --- physics/CONV/RAS/rascnv.meta | 1 - physics/CONV/SAMF/samfdeepcnv.meta | 1 - physics/CONV/SAMF/samfshalcnv.meta | 1 - physics/CONV/SAS/shalcnv.meta | 1 - physics/GWD/cires_ugwp.meta | 2 -- physics/GWD/drag_suite.meta | 2 -- physics/GWD/gwdc_post.meta | 1 - physics/GWD/rayleigh_damp.meta | 1 - physics/GWD/ugwpv1_gsldrag.meta | 3 --- physics/GWD/unified_ugwp.meta | 3 --- .../UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta | 2 -- .../UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta | 2 -- .../UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta | 1 - .../UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta | 1 - .../UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta | 10 ---------- .../UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta | 9 --------- .../UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta | 4 ---- .../UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta | 2 -- .../UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta | 1 - .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta | 3 --- .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta | 1 - .../UFS_SCM_NEPTUNE/GFS_physics_post.meta | 1 - .../UFS_SCM_NEPTUNE/GFS_radiation_surface.meta | 2 -- .../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta | 4 ---- .../UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta | 1 - .../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta | 1 - .../UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta | 1 - .../UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta | 6 ------ .../UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta | 2 -- .../UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta | 3 --- .../UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta | 1 - physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta | 1 - .../UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta | 2 -- .../Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta | 1 - physics/MP/GFDL/fv_sat_adj.meta | 1 - physics/MP/GFDL/gfdl_cloud_microphys.meta | 1 - physics/MP/Morrison_Gettelman/m_micro.meta | 3 --- physics/MP/Morrison_Gettelman/m_micro_post.meta | 3 --- physics/MP/NSSL/mp_nssl.meta | 2 -- physics/MP/Thompson/mp_thompson.meta | 1 - physics/MP/Zhao_Carr/zhaocarr_gscond.meta | 1 - physics/MP/Zhao_Carr/zhaocarr_precpd.meta | 1 - physics/PBL/HEDMF/hedmf.meta | 3 --- physics/PBL/MYJ/myjpbl_wrapper.meta | 3 --- physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta | 9 --------- physics/PBL/SATMEDMF/satmedmfvdif.meta | 3 --- physics/PBL/SATMEDMF/satmedmfvdifq.meta | 3 --- physics/PBL/SHOC/moninshoc.meta | 3 --- physics/PBL/SHOC/shoc.meta | 1 - physics/PBL/YSU/ysuvdif.meta | 3 --- physics/PBL/saYSU/shinhongvdif.meta | 3 --- physics/Radiation/RRTMG/radlw_main.meta | 2 -- physics/Radiation/RRTMG/radsw_main.meta | 1 - physics/Radiation/RRTMGP/rrtmgp_lw_main.meta | 1 - physics/SFC_Layer/MYJ/myjsfc_wrapper.meta | 1 - physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta | 7 ------- physics/SFC_Layer/UFS/sfc_nst.meta | 1 - physics/SFC_Models/Lake/CLM/clm_lake.meta | 3 --- physics/SFC_Models/Lake/Flake/flake_driver.meta | 2 -- physics/SFC_Models/Land/Noah/lsm_noah.meta | 2 -- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 5 ----- physics/SFC_Models/Land/RUC/lsm_ruc.meta | 5 ----- physics/SFC_Models/Land/sfc_land.meta | 1 - physics/SFC_Models/Ocean/UFS/sfc_ocean.meta | 1 - physics/SFC_Models/SeaIce/CICE/sfc_cice.meta | 1 - physics/SFC_Models/SeaIce/CICE/sfc_sice.meta | 2 -- physics/smoke_dust/rrfs_smoke_wrapper.meta | 2 -- physics/tools/get_phi_fv3.meta | 1 - physics/tools/get_prs_fv3.meta | 1 - 71 files changed, 167 deletions(-) diff --git a/physics/CONV/C3/cu_c3_driver.meta b/physics/CONV/C3/cu_c3_driver.meta index f6dc927c0..af411cb6b 100644 --- a/physics/CONV/C3/cu_c3_driver.meta +++ b/physics/CONV/C3/cu_c3_driver.meta @@ -470,7 +470,6 @@ type = real kind = kind_phys intent = in - optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt @@ -549,7 +548,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [ntqv] standard_name = index_of_specific_humidity_in_tracer_concentration_array long_name = tracer index for water vapor (specific humidity) @@ -644,7 +642,6 @@ dimensions = () type = logical intent = in - optional = True [fh_dfi_radar] standard_name = forecast_lead_times_bounding_radar_derived_temperature_or_convection_suppression_intervals long_name = forecast lead times bounding radar derived temperature or convection suppression intervals diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.meta b/physics/CONV/Grell_Freitas/cu_gf_driver.meta index d84f6f8b1..f76d0c30c 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.meta +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.meta @@ -360,7 +360,6 @@ type = real kind = kind_phys intent = in - optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt @@ -439,7 +438,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [ntqv] standard_name = index_of_specific_humidity_in_tracer_concentration_array long_name = tracer index for water vapor (specific humidity) @@ -534,7 +532,6 @@ dimensions = () type = logical intent = in - optional = True [fh_dfi_radar] standard_name = forecast_lead_times_bounding_radar_derived_temperature_or_convection_suppression_intervals long_name = forecast lead times bounding radar derived temperature or convection suppression intervals diff --git a/physics/CONV/RAS/rascnv.meta b/physics/CONV/RAS/rascnv.meta index bc4a61280..8e23ae8b8 100644 --- a/physics/CONV/RAS/rascnv.meta +++ b/physics/CONV/RAS/rascnv.meta @@ -334,7 +334,6 @@ type = real kind = kind_phys intent = in - optional = True [tin] standard_name = air_temperature_of_new_state long_name = updated temperature diff --git a/physics/CONV/SAMF/samfdeepcnv.meta b/physics/CONV/SAMF/samfdeepcnv.meta index 6d307a9fd..3652a0d27 100644 --- a/physics/CONV/SAMF/samfdeepcnv.meta +++ b/physics/CONV/SAMF/samfdeepcnv.meta @@ -396,7 +396,6 @@ type = real kind = kind_phys intent = in - optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt diff --git a/physics/CONV/SAMF/samfshalcnv.meta b/physics/CONV/SAMF/samfshalcnv.meta index b809530bc..4dfa8ac20 100644 --- a/physics/CONV/SAMF/samfshalcnv.meta +++ b/physics/CONV/SAMF/samfshalcnv.meta @@ -374,7 +374,6 @@ type = real kind = kind_phys intent = in - optional = True [ud_mf] standard_name = instantaneous_atmosphere_updraft_convective_mass_flux long_name = (updraft mass flux) * delt diff --git a/physics/CONV/SAS/shalcnv.meta b/physics/CONV/SAS/shalcnv.meta index 35ec3765a..8a06e7b06 100644 --- a/physics/CONV/SAS/shalcnv.meta +++ b/physics/CONV/SAS/shalcnv.meta @@ -311,7 +311,6 @@ type = real kind = kind_phys intent = in - optional = True [heat] standard_name = kinematic_surface_upward_sensible_heat_flux_reduced_by_surface_roughness_and_vegetation long_name = kinematic surface upward sensible heat flux reduced by surface roughness and vegetation diff --git a/physics/GWD/cires_ugwp.meta b/physics/GWD/cires_ugwp.meta index b0f122db5..b0b1a8615 100644 --- a/physics/GWD/cires_ugwp.meta +++ b/physics/GWD/cires_ugwp.meta @@ -38,7 +38,6 @@ type = character kind = len=* intent = in - optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile @@ -861,7 +860,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_x_wind] standard_name = index_of_x_wind_in_cumulative_change_index long_name = index of x-wind in first dimension of array cumulative change index diff --git a/physics/GWD/drag_suite.meta b/physics/GWD/drag_suite.meta index 7b65666d5..fd3d605c1 100644 --- a/physics/GWD/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -458,7 +458,6 @@ type = real kind = kind_phys intent = in - optional = True [g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -610,7 +609,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_orographic_gwd] standard_name = index_of_orographic_gravity_wave_drag_process_in_cumulative_change_index long_name = index of orographic gravity wave drag process in second dimension of array cumulative change index diff --git a/physics/GWD/gwdc_post.meta b/physics/GWD/gwdc_post.meta index a68e70c20..6b3a160d0 100644 --- a/physics/GWD/gwdc_post.meta +++ b/physics/GWD/gwdc_post.meta @@ -124,7 +124,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_x_wind] standard_name = index_of_x_wind_in_cumulative_change_index long_name = index of x-wind in first dimension of array cumulative change index diff --git a/physics/GWD/rayleigh_damp.meta b/physics/GWD/rayleigh_damp.meta index b247d1de7..857c66e8b 100644 --- a/physics/GWD/rayleigh_damp.meta +++ b/physics/GWD/rayleigh_damp.meta @@ -146,7 +146,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_rayleigh_damping] standard_name = index_of_rayleigh_damping_process_in_cumulative_change_index long_name = index of rayleigh damping process in second dimension of array cumulative change index diff --git a/physics/GWD/ugwpv1_gsldrag.meta b/physics/GWD/ugwpv1_gsldrag.meta index ba9159b2e..4004ade59 100644 --- a/physics/GWD/ugwpv1_gsldrag.meta +++ b/physics/GWD/ugwpv1_gsldrag.meta @@ -37,7 +37,6 @@ type = character kind = len=* intent = in - optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile @@ -646,7 +645,6 @@ type = real kind = kind_phys intent = in - optional = True [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = vertical index at top atmospheric boundary layer @@ -1083,7 +1081,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_x_wind] standard_name = index_of_x_wind_in_cumulative_change_index long_name = index of x-wind in first dimension of array cumulative change index diff --git a/physics/GWD/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta index 42c2e00a3..de1ce672b 100644 --- a/physics/GWD/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -39,7 +39,6 @@ type = character kind = len=* intent = in - optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile @@ -672,7 +671,6 @@ type = real kind = kind_phys intent = in - optional = True [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 @@ -1132,7 +1130,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta index c23eafdc7..30bc93ccd 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.meta @@ -171,7 +171,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_dcnv] standard_name = index_of_deep_convection_process_process_in_cumulative_change_index long_name = index of deep convection process in second dimension of array cumulative change index @@ -455,7 +454,6 @@ dimensions = () type = integer intent = in - optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta index 825f56696..ec1c59810 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta @@ -134,7 +134,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_dcnv] standard_name = index_of_deep_convection_process_process_in_cumulative_change_index long_name = index of deep convection process in second dimension of array cumulative change index @@ -261,7 +260,6 @@ dimensions = () type = integer intent = in - optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta index 90578c2fb..a11b8641d 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.meta @@ -102,7 +102,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta index 609e0c259..8321c7d32 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.meta @@ -182,7 +182,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta index 724dac818..53b547985 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta @@ -336,7 +336,6 @@ type = real kind = kind_phys intent = inout - optional = True [snow] standard_name = lwe_thickness_of_snow_amount_on_dynamics_timestep long_name = snow fall at this time step @@ -345,7 +344,6 @@ type = real kind = kind_phys intent = inout - optional = True [graupel] standard_name = lwe_thickness_of_graupel_amount_on_dynamics_timestep long_name = graupel fall at this time step @@ -354,7 +352,6 @@ type = real kind = kind_phys intent = inout - optional = True [frzr] standard_name = cumulative_lwe_thickness_of_surface_freezing_rain_amount long_name = accumulated surface freezing rain @@ -566,7 +563,6 @@ type = real kind = kind_phys intent = inout - optional = True [totsnw] standard_name = accumulated_lwe_thickness_of_snow_amount long_name = accumulated snow precipitation @@ -575,7 +571,6 @@ type = real kind = kind_phys intent = inout - optional = True [totgrp] standard_name = accumulated_lwe_thickness_of_graupel_amount long_name = accumulated graupel precipitation @@ -584,7 +579,6 @@ type = real kind = kind_phys intent = inout - optional = True [cnvprcpb] standard_name = cumulative_lwe_thickness_of_convective_precipitation_amount_in_bucket long_name = cumulative convective precipitation in bucket @@ -609,7 +603,6 @@ type = real kind = kind_phys intent = inout - optional = True [totsnwb] standard_name = accumulated_lwe_thickness_of_snow_amount_in_bucket long_name = accumulated snow precipitation in bucket @@ -618,7 +611,6 @@ type = real kind = kind_phys intent = inout - optional = True [totgrpb] standard_name = accumulated_lwe_thickness_of_graupel_amount_in_bucket long_name = accumulated graupel precipitation in bucket @@ -627,7 +619,6 @@ type = real kind = kind_phys intent = inout - optional = True [rain_cpl] standard_name = cumulative_lwe_thickness_of_precipitation_amount_for_coupling long_name = total rain precipitation @@ -877,7 +868,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta index 9d7e13072..057d061a4 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.meta @@ -113,7 +113,6 @@ dimensions = () type = integer intent = in - optional = True [ntia] standard_name = index_of_mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_in_tracer_concentration_array long_name = tracer index for ice friendly aerosol @@ -121,7 +120,6 @@ dimensions = () type = integer intent = in - optional = True [ntgl] standard_name = index_of_graupel_mixing_ratio_in_tracer_concentration_array long_name = tracer index for graupel @@ -185,7 +183,6 @@ dimensions = () type = integer intent = in - optional = True [nthl] standard_name = index_of_hail_mixing_ratio_in_tracer_concentration_array long_name = tracer index for hail @@ -207,7 +204,6 @@ dimensions = () type = integer intent = in - optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume @@ -459,7 +455,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -496,7 +491,6 @@ type = real kind = kind_phys intent = in - optional = True [dtf] standard_name = timestep_for_dynamics long_name = dynamics timestep @@ -665,7 +659,6 @@ type = real kind = kind_phys intent = inout - optional = True [dusfci_diag] standard_name = instantaneous_surface_x_momentum_flux_for_diag long_name = instantaneous sfc x momentum flux multiplied by timestep @@ -698,7 +691,6 @@ type = real kind = kind_phys intent = inout - optional = True [rd] standard_name = gas_constant_of_dry_air long_name = ideal gas constant for dry air @@ -919,7 +911,6 @@ type = real kind = kind_phys intent = in - optional = True [ugrs1] standard_name = x_wind_at_surface_adjacent_layer long_name = zonal wind at lowest model layer diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta index 48e7e4440..7a8e72bba 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.meta @@ -119,7 +119,6 @@ dimensions = () type = integer intent = in - optional = True [ntia] standard_name = index_of_mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_in_tracer_concentration_array long_name = tracer index for ice friendly aerosol @@ -127,7 +126,6 @@ dimensions = () type = integer intent = in - optional = True [ntgl] standard_name = index_of_graupel_mixing_ratio_in_tracer_concentration_array long_name = tracer index for graupel @@ -191,7 +189,6 @@ dimensions = () type = integer intent = in - optional = True [nthl] standard_name = index_of_hail_mixing_ratio_in_tracer_concentration_array long_name = tracer index for hail @@ -213,7 +210,6 @@ dimensions = () type = integer intent = in - optional = True [nthv] standard_name = index_of_hail_volume_in_tracer_concentration_array long_name = tracer index for hail particle volume diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta index 4584a3e67..f90fccf01 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.meta @@ -138,7 +138,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -189,7 +188,6 @@ dimensions = () type = logical intent = in - optional = True [rain1] standard_name = lwe_thickness_of_shallow_convective_precipitation_amount long_name = shallow convective rainfall amount on physics timestep diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta index 1ae559ba8..fbd9e47d8 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.meta @@ -127,7 +127,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_scnv] standard_name = index_of_shallow_convection_process_process_in_cumulative_change_index long_name = index of shallow convection process in second dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta index 2a15cf16f..df957e257 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.meta @@ -390,7 +390,6 @@ type = real kind = kind_phys intent = inout - optional = True [lsm] standard_name = control_for_land_surface_scheme long_name = flag for land surface model @@ -1582,7 +1581,6 @@ type = character kind = len=256 intent = in - optional = True [use_ufo] standard_name = flag_for_gcycle_surface_option long_name = flag for gcycle surface option @@ -1924,7 +1922,6 @@ type = real kind = kind_phys intent = inout - optional = True [cvb] standard_name = pressure_at_convective_cloud_base_between_sw_radiation_calls_from_cnvc90 long_name = convective cloud bottom pressure diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta index 2eddb777b..43397f854 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.meta @@ -375,7 +375,6 @@ type = real kind = kind_phys intent = inout - optional = True [lsm] standard_name = control_for_land_surface_scheme long_name = flag for land surface model diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta index 1e8f4c244..c42da0166 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.meta @@ -37,7 +37,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [ntoz] standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array long_name = tracer index for ozone mixing ratio diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta index ac5e9e3fe..94043898d 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.meta @@ -234,7 +234,6 @@ type = real kind = kind_phys intent = in - optional = True [fice] standard_name = sea_ice_area_fraction_of_sea_area_fraction long_name = ice fraction over open water @@ -267,7 +266,6 @@ type = real kind = kind_phys intent = in - optional = True [tsfa] standard_name = surface_air_temperature_for_radiation long_name = lowest model layer air temperature for radiation diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta index b53647af5..a7df9be2a 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.meta @@ -224,7 +224,6 @@ dimensions = () type = integer intent = in - optional = True [ntwa] standard_name = index_of_mass_number_concentration_of_hygroscopic_aerosols_in_tracer_concentration_array long_name = tracer index for water friendly aerosol @@ -232,7 +231,6 @@ dimensions = () type = integer intent = in - optional = True [ntoz] standard_name = index_of_ozone_mixing_ratio_in_tracer_concentration_array long_name = tracer index for ozone mixing ratio @@ -1148,7 +1146,6 @@ type = real kind = kind_phys intent = out - optional = True [tsfa] standard_name = surface_air_temperature_for_radiation long_name = lowest model layer air temperature for radiation @@ -1189,7 +1186,6 @@ type = real kind = kind_phys intent = out - optional = True [plvl] standard_name = air_pressure_at_interface_for_radiation_in_hPa long_name = air pressure at vertical interface for radiation calculation diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta index 87cc1c7d0..a0fb78333 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.meta @@ -108,7 +108,6 @@ dimensions = () type = integer intent = in - optional = True [doSWrad] standard_name = flag_for_calling_shortwave_radiation long_name = logical flags for sw radiation calls diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta index 59d7cd68a..7af8e04d5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.meta @@ -371,7 +371,6 @@ type = real kind = kind_phys intent = inout - optional = True [tsfa] standard_name = surface_air_temperature_for_radiation long_name = lowest model layer air temperature for radiation diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta index 485b9b223..a1f1660ad 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.meta @@ -365,7 +365,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_longwave] standard_name = index_of_longwave_heating_process_in_cumulative_change_index long_name = index of longwave heating process in second dimension of array cumulative change index diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta index 53bfc962e..d1e9d4d50 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.meta @@ -358,7 +358,6 @@ type = real kind = kind_phys intent = in - optional = True [rhcpbl] standard_name = critical_relative_humidity_at_PBL_top long_name = critical relative humidity at the PBL top @@ -367,7 +366,6 @@ type = real kind = kind_phys intent = in - optional = True [rhctop] standard_name = critical_relative_humidity_at_toa long_name = critical relative humidity at the top of atmosphere @@ -376,7 +374,6 @@ type = real kind = kind_phys intent = in - optional = True [rhcmax] standard_name = max_critical_relative_humidity long_name = maximum critical relative humidity @@ -385,7 +382,6 @@ type = real kind = kind_phys intent = in - optional = True [islmsk] standard_name = sea_land_ice_mask long_name = sea/land/ice mask (=0/1/2) @@ -453,7 +449,6 @@ type = real kind = kind_phys intent = inout - optional = True [save_qc] standard_name = cloud_condensed_water_mixing_ratio_save long_name = ratio of mass of cloud water to mass of dry air plus vapor (without condensates) before entering a physics scheme @@ -536,7 +531,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta index a48a84f12..c6a330ccb 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.meta @@ -136,7 +136,6 @@ dimensions = () type = integer intent = in - optional = True [imp_physics] standard_name = control_for_microphysics_scheme long_name = choice of microphysics scheme @@ -328,7 +327,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [dtend] standard_name = cumulative_change_of_state_variables long_name = diagnostic tendencies for state variables diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta index d21892c75..7224d7221 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.meta @@ -768,7 +768,6 @@ type = real kind = kind_phys intent = in - optional = True [evap_lnd] standard_name = kinematic_surface_upward_latent_heat_flux_over_land long_name = kinematic surface upward latent heat flux over land @@ -777,7 +776,6 @@ type = real kind = kind_phys intent = in - optional = True [evap_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice long_name = kinematic surface upward latent heat flux over ice @@ -786,7 +784,6 @@ type = real kind = kind_phys intent = in - optional = True [hflx] standard_name = surface_upward_temperature_flux long_name = kinematic surface upward sensible heat flux diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta index b04aabea0..30c69732c 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.meta @@ -363,7 +363,6 @@ type = real kind = kind_phys intent = out - optional = True [vegf1d] standard_name = perturbation_of_vegetation_fraction long_name = perturbation of vegetation fraction diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta index 66c205f6e..bbf161eb5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.meta @@ -91,7 +91,6 @@ type = real kind = kind_phys intent = inout - optional = True [cvb] standard_name = pressure_at_convective_cloud_base_between_sw_radiation_calls_from_cnvc90 long_name = pressure at bottom of convective cloud diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta index 73ad1a0e5..7108e2f97 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.meta @@ -206,7 +206,6 @@ type = real kind = kind_phys intent = inout - optional = True [rh02min] standard_name = minimum_relative_humidity_at_2m_over_maximum_hourly_time_interval long_name = minumum relative humidity at 2m over maximum hourly time interval @@ -215,7 +214,6 @@ type = real kind = kind_phys intent = inout - optional = True [dtp] standard_name = timestep_for_physics long_name = physics timestep diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta index e73fc668e..8e25428cc 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.meta @@ -429,7 +429,6 @@ type = real kind = kind_phys intent = in - optional = True [de_lgth] standard_name = cloud_decorrelation_length long_name = cloud decorrelation length diff --git a/physics/MP/GFDL/fv_sat_adj.meta b/physics/MP/GFDL/fv_sat_adj.meta index 16b4791c3..5e129e2d9 100644 --- a/physics/MP/GFDL/fv_sat_adj.meta +++ b/physics/MP/GFDL/fv_sat_adj.meta @@ -369,7 +369,6 @@ type = real kind = kind_dyn intent = inout - optional = True [pkz] standard_name = finite_volume_mean_edge_pressure_raised_to_the_power_of_kappa long_name = finite-volume mean edge pressure in Pa raised to the power of kappa diff --git a/physics/MP/GFDL/gfdl_cloud_microphys.meta b/physics/MP/GFDL/gfdl_cloud_microphys.meta index f4233ac46..01f848c77 100644 --- a/physics/MP/GFDL/gfdl_cloud_microphys.meta +++ b/physics/MP/GFDL/gfdl_cloud_microphys.meta @@ -38,7 +38,6 @@ type = character kind = len=* intent = in - optional = True [logunit] standard_name = iounit_of_log long_name = fortran unit number for writing logfile diff --git a/physics/MP/Morrison_Gettelman/m_micro.meta b/physics/MP/Morrison_Gettelman/m_micro.meta index f1e13a78c..6068d4dd9 100644 --- a/physics/MP/Morrison_Gettelman/m_micro.meta +++ b/physics/MP/Morrison_Gettelman/m_micro.meta @@ -158,7 +158,6 @@ type = real kind = kind_phys intent = in - optional = True [microp_uniform] standard_name = flag_for_uniform_subcolumns long_name = flag for uniform subcolumns for MG microphysics @@ -464,7 +463,6 @@ type = real kind = kind_phys intent = in - optional = True [cnv_mfd_i] standard_name = detrained_mass_flux long_name = detrained mass flux @@ -853,7 +851,6 @@ type = real kind = kind_phys intent = in - optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/MP/Morrison_Gettelman/m_micro_post.meta b/physics/MP/Morrison_Gettelman/m_micro_post.meta index c41a07909..62449c5fc 100644 --- a/physics/MP/Morrison_Gettelman/m_micro_post.meta +++ b/physics/MP/Morrison_Gettelman/m_micro_post.meta @@ -154,7 +154,6 @@ type = real kind = kind_phys intent = out - optional = True [snow] standard_name = lwe_thickness_of_snow_amount_on_dynamics_timestep long_name = snow fall at this time step @@ -163,7 +162,6 @@ type = real kind = kind_phys intent = out - optional = True [graupel] standard_name = lwe_thickness_of_graupel_amount_on_dynamics_timestep long_name = graupel fall at this time step @@ -172,7 +170,6 @@ type = real kind = kind_phys intent = out - optional = True [dtp] standard_name = timestep_for_physics long_name = physics timestep diff --git a/physics/MP/NSSL/mp_nssl.meta b/physics/MP/NSSL/mp_nssl.meta index dce294582..0f672eedb 100644 --- a/physics/MP/NSSL/mp_nssl.meta +++ b/physics/MP/NSSL/mp_nssl.meta @@ -774,7 +774,6 @@ dimensions = () type = integer intent = in - optional = True [ntccna] standard_name = index_of_activated_cloud_condensation_nuclei_number_concentration_in_tracer_concentration_array long_name = tracer index for activated cloud condensation nuclei number concentration @@ -782,7 +781,6 @@ dimensions = () type = integer intent = in - optional = True [errflg] standard_name = ccpp_error_code long_name = error code for error handling in CCPP diff --git a/physics/MP/Thompson/mp_thompson.meta b/physics/MP/Thompson/mp_thompson.meta index ba6e2a515..7d750ee93 100644 --- a/physics/MP/Thompson/mp_thompson.meta +++ b/physics/MP/Thompson/mp_thompson.meta @@ -730,7 +730,6 @@ dimensions = () type = integer intent = in - optional = True [spp_prt_list] standard_name = magnitude_of_spp_perturbations long_name = magnitude of spp perturbations diff --git a/physics/MP/Zhao_Carr/zhaocarr_gscond.meta b/physics/MP/Zhao_Carr/zhaocarr_gscond.meta index 5f07f3561..b8cb2ea64 100644 --- a/physics/MP/Zhao_Carr/zhaocarr_gscond.meta +++ b/physics/MP/Zhao_Carr/zhaocarr_gscond.meta @@ -275,7 +275,6 @@ type = real kind = kind_phys intent = in - optional = True [lprnt] standard_name = flag_print long_name = flag for printing diagnostics to output diff --git a/physics/MP/Zhao_Carr/zhaocarr_precpd.meta b/physics/MP/Zhao_Carr/zhaocarr_precpd.meta index c82d8e040..86e6c7d67 100644 --- a/physics/MP/Zhao_Carr/zhaocarr_precpd.meta +++ b/physics/MP/Zhao_Carr/zhaocarr_precpd.meta @@ -198,7 +198,6 @@ type = real kind = kind_phys intent = in - optional = True [psautco] standard_name = autoconversion_to_snow_coefficient long_name = conversion coefficient from cloud ice to snow diff --git a/physics/PBL/HEDMF/hedmf.meta b/physics/PBL/HEDMF/hedmf.meta index b872639d2..3d9b492c0 100644 --- a/physics/PBL/HEDMF/hedmf.meta +++ b/physics/PBL/HEDMF/hedmf.meta @@ -356,7 +356,6 @@ type = real kind = kind_phys intent = out - optional = True [hpbl] standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness @@ -365,7 +364,6 @@ type = real kind = kind_phys intent = out - optional = True [hgamt] standard_name = countergradient_mixing_term_for_temperature long_name = countergradient mixing term for temperature @@ -541,7 +539,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_pbl] standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index diff --git a/physics/PBL/MYJ/myjpbl_wrapper.meta b/physics/PBL/MYJ/myjpbl_wrapper.meta index ea6c76fa3..a4786f40a 100644 --- a/physics/PBL/MYJ/myjpbl_wrapper.meta +++ b/physics/PBL/MYJ/myjpbl_wrapper.meta @@ -342,7 +342,6 @@ type = real kind = kind_phys intent = out - optional = True [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = PBL top model level index @@ -501,7 +500,6 @@ type = real kind = kind_phys intent = out - optional = True [dkt] standard_name = atmosphere_heat_diffusivity long_name = atmospheric heat diffusivity @@ -604,7 +602,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta index 5731da63f..f2adfc4f5 100644 --- a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta +++ b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.meta @@ -484,7 +484,6 @@ type = real kind = kind_phys intent = out - optional = True [dusfc1] standard_name = instantaneous_surface_x_momentum_flux long_name = surface momentum flux in the x-direction valid for current call @@ -533,7 +532,6 @@ type = real kind = kind_phys intent = out - optional = True [dusfc_diag] standard_name = cumulative_surface_x_momentum_flux_for_diag_multiplied_by_timestep long_name = cumulative sfc x momentum flux multiplied by timestep @@ -566,7 +564,6 @@ type = real kind = kind_phys intent = inout - optional = True [dusfc_cice] standard_name = surface_x_momentum_flux_from_coupled_process long_name = sfc x momentum flux for coupling @@ -619,7 +616,6 @@ type = real kind = kind_phys intent = in - optional = True [stress_wat] standard_name = surface_wind_stress_over_water long_name = surface wind stress over water @@ -745,7 +741,6 @@ type = real kind = kind_phys intent = in - optional = True [qke] standard_name = nonadvected_turbulent_kinetic_energy_multiplied_by_2 long_name = 2 x tke at mass points @@ -888,7 +883,6 @@ type = real kind = kind_phys intent = inout - optional = True [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = PBL top model level index @@ -1179,7 +1173,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index @@ -1264,7 +1257,6 @@ dimensions = () type = integer intent = in - optional = True [ntia] standard_name = index_of_mass_number_concentration_of_nonhygroscopic_ice_nucleating_aerosols_in_tracer_concentration_array long_name = tracer index for ice friendly aerosol @@ -1272,7 +1264,6 @@ dimensions = () type = integer intent = in - optional = True [index_of_process_pbl] standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index diff --git a/physics/PBL/SATMEDMF/satmedmfvdif.meta b/physics/PBL/SATMEDMF/satmedmfvdif.meta index 2ea9a30ff..a14238574 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdif.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdif.meta @@ -457,7 +457,6 @@ type = real kind = kind_phys intent = out - optional = True [hpbl] standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness @@ -466,7 +465,6 @@ type = real kind = kind_phys intent = out - optional = True [kinver] standard_name = index_of_highest_temperature_inversion long_name = index of highest temperature inversion @@ -514,7 +512,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.meta b/physics/PBL/SATMEDMF/satmedmfvdifq.meta index b2f401c76..76c3c520f 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.meta @@ -502,7 +502,6 @@ type = real kind = kind_phys intent = out - optional = True [hpbl] standard_name = atmosphere_boundary_layer_thickness long_name = PBL thickness @@ -511,7 +510,6 @@ type = real kind = kind_phys intent = out - optional = True [dkt] standard_name = atmosphere_heat_diffusivity long_name = atmospheric heat diffusivity @@ -636,7 +634,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/SHOC/moninshoc.meta b/physics/PBL/SHOC/moninshoc.meta index 65b033d90..e1cae216a 100644 --- a/physics/PBL/SHOC/moninshoc.meta +++ b/physics/PBL/SHOC/moninshoc.meta @@ -347,7 +347,6 @@ type = real kind = kind_phys intent = out - optional = True [dkt] standard_name = atmosphere_heat_diffusivity long_name = atmospheric heat diffusivity @@ -364,7 +363,6 @@ type = real kind = kind_phys intent = out - optional = True [kinver] standard_name = index_of_highest_temperature_inversion long_name = index of highest temperature inversion @@ -467,7 +465,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/SHOC/shoc.meta b/physics/PBL/SHOC/shoc.meta index 7bfb3fd9b..7da3eda0b 100644 --- a/physics/PBL/SHOC/shoc.meta +++ b/physics/PBL/SHOC/shoc.meta @@ -208,7 +208,6 @@ type = real kind = kind_phys intent = in - optional = True [supice] standard_name = tunable_parameter_for_ice_supersaturation long_name = ice supersaturation parameter for PDF clouds diff --git a/physics/PBL/YSU/ysuvdif.meta b/physics/PBL/YSU/ysuvdif.meta index 06efaefce..7696058d7 100644 --- a/physics/PBL/YSU/ysuvdif.meta +++ b/physics/PBL/YSU/ysuvdif.meta @@ -243,7 +243,6 @@ type = real kind = kind_phys intent = out - optional = True [psim] standard_name = Monin_Obukhov_similarity_function_for_momentum long_name = Monin-Obukhov similarity function for momentum @@ -387,7 +386,6 @@ type = real kind = kind_phys intent = out - optional = True [dt] standard_name = timestep_for_physics long_name = time step for physics @@ -477,7 +475,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_temperature] standard_name = index_of_temperature_in_cumulative_change_index long_name = index of temperature in first dimension of array cumulative change index diff --git a/physics/PBL/saYSU/shinhongvdif.meta b/physics/PBL/saYSU/shinhongvdif.meta index 10fbea566..3e919d78f 100644 --- a/physics/PBL/saYSU/shinhongvdif.meta +++ b/physics/PBL/saYSU/shinhongvdif.meta @@ -219,7 +219,6 @@ type = real kind = kind_phys intent = out - optional = True [psim] standard_name = Monin_Obukhov_similarity_function_for_momentum long_name = Monin-Obukhov similarity function for momentum @@ -363,7 +362,6 @@ type = real kind = kind_phys intent = out - optional = True [dt] standard_name = timestep_for_physics long_name = time step for physics @@ -454,7 +452,6 @@ dimensions = (number_of_tracers_plus_one_hundred,number_of_cumulative_change_processes) type = integer intent = in - optional = True [index_of_process_pbl] standard_name = index_of_subgrid_scale_vertical_mixing_process_in_cumulative_change_index long_name = index of subgrid scale vertical mixing process in second dimension of array cumulative change index diff --git a/physics/Radiation/RRTMG/radlw_main.meta b/physics/Radiation/RRTMG/radlw_main.meta index 453c63529..0b0819042 100644 --- a/physics/Radiation/RRTMG/radlw_main.meta +++ b/physics/Radiation/RRTMG/radlw_main.meta @@ -167,7 +167,6 @@ type = real kind = kind_phys intent = in - optional = True [dzlyr] standard_name = layer_thickness_for_radiation long_name = layer thickness @@ -176,7 +175,6 @@ type = real kind = kind_phys intent = in - optional = True [delpin] standard_name = layer_pressure_thickness_for_radiation long_name = layer pressure thickness diff --git a/physics/Radiation/RRTMG/radsw_main.meta b/physics/Radiation/RRTMG/radsw_main.meta index 76d55c520..00a93e438 100644 --- a/physics/Radiation/RRTMG/radsw_main.meta +++ b/physics/Radiation/RRTMG/radsw_main.meta @@ -199,7 +199,6 @@ type = real kind = kind_phys intent = in - optional = True [delpin] standard_name = layer_pressure_thickness_for_radiation long_name = layer pressure thickness diff --git a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta index b49130bd6..ac1da1490 100644 --- a/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta +++ b/physics/Radiation/RRTMGP/rrtmgp_lw_main.meta @@ -307,7 +307,6 @@ type = real kind = kind_phys intent = in - optional = True [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP long_name = air pressure at vertical layer for radiation calculation diff --git a/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta index 538e8d1f1..0ae09985e 100644 --- a/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta +++ b/physics/SFC_Layer/MYJ/myjsfc_wrapper.meta @@ -325,7 +325,6 @@ type = real kind = kind_phys intent = inout - optional = True [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 diff --git a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta index 74dc319b8..957beacbb 100644 --- a/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta +++ b/physics/SFC_Layer/MYNN/mynnsfc_wrapper.meta @@ -281,7 +281,6 @@ type = real kind = kind_phys intent = in - optional = True [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 @@ -671,7 +670,6 @@ type = real kind = kind_phys intent = inout - optional = True [qflx_lnd] standard_name = kinematic_surface_upward_latent_heat_flux_over_land long_name = kinematic surface upward latent heat flux over land @@ -680,7 +678,6 @@ type = real kind = kind_phys intent = inout - optional = True [qflx_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice long_name = kinematic surface upward latent heat flux over ice @@ -689,7 +686,6 @@ type = real kind = kind_phys intent = inout - optional = True [qsfc] standard_name = surface_specific_humidity long_name = surface air saturation specific humidity @@ -751,7 +747,6 @@ type = real kind = kind_phys intent = inout - optional = True [wspd] standard_name = wind_speed_at_lowest_model_layer long_name = wind speed at lowest model level @@ -801,7 +796,6 @@ type = real kind = kind_phys intent = inout - optional = True [flqc] standard_name = surface_exchange_coefficient_for_moisture long_name = surface exchange coefficient for moisture @@ -810,7 +804,6 @@ type = real kind = kind_phys intent = inout - optional = True [u10] standard_name = x_wind_at_10m long_name = 10 meter u wind speed diff --git a/physics/SFC_Layer/UFS/sfc_nst.meta b/physics/SFC_Layer/UFS/sfc_nst.meta index e35119972..06089aa66 100644 --- a/physics/SFC_Layer/UFS/sfc_nst.meta +++ b/physics/SFC_Layer/UFS/sfc_nst.meta @@ -627,7 +627,6 @@ type = real kind = kind_phys intent = inout - optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water diff --git a/physics/SFC_Models/Lake/CLM/clm_lake.meta b/physics/SFC_Models/Lake/CLM/clm_lake.meta index 965981e91..7754362f0 100644 --- a/physics/SFC_Models/Lake/CLM/clm_lake.meta +++ b/physics/SFC_Models/Lake/CLM/clm_lake.meta @@ -101,7 +101,6 @@ dimensions = () type = logical intent = in - optional = True [dtp] standard_name = timestep_for_physics long_name = physics timestep @@ -347,7 +346,6 @@ type = real kind = kind_phys intent = inout - optional = True [evap_ice] standard_name = kinematic_surface_upward_latent_heat_flux_over_ice long_name = kinematic surface upward latent heat flux over ice @@ -356,7 +354,6 @@ type = real kind = kind_phys intent = inout - optional = True [hflx_wat] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water diff --git a/physics/SFC_Models/Lake/Flake/flake_driver.meta b/physics/SFC_Models/Lake/Flake/flake_driver.meta index 6269e1873..f5615ba08 100644 --- a/physics/SFC_Models/Lake/Flake/flake_driver.meta +++ b/physics/SFC_Models/Lake/Flake/flake_driver.meta @@ -93,7 +93,6 @@ type = real kind = kind_phys intent = in - optional = True [xlat] standard_name = latitude long_name = latitude @@ -240,7 +239,6 @@ type = real kind = kind_phys intent = inout - optional = True [lflx] standard_name = surface_upward_potential_latent_heat_flux_over_water long_name = surface upward potential latent heat flux over water diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.meta b/physics/SFC_Models/Land/Noah/lsm_noah.meta index 391d2e1dc..0a58312c8 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.meta +++ b/physics/SFC_Models/Land/Noah/lsm_noah.meta @@ -407,7 +407,6 @@ type = real kind = kind_phys intent = in - optional = True [vegfpert] standard_name = perturbation_of_vegetation_fraction long_name = perturbation of vegetation fraction @@ -639,7 +638,6 @@ type = real kind = kind_phys intent = inout - optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 7d6f81245..7417b200e 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -302,7 +302,6 @@ type = real kind = kind_phys intent = in - optional = True [dry] standard_name = flag_nonzero_land_surface_fraction long_name = flag indicating presence of some land surface area fraction @@ -815,7 +814,6 @@ type = real kind = kind_phys intent = inout - optional = True [flhc1] standard_name = surface_exchange_coefficient_for_heat long_name = surface exchange coefficient for heat @@ -824,7 +822,6 @@ type = real kind = kind_phys intent = inout - optional = True [flqc1] standard_name = surface_exchange_coefficient_for_moisture long_name = surface exchange coefficient for moisture @@ -833,7 +830,6 @@ type = real kind = kind_phys intent = inout - optional = True [do_mynnsfclay] standard_name = flag_for_mellor_yamada_nakanishi_niino_surface_layer_scheme long_name = flag to activate MYNN surface layer @@ -1227,7 +1223,6 @@ type = real kind = kind_phys intent = out - optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land diff --git a/physics/SFC_Models/Land/RUC/lsm_ruc.meta b/physics/SFC_Models/Land/RUC/lsm_ruc.meta index c1074b585..0abe4ada3 100644 --- a/physics/SFC_Models/Land/RUC/lsm_ruc.meta +++ b/physics/SFC_Models/Land/RUC/lsm_ruc.meta @@ -256,7 +256,6 @@ type = real kind = kind_phys intent = in - optional = True [snoalb] standard_name = upper_bound_of_max_albedo_assuming_deep_snow long_name = maximum snow albedo @@ -718,7 +717,6 @@ dimensions = () type = logical intent = in - optional = True [xlat_d] standard_name = latitude_in_degree long_name = latitude in degree north @@ -1225,7 +1223,6 @@ type = real kind = kind_phys intent = inout - optional = True [weasd_ice] standard_name = water_equivalent_accumulated_snow_depth_over_ice long_name = water equiv of acc snow depth over ice @@ -1386,7 +1383,6 @@ type = real kind = kind_phys intent = inout - optional = True [hflx_lnd] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land @@ -1608,7 +1604,6 @@ type = real kind = kind_phys intent = inout - optional = True [ep1d_ice] standard_name = surface_upward_potential_latent_heat_flux_over_ice long_name = surface upward potential latent heat flux over ice diff --git a/physics/SFC_Models/Land/sfc_land.meta b/physics/SFC_Models/Land/sfc_land.meta index 151905280..15790145e 100644 --- a/physics/SFC_Models/Land/sfc_land.meta +++ b/physics/SFC_Models/Land/sfc_land.meta @@ -183,7 +183,6 @@ type = real kind = kind_phys intent = inout - optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_land long_name = kinematic surface upward sensible heat flux over land diff --git a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta index 532f0f2fa..c0955d440 100644 --- a/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta +++ b/physics/SFC_Models/Ocean/UFS/sfc_ocean.meta @@ -282,7 +282,6 @@ type = real kind = kind_phys intent = inout - optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_water long_name = kinematic surface upward sensible heat flux over water diff --git a/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta index d1ce6f512..226c6e948 100644 --- a/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta +++ b/physics/SFC_Models/SeaIce/CICE/sfc_cice.meta @@ -192,7 +192,6 @@ type = real kind = kind_phys intent = inout - optional = True [hflx] standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice long_name = kinematic surface upward sensible heat flux over ice diff --git a/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta b/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta index e6929b496..828a83939 100644 --- a/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta +++ b/physics/SFC_Models/SeaIce/CICE/sfc_sice.meta @@ -393,7 +393,6 @@ type = real kind = kind_phys intent = in - optional = True [evapw] standard_name = kinematic_surface_upward_latent_heat_flux_over_water long_name = kinematic surface upward latent heat flux over water @@ -402,7 +401,6 @@ type = real kind = kind_phys intent = in - optional = True [hflxi] standard_name = kinematic_surface_upward_sensible_heat_flux_over_ice long_name = kinematic surface upward sensible heat flux over ice diff --git a/physics/smoke_dust/rrfs_smoke_wrapper.meta b/physics/smoke_dust/rrfs_smoke_wrapper.meta index cacba07e9..c7afc1d97 100755 --- a/physics/smoke_dust/rrfs_smoke_wrapper.meta +++ b/physics/smoke_dust/rrfs_smoke_wrapper.meta @@ -307,7 +307,6 @@ type = real kind = kind_phys intent = in - optional = True [t2m] standard_name = air_temperature_at_2m long_name = 2 meter temperature @@ -490,7 +489,6 @@ type = real kind = kind_phys intent = in - optional = True [idat] standard_name = date_and_time_at_model_initialization_in_iso_order long_name = initialization date and time diff --git a/physics/tools/get_phi_fv3.meta b/physics/tools/get_phi_fv3.meta index 2bae1e7c9..5c162c746 100644 --- a/physics/tools/get_phi_fv3.meta +++ b/physics/tools/get_phi_fv3.meta @@ -54,7 +54,6 @@ type = real kind = kind_phys intent = inout - optional = True [phii] standard_name = geopotential_at_interface long_name = interface geopotential diff --git a/physics/tools/get_prs_fv3.meta b/physics/tools/get_prs_fv3.meta index 9352b07cf..4cdad7566 100644 --- a/physics/tools/get_prs_fv3.meta +++ b/physics/tools/get_prs_fv3.meta @@ -77,7 +77,6 @@ type = real kind = kind_phys intent = out - optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 240e3cf886e83497c002ec52137d1b649e6fbc41 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 14:10:14 -0600 Subject: [PATCH 186/249] Add optional in physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 --- .../UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 index f6067a86c..933d75bfe 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 @@ -72,16 +72,17 @@ subroutine GFS_radiation_surface_run ( & integer, dimension(:), intent(in) :: use_lake_model real(kind=kind_phys), dimension(:), intent(in) :: xlat, xlon, slmsk, & - sfc_alb_pert, lndp_prt_list, & + sfc_alb_pert, & landfrac, lakefrac, & snodl, snodi, sncovr, & sncovr_ice, fice, zorl, & hprime, tsfg, tsfa, tisfc, & coszen, alvsf, alnsf, alvwf, & alnwf, facsf, facwf, snoalb - character(len=3) , dimension(:), intent(in) :: lndp_var_list - real(kind=kind_phys), dimension(:), intent(in) :: albdvis_ice, albdnir_ice, & - albivis_ice, albinir_ice + real(kind=kind_phys), dimension(:), intent(in), optional :: lndp_prt_list + character(len=3) , dimension(:), intent(in), optional :: lndp_var_list + real(kind=kind_phys), dimension(:), intent(in), optional :: albdvis_ice, albdnir_ice, & + albivis_ice, albinir_ice real(kind=kind_phys), dimension(:), intent(inout) :: albdvis_lnd, albdnir_lnd, & albivis_lnd, albinir_lnd, & From 7d34ce541bb57c16ec049c4304461e8925203e58 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 14:16:38 -0600 Subject: [PATCH 187/249] Add optional in physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 --- physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 index 936393d5b..95d172d4f 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.F90 @@ -81,18 +81,18 @@ subroutine sgscloud_radpre_run( & real(kind=kind_phys), dimension(:,:), intent(inout) :: qc, qi real(kind=kind_phys), dimension(:,:), intent(inout) :: qr, qs, qg ! note: qci_conv only allocated if GF is used - 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(inout) :: qlc, qli !for SAS - real(kind=kind_phys), dimension(:,:), intent(in) :: ud_mf + real(kind=kind_phys), dimension(:,:), intent(in), optional :: ud_mf real(kind=kind_phys), dimension(:,:), intent(in) :: T3D,delp real(kind=kind_phys), dimension(:,:), intent(in) :: qv,P3D,exner real(kind=kind_phys), dimension(:,:), intent(inout) :: & & clouds1,clouds2,clouds3,clouds4,clouds5, & & clouds8,clouds9 real(kind=kind_phys), dimension(:,:), intent(inout) :: qc_save, qi_save, qs_save - real(kind=kind_phys), dimension(:,:), intent(in) :: qc_bl, qi_bl, cldfra_bl + real(kind=kind_phys), dimension(:,:), intent(in), optional :: qc_bl, qi_bl, cldfra_bl real(kind=kind_phys), dimension(:), intent(in) :: slmsk, xlat, de_lgth - real(kind=kind_phys), dimension(:,:), intent(in) :: plyr, dz + real(kind=kind_phys), dimension(:,:), intent(in) :: plyr, dz real(kind=kind_phys), dimension(:,:), intent(inout) :: cldsa integer, dimension(:,:), intent(inout) :: mbota, mtopa integer, intent(in) :: iovr From 97bbc319475043c3f923b8850b4b5a5ef52da457 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 14:21:35 -0600 Subject: [PATCH 188/249] Add optional in .//physics/GWD/cires_ugwp.F90 --- physics/GWD/cires_ugwp.F90 | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/physics/GWD/cires_ugwp.F90 b/physics/GWD/cires_ugwp.F90 index c648d9647..a71bd28d0 100644 --- a/physics/GWD/cires_ugwp.F90 +++ b/physics/GWD/cires_ugwp.F90 @@ -229,13 +229,14 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw 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_ogw, dudt_tms - real(kind=kind_phys), intent(out), dimension(:) :: dusfc_ms, dvsfc_ms, dusfc_bl, dvsfc_bl - real(kind=kind_phys), intent(out), dimension(:, :) :: dtauy2d_ms - real(kind=kind_phys), intent(out), dimension(:, :) :: dtaux2d_bl, dtauy2d_bl + real(kind=kind_phys), intent(out), dimension(:, :):: dudt_mtb, dudt_tms + real(kind=kind_phys), intent(out), dimension(:, :), optional :: dudt_ogw + real(kind=kind_phys), intent(out), dimension(:), optional :: dusfc_ms, dvsfc_ms, dusfc_bl, dvsfc_bl + real(kind=kind_phys), intent(out), dimension(:, :), optional :: dtauy2d_ms + real(kind=kind_phys), intent(out), dimension(:, :), optional :: dtaux2d_bl, dtauy2d_bl ! dtend is only allocated if ldiag=.true. - real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) + real(kind=kind_phys), optional, intent(inout), optional :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_orographic_gwd, index_of_process_nonorographic_gwd @@ -243,7 +244,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr 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 From 9a825382bced5e61386b02252c63f801ed8f0f3d Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 14:27:58 -0600 Subject: [PATCH 189/249] Add optional in physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_{2,3}.F90 --- .../UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 | 7 ++++--- .../UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 index c72e5c7b2..61b48c854 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 @@ -30,9 +30,10 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, flag_ logical, intent(in ), dimension(:) :: flag_cice real(kind=kind_phys), intent(in ), dimension(:) :: ctei_rm real(kind=kind_phys), intent(in ), dimension(:) :: xcosz, adjsfcdsw, adjsfcdlw, pgr, xmu, work1, work2 - real(kind=kind_phys), intent(in ), dimension(:) :: ulwsfc_cice + real(kind=kind_phys), intent(in ), dimension(:), optional :: ulwsfc_cice real(kind=kind_phys), intent(in ), dimension(:) :: cice - real(kind=kind_phys), intent(in ), dimension(:,:) :: htrsw, htrlw, htrlwu, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk + real(kind=kind_phys), intent(in ), dimension(:,:) :: htrsw, htrlw, tgrs, prsl, qgrs_water_vapor, qgrs_cloud_water, prslk + real(kind=kind_phys), intent(in ), dimension(:,:), optional :: htrlwu real(kind=kind_phys), intent(in ), dimension(:,:) :: prsi real(kind=kind_phys), intent(in ), dimension(:,:,:) :: lwhd integer, intent(inout), dimension(:) :: kinver @@ -41,7 +42,7 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, flag_ real(kind=kind_phys), intent(inout), dimension(:) :: adjsfculw ! dtend is only allocated if ldiag3d is .true. - real(kind=kind_phys), optional, intent(inout), dimension(:,:,:) :: dtend + real(kind=kind_phys), optional, intent(inout), dimension(:,:,:), optional :: dtend integer, intent(in), dimension(:,:) :: dtidx integer, intent(in) :: index_of_process_longwave, index_of_process_shortwave, & index_of_process_pbl, index_of_process_dcnv, index_of_process_scnv, & diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 index 5ca20ffc1..bc99e7fff 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.F90 @@ -54,8 +54,8 @@ subroutine GFS_suite_interstitial_3_run (otsptflag, & real(kind=kind_phys), intent(in ), dimension(:,:) :: gt0 real(kind=kind_phys), intent(in ), dimension(:,:,:) :: gq0 - real(kind=kind_phys), intent(inout ), dimension(:,:) :: sigmain - real(kind=kind_phys), intent(inout ), dimension(:,:) :: sigmaout,qmicro + real(kind=kind_phys), intent(inout ), dimension(:,:), optional :: sigmain + real(kind=kind_phys), intent(inout ), dimension(:,:), optional :: sigmaout, qmicro real(kind=kind_phys), intent(inout), dimension(:,:) :: rhc, save_qc ! save_qi is not allocated for Zhao-Carr MP real(kind=kind_phys), intent(inout), dimension(:,:) :: save_qi From 19fcb91a58d9049ea6870602b8459666bdcfc756 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 14:37:03 -0600 Subject: [PATCH 190/249] Add optional .//physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.* --- .../GFS_rrtmgp_cloud_overlap.F90 | 14 +++++----- .../GFS_rrtmgp_cloud_overlap.meta | 27 ------------------- 2 files changed, 6 insertions(+), 35 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 index 0094f8165..3d3eb2e5d 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 @@ -30,7 +30,7 @@ module GFS_rrtmgp_cloud_overlap !! !! \section GFS_rrtmgp_cloud_overlap_run subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad, & - julian, lat, p_lev, p_lay, tv_lay, deltaZc, con_pi, con_g, con_rd, con_epsq, & + julian, lat, deltaZc, con_pi, con_g, con_rd, con_epsq, & dcorr_con, idcor, iovr, iovr_dcorr, iovr_exp, iovr_exprand, idcor_con, & idcor_hogan, idcor_oreopoulos, cld_frac, cld_cnv_frac, iovr_convcld, top_at_1, & imfdeepcnv, imfdeepcnv_gf, imfdeepcnv_samf, de_lgth, cloud_overlap_param, & @@ -67,19 +67,17 @@ subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad, dcorr_con ! Decorrelation-length (used if idcor = idcor_con) real(kind_phys), dimension(:), intent(in) :: & lat ! Latitude - real(kind_phys), dimension(:,:), intent(in) :: & - tv_lay, & ! Virtual temperature (K) - p_lay, & ! Pressure at model-layers (Pa) - cld_frac, & ! Total cloud fraction + real(kind_phys), dimension(:,:), intent(in) :: & + cld_frac, ! Total cloud fraction + real(kind_phys), dimension(:,:), intent(in), optional :: & cld_cnv_frac ! Convective cloud-fraction - real(kind_phys), dimension(:,:), intent(in) :: & - p_lev, & ! Pressure at model-level interfaces (Pa) + real(kind_phys), dimension(:,:), intent(in), optional :: & deltaZc ! Layer thickness (from layer-centers)(m) ! Outputs real(kind_phys), dimension(:),intent(out) :: & de_lgth ! Decorrelation length - real(kind_phys), dimension(:,:),intent(out) :: & + real(kind_phys), dimension(:,:),intent(out), optional :: & cloud_overlap_param, & ! Cloud-overlap parameter cnv_cloud_overlap_param,& ! Convective cloud-overlap parameter precip_overlap_param ! Precipitation overlap parameter diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta index 5b2907492..3455087b5 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.meta @@ -60,33 +60,6 @@ type = real intent = in kind = kind_phys -[p_lev] - standard_name = air_pressure_at_interface_for_RRTMGP - long_name = air pressure at vertical interface for radiation calculation - units = Pa - dimensions = (horizontal_loop_extent,vertical_interface_dimension) - type = real - kind = kind_phys - intent = in - optional = True -[p_lay] - standard_name = air_pressure_at_layer_for_RRTMGP - long_name = air pressure at vertical layer for radiation calculation - units = Pa - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in - optional = True -[tv_lay] - standard_name = virtual_temperature - long_name = layer virtual temperature - units = K - dimensions = (horizontal_loop_extent,vertical_layer_dimension) - type = real - kind = kind_phys - intent = in - optional = True [deltaZc] standard_name = layer_thickness_from_layer_center long_name = layer_thickness From 000365eb05fa931daf36ab46d18e6153293e972b Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 14:46:54 -0600 Subject: [PATCH 191/249] Add optional .//physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 --- .../GFS_phys_time_vary.scm.F90 | 108 +++++++++--------- 1 file changed, 54 insertions(+), 54 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 index 075bfc039..59b59e76a 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.F90 @@ -84,18 +84,18 @@ subroutine GFS_phys_time_vary_init ( real(kind_phys), intent(in) :: fhour real(kind_phys), intent(in) :: xlat_d(:), xlon_d(:) - 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(in) :: 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(:) @@ -109,50 +109,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(:,:) @@ -649,14 +649,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(:,:) @@ -664,8 +664,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 integer, intent(in) :: nthrds From f24c55800a6e9bf29f73a387273da9718c0a3033 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 15:46:12 -0600 Subject: [PATCH 192/249] Add optional .//physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 --- .../UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 index 79ae1559a..a664c4dcd 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 @@ -105,28 +105,31 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic xlon, & ! Longitude xlat, & ! Latitude dx ! Characteristic grid lengthscale (m) - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & tv_lay, & ! Virtual temperature (K) t_lay, & ! Temperature (K) qs_lay, & ! Saturation vapor pressure (Pa) q_lay, & ! water-vapor mixing ratio (kg/kg) relhum, & ! Relative humidity - p_lay, & ! Pressure at model-layers (Pa) - cnv_mixratio, & ! Convective cloud mixing-ratio (kg/kg) + p_lay ! Pressure at model-layers (Pa) + real(kind_phys), dimension(:,:), intent(in) :: & + cnv_mixratio ! Convective cloud mixing-ratio (kg/kg) + real(kind_phys), dimension(:,:), intent(in), optional :: & qci_conv, & ! Convective cloud condesate after rainout (kg/kg) deltaZ, & ! Layer-thickness (m) deltaZc, & ! Layer-thickness, from layer centers (m) deltaP, & ! Layer-thickness (Pa) qc_mynn, & ! - qi_mynn, & ! + qi_mynn, ! + real(kind_phys), dimension(:,:), intent(in), optional :: & cld_pbl_frac ! - real(kind_phys), dimension(:,:), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout), optional :: & effrin_cldliq, & ! Effective radius for stratiform liquid cloud-particles (microns) effrin_cldice, & ! Effective radius for stratiform ice cloud-particles (microns) effrin_cldsnow ! Effective radius for stratiform snow cloud-particles (microns) - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & effrin_cldrain ! Effective radius for stratiform rain cloud-particles (microns) - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & p_lev ! Pressure at model-level interfaces (Pa) real(kind_phys), dimension(:,:,:),intent(in) :: & tracer ! Cloud condensate amount in layer by type () @@ -149,6 +152,7 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic cld_resnow, & ! Effective radius for snow hydrometeors cld_rwp, & ! Water path for rain hydrometeors cld_rerain, & ! Effective radius for rain hydrometeors + real(kind_phys), dimension(:,:),intent(inout), optional :: & precip_frac, & ! Precipitation fraction cld_cnv_frac, & ! Cloud-fraction for convective clouds cld_cnv_lwp, & ! Water path for convective liquid cloud-particles @@ -569,7 +573,7 @@ subroutine cloud_mp_uni(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_cldrai effrin_cldliq, & ! Effective radius for liquid cloud-particles (microns) effrin_cldice, & ! Effective radius for ice cloud-particles (microns) effrin_cldsnow ! Effective radius for snow cloud-particles (microns) - real(kind_phys), dimension(:,:), intent(in) ,optional :: & + real(kind_phys), dimension(:,:), intent(in) :: & effrin_cldrain ! Effective radius for rain cloud-particles (microns) real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure at model-level interfaces (Pa) From 7bc2486dd82d4b49b423e42265edbc47049e1a21 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 16:05:51 -0600 Subject: [PATCH 193/249] Bug fixes in physics/GWD/cires_ugwp.F90 and physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 --- physics/GWD/cires_ugwp.F90 | 2 +- .../Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/GWD/cires_ugwp.F90 b/physics/GWD/cires_ugwp.F90 index a71bd28d0..cab602252 100644 --- a/physics/GWD/cires_ugwp.F90 +++ b/physics/GWD/cires_ugwp.F90 @@ -236,7 +236,7 @@ subroutine cires_ugwp_run(do_ugwp, me, master, im, levs, ntrac, dtp, kdt, lonr real(kind=kind_phys), intent(out), dimension(:, :), optional :: dtaux2d_bl, dtauy2d_bl ! dtend is only allocated if ldiag=.true. - real(kind=kind_phys), optional, intent(inout), optional :: dtend(:,:,:) + real(kind=kind_phys), optional, intent(inout) :: dtend(:,:,:) integer, intent(in) :: dtidx(:,:), & index_of_x_wind, index_of_y_wind, index_of_temperature, & index_of_process_orographic_gwd, index_of_process_nonorographic_gwd diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 index 61b48c854..923cee897 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.F90 @@ -42,7 +42,7 @@ subroutine GFS_suite_interstitial_2_run (im, levs, lssav, ldiag3d, lsidea, flag_ real(kind=kind_phys), intent(inout), dimension(:) :: adjsfculw ! dtend is only allocated if ldiag3d is .true. - real(kind=kind_phys), optional, intent(inout), dimension(:,:,:), optional :: dtend + real(kind=kind_phys), optional, intent(inout), dimension(:,:,:) :: dtend integer, intent(in), dimension(:,:) :: dtidx integer, intent(in) :: index_of_process_longwave, index_of_process_shortwave, & index_of_process_pbl, index_of_process_dcnv, index_of_process_scnv, & From eb64212ebb92fa7f950cbd1de7c59f07fd5ca397 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 22 Apr 2024 16:34:47 -0600 Subject: [PATCH 194/249] More bug fixes in physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 and physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 --- .../Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 | 6 +++--- .../UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 index a664c4dcd..f61ea76c6 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.F90 @@ -120,7 +120,7 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic deltaZc, & ! Layer-thickness, from layer centers (m) deltaP, & ! Layer-thickness (Pa) qc_mynn, & ! - qi_mynn, ! + qi_mynn ! real(kind_phys), dimension(:,:), intent(in), optional :: & cld_pbl_frac ! real(kind_phys), dimension(:,:), intent(inout), optional :: & @@ -151,7 +151,7 @@ subroutine GFS_rrtmgp_cloud_mp_run(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldic 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(inout), optional :: & precip_frac, & ! Precipitation fraction cld_cnv_frac, & ! Cloud-fraction for convective clouds @@ -573,7 +573,7 @@ subroutine cloud_mp_uni(nCol, nLev, nTracers, ncnd, i_cldliq, i_cldice, i_cldrai effrin_cldliq, & ! Effective radius for liquid cloud-particles (microns) effrin_cldice, & ! Effective radius for ice cloud-particles (microns) effrin_cldsnow ! Effective radius for snow cloud-particles (microns) - real(kind_phys), dimension(:,:), intent(in) :: & + real(kind_phys), dimension(:,:), intent(in), optional :: & effrin_cldrain ! Effective radius for rain cloud-particles (microns) real(kind_phys), dimension(:,:), intent(in) :: & p_lev ! Pressure at model-level interfaces (Pa) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 index 3d3eb2e5d..db660148e 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.F90 @@ -68,7 +68,7 @@ subroutine GFS_rrtmgp_cloud_overlap_run(nCol, nLev, yearlen, doSWrad, doLWrad, real(kind_phys), dimension(:), intent(in) :: & lat ! Latitude real(kind_phys), dimension(:,:), intent(in) :: & - cld_frac, ! Total cloud fraction + cld_frac ! Total cloud fraction real(kind_phys), dimension(:,:), intent(in), optional :: & cld_cnv_frac ! Convective cloud-fraction real(kind_phys), dimension(:,:), intent(in), optional :: & From 4e100f808df35c9485c9a9a0b3cc95848b137a4d Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Apr 2024 16:32:33 +0000 Subject: [PATCH 195/249] 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 196/249] 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 197/249] 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 198/249] 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 199/249] 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 200/249] 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 201/249] 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 202/249] 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 203/249] 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 204/249] 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 205/249] 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 From 8a85857afa1b4051479a9f683a7398efa0ae887e Mon Sep 17 00:00:00 2001 From: George Gayno Date: Wed, 24 Apr 2024 18:29:34 +0000 Subject: [PATCH 206/249] Fix the setting of model landmask when interpolating GLDAS data. Fixes #199. --- physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F b/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F index 369a94358..2ff33498b 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F @@ -7670,7 +7670,7 @@ subroutine clima(lugb,iy,im,id,ih,fh,len,lsoil,slmskl,slmskw, & ! points. so for efficiency, don't have fixrdc try to ! find a value at landice points as defined by the vet type (vet). allocate(slmask_noice(len)) - slmask_noice = 1.0 + slmask_noice = slmskl do i = 1, len if (nint(vet(i)) < 1 .or. & nint(vet(i)) == landice_cat) then From e73d7c8e7189a1f5d64399d98a5272180b2fe78b Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 24 Apr 2024 16:40:25 -0600 Subject: [PATCH 207/249] Small bug fixes in physics/SFC_Models/Lake/Flake/flake_driver.F90 and physics/SFC_Models/Land/RUC/lsm_ruc.F90 --- physics/SFC_Models/Lake/Flake/flake_driver.F90 | 2 +- physics/SFC_Models/Land/RUC/lsm_ruc.F90 | 4 ++-- physics/TODO_DONE.txt | 6 ++++++ 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 physics/TODO_DONE.txt diff --git a/physics/SFC_Models/Lake/Flake/flake_driver.F90 b/physics/SFC_Models/Lake/Flake/flake_driver.F90 index f849c6f62..9092b1c36 100644 --- a/physics/SFC_Models/Lake/Flake/flake_driver.F90 +++ b/physics/SFC_Models/Lake/Flake/flake_driver.F90 @@ -65,7 +65,7 @@ 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, tsurf_ice, lflx, gflx + & ch, cm, chh, cmm, T_ice, 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 diff --git a/physics/SFC_Models/Land/RUC/lsm_ruc.F90 b/physics/SFC_Models/Land/RUC/lsm_ruc.F90 index 7c50a5bf7..8df8cca24 100644 --- a/physics/SFC_Models/Land/RUC/lsm_ruc.F90 +++ b/physics/SFC_Models/Land/RUC/lsm_ruc.F90 @@ -95,7 +95,7 @@ subroutine lsm_ruc_init (me, master, isot, ivegsrc, nlunit, & 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, & + 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 @@ -446,7 +446,7 @@ subroutine lsm_ruc_run & ! inputs & tsice ! --- output: - real (kind_phys), dimension(:), intent(inout), optional :: + real (kind_phys), dimension(:), intent(inout), optional :: & & sfalb_lnd, sfalb_ice, wetness, snowfallac_lnd, & & snowfallac_ice, rhosnf real (kind_phys), dimension(:), intent(inout) :: & diff --git a/physics/TODO_DONE.txt b/physics/TODO_DONE.txt new file mode 100644 index 000000000..2984e4be1 --- /dev/null +++ b/physics/TODO_DONE.txt @@ -0,0 +1,6 @@ +https://docs.google.com/document/d/1fa7kTJXCX0qFv4OTj2BtgIxPBj63vbi_Fa9B4M_InfM/edit#heading=h.rs78qntnlzly + +TODO + + +DONE From 5cdea5b32ec760b3c0e73e0c68a311ceae88da10 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 25 Apr 2024 15:24:12 +0000 Subject: [PATCH 208/249] Fix incorrect intents --- physics/GWD/gwdps.meta | 2 +- .../Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta | 2 +- physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 | 4 ++-- .../Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta | 4 ++-- .../UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 | 2 +- physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 | 4 ++-- physics/PBL/SATMEDMF/satmedmfvdif.meta | 2 +- physics/PBL/SATMEDMF/satmedmfvdifq.meta | 2 +- physics/PBL/SHOC/moninshoc.meta | 2 +- physics/PBL/YSU/ysuvdif.meta | 2 +- physics/SFC_Layer/UFS/sfc_diag.meta | 4 ++-- physics/SFC_Layer/UFS/sfc_diag_post.F90 | 2 +- physics/SFC_Layer/UFS/sfc_diag_post.meta | 4 ++-- 13 files changed, 18 insertions(+), 18 deletions(-) diff --git a/physics/GWD/gwdps.meta b/physics/GWD/gwdps.meta index bbe7569d0..e9c51c4da 100644 --- a/physics/GWD/gwdps.meta +++ b/physics/GWD/gwdps.meta @@ -373,7 +373,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = inout [ldiag_ugwp] standard_name = flag_for_unified_gravity_wave_physics_diagnostics long_name = flag for CIRES UGWP Diagnostics diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta index ec1c59810..b8be36596 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.meta @@ -126,7 +126,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) type = real kind = kind_phys - intent = in + intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index 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..e4877877c 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 @@ -43,10 +43,10 @@ subroutine GFS_MP_generic_post_run( integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:) integer, intent(in) :: imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf integer, dimension (:), intent(in) :: htop - integer :: dfi_radar_max_intervals + integer, intent(in) :: dfi_radar_max_intervals real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour, con_t0c real(kind=kind_phys), intent(in) :: radar_tten_limits(:) - integer :: ix_dfi_radar(:) + integer, intent(in) :: ix_dfi_radar(:) real(kind=kind_phys), dimension(:,:), intent(inout) :: gt0,refl_10cm real(kind=kind_phys), intent(in) :: dtf, frain, con_g, rainmin, rhowater diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta index 7f67aa925..09875b6bc 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta @@ -229,7 +229,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) type = real kind = kind_phys - intent = in + intent = inout [prsl] standard_name = air_pressure long_name = layer mean pressure @@ -430,7 +430,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) type = real kind = kind_phys - intent = inout + intent = in [rain0] standard_name = lwe_thickness_of_explicit_rain_amount long_name = explicit rain on physics timestep diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 index ab7528a62..01617aa1b 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.F90 @@ -41,7 +41,7 @@ subroutine GFS_surface_composites_post_run ( logical, intent(in) :: cplflx, frac_grid, cplwav2atm, frac_ice logical, intent(in) :: lheatstrg logical, dimension(:), intent(in) :: flag_cice, dry, icy - logical, dimension(:), intent(inout) :: wet + logical, dimension(:), intent(in) :: wet integer, dimension(:), intent(in) :: islmsk, use_lake_model real(kind=kind_phys), dimension(:), intent(in) :: wind, t1, q1, prsl1, landfrac, lakefrac, oceanfrac, & cd_wat, cd_lnd, cd_ice, cdq_wat, cdq_lnd, cdq_ice, rb_wat, rb_lnd, rb_ice, stress_wat, & diff --git a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 index 487753027..fd3b14031 100644 --- a/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 +++ b/physics/PBL/MYNN_EDMF/mynnedmf_wrapper.F90 @@ -172,7 +172,7 @@ SUBROUTINE mynnedmf_wrapper_run( & implicit none !------------------------------------------------------------------- - real(kind_phys) :: huge + real(kind_phys), intent(in) :: huge character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -290,7 +290,7 @@ SUBROUTINE mynnedmf_wrapper_run( & real(kind_phys), dimension(:), intent(inout) :: 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(in) :: vdep real(kind_phys), dimension(im) :: emis_ant_no !MYNN-2D diff --git a/physics/PBL/SATMEDMF/satmedmfvdif.meta b/physics/PBL/SATMEDMF/satmedmfvdif.meta index b94e74d6c..f6330a2d4 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdif.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdif.meta @@ -503,7 +503,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - intent = in + intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.meta b/physics/PBL/SATMEDMF/satmedmfvdifq.meta index e203187aa..9819de89c 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.meta +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.meta @@ -625,7 +625,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - intent = in + intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/PBL/SHOC/moninshoc.meta b/physics/PBL/SHOC/moninshoc.meta index 474689ea0..773b753bd 100644 --- a/physics/PBL/SHOC/moninshoc.meta +++ b/physics/PBL/SHOC/moninshoc.meta @@ -456,7 +456,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - intent = in + intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/PBL/YSU/ysuvdif.meta b/physics/PBL/YSU/ysuvdif.meta index 20e96a92d..0d5eafb03 100644 --- a/physics/PBL/YSU/ysuvdif.meta +++ b/physics/PBL/YSU/ysuvdif.meta @@ -466,7 +466,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,cumulative_change_of_state_variables_outer_index_max) type = real kind = kind_phys - intent = in + intent = inout [dtidx] standard_name = cumulative_change_of_state_variables_outer_index long_name = index of state-variable and process in last dimension of diagnostic tendencies array AKA cumulative_change_index diff --git a/physics/SFC_Layer/UFS/sfc_diag.meta b/physics/SFC_Layer/UFS/sfc_diag.meta index 4fdf37916..6c4effd3d 100644 --- a/physics/SFC_Layer/UFS/sfc_diag.meta +++ b/physics/SFC_Layer/UFS/sfc_diag.meta @@ -218,7 +218,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = inout + intent = in [tskin] standard_name = surface_skin_temperature long_name = surface skin temperature @@ -314,7 +314,7 @@ long_name = model 2m diagnostics use the temperature and humidity calculated by the lake model units = flag dimensions = () - type = integer + type = logical intent = in [wind] standard_name = wind_speed_at_lowest_model_layer diff --git a/physics/SFC_Layer/UFS/sfc_diag_post.F90 b/physics/SFC_Layer/UFS/sfc_diag_post.F90 index 6945e48e9..3170a7926 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(in) :: 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_diag_post.meta b/physics/SFC_Layer/UFS/sfc_diag_post.meta index 4abb3bac0..ca461b578 100644 --- a/physics/SFC_Layer/UFS/sfc_diag_post.meta +++ b/physics/SFC_Layer/UFS/sfc_diag_post.meta @@ -96,7 +96,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = in [q2mp] standard_name = specific_humidity_at_2m_from_noahmp long_name = 2 meter specific humidity from noahmp @@ -104,7 +104,7 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys - intent = out + intent = in [t2m] standard_name = air_temperature_at_2m long_name = 2 meter temperature From e4f22f7be02db485a695e96a7539d971515f7f0e Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 25 Apr 2024 16:26:41 +0000 Subject: [PATCH 209/249] Address reviewers comment --- physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta index 09875b6bc..1a6030247 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta @@ -229,7 +229,7 @@ dimensions = (horizontal_loop_extent,vertical_layer_dimension,number_of_tracers) type = real kind = kind_phys - intent = inout + intent = in [prsl] standard_name = air_pressure long_name = layer mean pressure From 25cfc3a2cb79615e08f6c4e6faf90b2951a15b3d Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 25 Apr 2024 21:00:35 +0000 Subject: [PATCH 210/249] Address reviewers comment --- .../Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 | 3 +-- .../Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta | 7 ------- 2 files changed, 1 insertion(+), 9 deletions(-) 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 e4877877c..a316f6576 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.F90 @@ -27,7 +27,7 @@ subroutine GFS_MP_generic_post_run( totprcp, totice, totsnw, totgrp, cnvprcpb, totprcpb, toticeb, totsnwb, totgrpb, rain_cpl, rainc_cpl, snow_cpl, & pwat, frzr, frzrb, frozr, frozrb, tsnowp, tsnowpb, rhonewsn1, exticeden, & drain_cpl, dsnow_cpl, lsm, lsm_ruc, lsm_noahmp, raincprv, rainncprv, iceprv, snowprv, & - graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, dfi_radar_max_intervals, & + graupelprv, draincprv, drainncprv, diceprv, dsnowprv, dgraupelprv, dtp, & dtend, dtidx, index_of_temperature, index_of_process_mp,ldiag3d, qdiag3d,dqdt_qmicro, lssav, num_dfi_radar, & fh_dfi_radar,index_of_process_dfi_radar, ix_dfi_radar, dfi_radar_tten, radar_tten_limits, fhour, prevsq, & iopt_lake, iopt_lake_clm, lkm, use_lake_model, errmsg, errflg) @@ -43,7 +43,6 @@ subroutine GFS_MP_generic_post_run( integer, intent(in) :: index_of_temperature,index_of_process_mp,use_lake_model(:) integer, intent(in) :: imfshalcnv,imfshalcnv_gf,imfdeepcnv,imfdeepcnv_gf,imfdeepcnv_samf integer, dimension (:), intent(in) :: htop - integer, intent(in) :: dfi_radar_max_intervals real(kind=kind_phys), intent(in) :: fh_dfi_radar(:), fhour, con_t0c real(kind=kind_phys), intent(in) :: radar_tten_limits(:) integer, intent(in) :: ix_dfi_radar(:) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta index 1a6030247..2bfac0ee3 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.meta @@ -772,13 +772,6 @@ type = real kind = kind_phys intent = in -[dfi_radar_max_intervals] - standard_name = maximum_number_of_radar_derived_temperature_or_convection_suppression_intervals - long_name = maximum allowed number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression - units = count - dimensions = () - type = integer - intent = in [num_dfi_radar] standard_name = number_of_radar_derived_temperature_or_convection_suppression_intervals long_name = number of time ranges with radar-derived microphysics temperature tendencies or radar-derived convection suppression From caaa77fd7bf964d50dbbdbf24d1b75ddf27d3118 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 26 Apr 2024 19:27:57 -0600 Subject: [PATCH 211/249] More bugfixes for optional arguments --- .../UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 | 1 - .../UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 | 4 +- .../Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 | 9 ++- physics/MP/GFDL/fv_sat_adj.F90 | 18 +++-- physics/MP/GFDL/fv_sat_adj.meta | 76 +++++++++++++------ physics/Radiation/radiation_surface.f | 3 +- physics/photochem/module_ozphys.F90 | 2 +- 7 files changed, 75 insertions(+), 38 deletions(-) diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 index 933d75bfe..6f05c93db 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.F90 @@ -179,7 +179,6 @@ subroutine GFS_radiation_surface_run ( & call setalb (slmsk, lsm, lsm_noahmp, lsm_ruc, use_cice_alb, snodi, sncovr, sncovr_ice, & snoalb, zorl, coszen, tsfg, tsfa, hprime, frac_grid, lakefrac, & -! snoalb, zorl, coszen, tsfg, tsfa, hprime, frac_grid, min_seaice, & alvsf, alnsf, alvwf, alnwf, facsf, facwf, fice, tisfc, & albdvis_lnd, albdnir_lnd, albivis_lnd, albinir_lnd, & albdvis_ice, albdnir_ice, albivis_ice, albinir_ice, & diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 index 69d723b8a..eadc041fd 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.F90 @@ -143,11 +143,11 @@ 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 real(kind=kind_phys), dimension(:,:), intent(in), optional :: & mg_cld, effrr_in, & cnvw_in, cnvc_in, & - sppt_wts + sppt_wts, sfc_wts real(kind=kind_phys), dimension(:,:,:), intent(in) :: qgrs real(kind=kind_phys), dimension(:,:,:), intent(inout) :: aer_nm diff --git a/physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 b/physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 index f5eecbd18..c2949f9a4 100644 --- a/physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 +++ b/physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 @@ -37,15 +37,16 @@ subroutine gcycle (me, nthrds, nx, ny, isc, jsc, nsst, tile_num, nlunit, fn_nml, real(kind=kind_phys), intent(in) :: fhcyc, phour, landfrac(:), lakefrac(:), & min_seaice, min_lakeice, & xlat_d(:), xlon_d(:) - real(kind=kind_phys), intent(inout) :: smc(:,:), & - slc(:,:), & - stc(:,:), & + real(kind=kind_phys), intent(inout), optional :: & smois(:,:), & sh2o(:,:), & tslb(:,:), & + tref(:) + real(kind=kind_phys), intent(inout) :: smc(:,:), & + slc(:,:), & + stc(:,:), & tiice(:,:), & tg3(:), & - tref(:), & tsfc(:), & tsfco(:), & tisfc(:), & diff --git a/physics/MP/GFDL/fv_sat_adj.F90 b/physics/MP/GFDL/fv_sat_adj.F90 index ad8e5af0e..22077b9bb 100644 --- a/physics/MP/GFDL/fv_sat_adj.F90 +++ b/physics/MP/GFDL/fv_sat_adj.F90 @@ -230,7 +230,7 @@ end subroutine fv_sat_adj_finalize !! \section arg_table_fv_sat_adj_run Argument Table !! \htmlinclude fv_sat_adj_run.html !! -subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc, iec, kmp, km, kmdelz, js, je, jsd, jed, jsc, jec, & +subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc1, iec1, isc2, iec2, kmp, km, kmdelz, js, je, jsd, jed, jsc1, jec1, jsc2, jec2, & ng, hydrostatic, fast_mp_consv, te0_2d, te0, ngas, qvi, qv, ql, qi, qr, & qs, qg, hs, peln, delz, delp, pt, pkz, q_con, akap, cappa, area, dtdt, & out_dt, last_step, do_qa, qa, & @@ -245,8 +245,10 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc, iec, kmp, km, kmdelz integer, intent(in) :: ie integer, intent(in) :: isd integer, intent(in) :: ied - integer, intent(in) :: isc - integer, intent(in) :: iec + integer, intent(in) :: isc1 + integer, intent(in) :: iec1 + integer, intent(in) :: isc2 + integer, intent(in) :: iec2 integer, intent(in) :: kmp integer, intent(in) :: km integer, intent(in) :: kmdelz @@ -254,8 +256,10 @@ subroutine fv_sat_adj_run(mdt, zvir, is, ie, isd, ied, isc, iec, kmp, km, kmdelz integer, intent(in) :: je integer, intent(in) :: jsd integer, intent(in) :: jed - integer, intent(in) :: jsc - integer, intent(in) :: jec + integer, intent(in) :: jsc1 + integer, intent(in) :: jec1 + integer, intent(in) :: jsc2 + integer, intent(in) :: jec2 integer, intent(in) :: ng logical, intent(in) :: hydrostatic logical, intent(in) :: fast_mp_consv @@ -263,7 +267,11 @@ 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 +#ifdef MULTI_GASES real(kind=kind_dyn), intent(inout), optional :: qvi(isd:ied, jsd:jed, 1:km, 1:ngas) +#else + real(kind=kind_dyn), intent(inout), optional :: qvi(:,:,:,:) +#endif 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/GFDL/fv_sat_adj.meta b/physics/MP/GFDL/fv_sat_adj.meta index 5e129e2d9..304bd3ab3 100644 --- a/physics/MP/GFDL/fv_sat_adj.meta +++ b/physics/MP/GFDL/fv_sat_adj.meta @@ -137,15 +137,29 @@ dimensions = () type = integer intent = in -[isc] - standard_name = starting_x_direction_index_alloc +[isc1] + standard_name = starting_x_direction_index_alloc1 long_name = starting X direction index for allocation units = count dimensions = () type = integer intent = in -[iec] - standard_name = ending_x_direction_index_alloc +[iec1] + standard_name = ending_x_direction_index_alloc1 + long_name = ending X direction index for allocation + units = count + dimensions = () + type = integer + intent = in +[isc2] + standard_name = starting_x_direction_index_alloc2 + long_name = starting X direction index for allocation + units = count + dimensions = () + type = integer + intent = in +[iec2] + standard_name = ending_x_direction_index_alloc2 long_name = ending X direction index for allocation units = count dimensions = () @@ -214,15 +228,29 @@ dimensions = () type = integer intent = in -[jsc] - standard_name = starting_y_direction_index_alloc +[jsc1] + standard_name = starting_y_direction_index_alloc1 long_name = starting X direction index for allocation units = count dimensions = () type = integer intent = in -[jec] - standard_name = ending_y_direction_index_alloc +[jec1] + standard_name = ending_y_direction_index_alloc1 + long_name = ending X direction index for allocation + units = count + dimensions = () + type = integer + intent = in +[jsc2] + standard_name = starting_y_direction_index_alloc2 + long_name = starting X direction index for allocation + units = count + dimensions = () + type = integer + intent = in +[jec2] + standard_name = ending_y_direction_index_alloc2 long_name = ending X direction index for allocation units = count dimensions = () @@ -276,7 +304,7 @@ standard_name = gas_tracers_for_multi_gas_physics_at_Lagrangian_surface long_name = gas tracers for multi gas physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics,1:number_of_gases_for_multi_gases_physics) type = real kind = kind_dyn intent = inout @@ -285,7 +313,7 @@ standard_name = water_vapor_specific_humidity_at_Lagrangian_surface long_name = water vapor specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -293,7 +321,7 @@ standard_name = cloud_liquid_water_specific_humidity_at_Lagrangian_surface long_name = cloud liquid water specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -301,7 +329,7 @@ standard_name = cloud_ice_specific_humidity_at_Lagrangian_surface long_name = cloud ice specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -309,7 +337,7 @@ standard_name = cloud_rain_specific_humidity_at_Lagrangian_surface long_name = cloud rain specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -317,7 +345,7 @@ standard_name = cloud_snow_specific_humidity_at_Lagrangian_surface long_name = cloud snow specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -325,7 +353,7 @@ standard_name = cloud_graupel_specific_humidity_at_Lagrangian_surface long_name = cloud graupel specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -333,7 +361,7 @@ standard_name = surface_geopotential_at_Lagrangian_surface long_name = surface geopotential at Lagrangian surface units = m2 s-2 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1) type = real kind = kind_dyn intent = in @@ -341,7 +369,7 @@ standard_name = log_pressure_at_Lagrangian_surface long_name = logarithm of pressure at Lagrangian surface units = Pa - dimensions = (starting_x_direction_index:ending_x_direction_index,1:vertical_dimension_for_fast_physics_plus_one,starting_y_direction_index:ending_y_direction_index) + dimensions = (starting_x_direction_index_alloc2:ending_x_direction_index_alloc2,1:vertical_dimension_for_fast_physics_plus_one,starting_y_direction_index_alloc2:ending_y_direction_index_alloc2) type = real kind = kind_dyn intent = in @@ -349,7 +377,7 @@ standard_name = thickness_at_Lagrangian_surface long_name = thickness at Lagrangian_surface units = m - dimensions = (starting_x_direction_index:ending_x_direction_index,starting_y_direction_index:ending_y_direction_index,1:vertical_dimension_for_thickness_at_Lagrangian_surface) + dimensions = (starting_x_direction_index_alloc2:ending_x_direction_index_alloc2,starting_y_direction_index_alloc2:ending_y_direction_index_alloc2,1:vertical_dimension_for_thickness_at_Lagrangian_surface) type = real kind = kind_dyn intent = in @@ -357,7 +385,7 @@ standard_name = pressure_thickness_at_Lagrangian_surface long_name = pressure thickness at Lagrangian surface units = Pa - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = in @@ -365,7 +393,7 @@ standard_name = virtual_temperature_at_Lagrangian_surface long_name = virtual temperature at Lagrangian surface units = K - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -373,7 +401,7 @@ standard_name = finite_volume_mean_edge_pressure_raised_to_the_power_of_kappa long_name = finite-volume mean edge pressure in Pa raised to the power of kappa units = 1 - dimensions = (starting_x_direction_index:ending_x_direction_index,starting_y_direction_index:ending_y_direction_index,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc2:ending_x_direction_index_alloc2,starting_y_direction_index_alloc2:ending_y_direction_index_alloc2,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = inout @@ -381,7 +409,7 @@ standard_name = cloud_condensed_water_specific_humidity_at_Lagrangian_surface long_name = cloud condensed water specific humidity updated by fast physics at Lagrangian surface units = kg kg-1 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_condensed_water_at_Lagrangian_surface) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_condensed_water_at_Lagrangian_surface) type = real kind = kind_dyn intent = inout @@ -405,7 +433,7 @@ standard_name = cell_area_for_fast_physics long_name = area of the grid cell for fast physics units = m2 - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1) type = real kind = kind_grid intent = in @@ -442,7 +470,7 @@ standard_name = cloud_fraction_at_Lagrangian_surface long_name = cloud fraction at Lagrangian surface units = none - dimensions = (starting_x_direction_index_alloc:ending_x_direction_index_alloc,starting_y_direction_index_alloc:ending_y_direction_index_alloc,1:vertical_dimension_for_fast_physics) + dimensions = (starting_x_direction_index_alloc1:ending_x_direction_index_alloc1,starting_y_direction_index_alloc1:ending_y_direction_index_alloc1,1:vertical_dimension_for_fast_physics) type = real kind = kind_dyn intent = out diff --git a/physics/Radiation/radiation_surface.f b/physics/Radiation/radiation_surface.f index 7b7caf849..8bbfd6ed5 100644 --- a/physics/Radiation/radiation_surface.f +++ b/physics/Radiation/radiation_surface.f @@ -421,8 +421,9 @@ subroutine setalb & & lakefrac, & & slmsk, snodi, zorlf, coszf, tsknf, tairf, hprif, & & alvsf, alnsf, alvwf, alnwf, facsf, facwf, fice, tisfc, & - & icealbdvis, icealbdnir, icealbivis, icealbinir, & & sncovr, sncovr_ice, snoalb, albPpert ! sfc-perts, mgehne + real (kind=kind_phys), dimension(:), intent(in), optional :: & + & icealbdvis, icealbdnir, icealbivis, icealbinir real (kind=kind_phys), intent(in) :: pertalb, con_ttp! sfc-perts, mgehne real (kind=kind_phys), dimension(:), intent(in) :: & & fracl, fraco, fraci diff --git a/physics/photochem/module_ozphys.F90 b/physics/photochem/module_ozphys.F90 index b66eb0a74..897458fdb 100644 --- a/physics/photochem/module_ozphys.F90 +++ b/physics/photochem/module_ozphys.F90 @@ -221,7 +221,7 @@ subroutine run_o3prog_2015(this, con_1ovg, dt, p, t, dp, ozpl, oz, do_diag, do3_ real(kind_phys), intent(inout), dimension(:,:) :: & oz ! Ozone concentration updated by physics logical, intent(in) :: do_diag - real(kind_phys), intent(inout), dimension(:,:) :: & + real(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 From 28182260aa4b36d4b1cf53840a1bdec45bc55c93 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 29 Apr 2024 08:33:51 -0600 Subject: [PATCH 212/249] Add optional attribute to several variables in mp_gt_driver --- physics/MP/Thompson/module_mp_thompson.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/MP/Thompson/module_mp_thompson.F90 b/physics/MP/Thompson/module_mp_thompson.F90 index 62e2688c7..86d88dd27 100644 --- a/physics/MP/Thompson/module_mp_thompson.F90 +++ b/physics/MP/Thompson/module_mp_thompson.F90 @@ -1078,7 +1078,7 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & ! Extended diagnostics, array pointers only associated if ext_diag flag is .true. LOGICAL, INTENT (IN) :: ext_diag LOGICAL, OPTIONAL, INTENT(IN):: aero_ind_fdb - REAL, DIMENSION(:,:,:), INTENT(INOUT):: & + REAL, DIMENSION(:,:,:), INTENT(INOUT), OPTIONAL :: & !vts1, txri, txrc, & prw_vcdc, & prw_vcde, tpri_inu, tpri_ide_d, & @@ -1908,7 +1908,7 @@ subroutine mp_thompson (qv1d, qc1d, qi1d, qr1d, qs1d, qg1d, ni1d, & LOGICAL, INTENT(IN) :: ext_diag LOGICAL, INTENT(IN) :: sedi_semi INTEGER, INTENT(IN) :: decfl - REAL, DIMENSION(:), INTENT(OUT):: & + REAL, DIMENSION(:), INTENT(OUT), OPTIONAL :: & !vtsk1, txri1, txrc1, & prw_vcdc1, & prw_vcde1, tpri_inu1, tpri_ide1_d, & From b9fd2d87355bd7811801ee49a52ba221025a5fe8 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 30 Apr 2024 15:59:28 -0600 Subject: [PATCH 213/249] Add missing OPTIONAL Fortran attribute in internal routines: physics/MP/Thompson/module_mp_thompson.F90 physics/PBL/MYNN_EDMF/module_bl_mynn.F90 physics/SFC_Layer/MYNN/module_sf_mynn.F90 --- physics/MP/Thompson/module_mp_thompson.F90 | 7 +++-- physics/PBL/MYNN_EDMF/module_bl_mynn.F90 | 31 +++++++++++--------- physics/SFC_Layer/MYNN/module_sf_mynn.F90 | 34 +++++++++++++--------- 3 files changed, 42 insertions(+), 30 deletions(-) diff --git a/physics/MP/Thompson/module_mp_thompson.F90 b/physics/MP/Thompson/module_mp_thompson.F90 index 86d88dd27..78b0d360c 100644 --- a/physics/MP/Thompson/module_mp_thompson.F90 +++ b/physics/MP/Thompson/module_mp_thompson.F90 @@ -1046,9 +1046,10 @@ SUBROUTINE mp_gt_driver(qv, qc, qr, qi, qs, qg, ni, nr, nc, & re_cloud, re_ice, re_snow REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: pfils, pflls INTEGER, INTENT(IN) :: rand_perturb_on, kme_stoch, n_var_spp - REAL, DIMENSION(:,:), INTENT(IN) :: rand_pert - REAL, DIMENSION(:), INTENT(IN) :: spp_prt_list, spp_stddev_cutoff - CHARACTER(len=10), DIMENSION(:), INTENT(IN) :: spp_var_list + REAL, DIMENSION(:,:), INTENT(IN), OPTIONAL :: rand_pert + REAL, DIMENSION(:), INTENT(IN), OPTIONAL :: spp_prt_list + REAL, DIMENSION(:), INTENT(IN) :: spp_stddev_cutoff + CHARACTER(len=10), DIMENSION(:), INTENT(IN), OPTIONAL :: spp_var_list INTEGER, INTENT(IN):: has_reqc, has_reqi, has_reqs #if ( WRF_CHEM == 1 ) REAL, DIMENSION(ims:ime, kms:kme, jms:jme), INTENT(INOUT):: & diff --git a/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 b/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 index cc7a47ce6..4983fc796 100644 --- a/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 +++ b/physics/PBL/MYNN_EDMF/module_bl_mynn.F90 @@ -466,8 +466,10 @@ SUBROUTINE mynn_bl_driver( & real(kind_phys), dimension(:,:), intent(in):: ozone real(kind_phys), dimension(:), intent(in):: ust, & &ch,qsfc,ps,wspd + real(kind_phys), dimension(:,:), intent(inout), optional :: & + &Qke,Tsq,Qsq,Cov real(kind_phys), dimension(:,:), intent(inout) :: & - &Qke,Tsq,Qsq,Cov,qke_adv + &qke_adv real(kind_phys), dimension(:,:), intent(inout) :: & &rublten,rvblten,rthblten,rqvblten,rqcblten, & &rqiblten,rqsblten,rqniblten,rqncblten, & @@ -475,12 +477,12 @@ SUBROUTINE mynn_bl_driver( & real(kind_phys), dimension(:,:), intent(inout) :: dozone real(kind_phys), dimension(:,:), intent(in) :: rthraten - real(kind_phys), dimension(:,:), intent(out) :: exch_h,exch_m + real(kind_phys), dimension(:,:), intent(out), optional :: exch_h,exch_m real(kind_phys), dimension(:), intent(in) :: xland, & &ts,znt,hfx,qfx,uoce,voce !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_thl3D,sub_sqv3D,det_thl3D,det_sqv3D @@ -493,32 +495,35 @@ SUBROUTINE mynn_bl_driver( & real(kind_phys), dimension(ims:ime) :: psig_bl,psig_shcu integer,dimension(:),intent(INOUT) :: & - &KPBL,ktop_plume + &KPBL + integer,dimension(:),intent(INOUT), optional :: & + &ktop_plume - real(kind_phys), dimension(:), intent(out) :: & + real(kind_phys), dimension(:), intent(out), optional :: & &maxmf,maxwidth,ztop_plume - real(kind_phys), dimension(:,:), intent(inout) :: el_pbl + real(kind_phys), dimension(:,:), intent(inout), optional :: el_pbl - real(kind_phys), dimension(:,:), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout), optional :: & &qWT,qSHEAR,qBUOY,qDISS,dqke ! 3D budget arrays are not allocated when tke_budget == 0 ! 1D (local) budget arrays are used for passing between subroutines. real(kind_phys), dimension(kts:kte) :: & &qwt1,qshear1,qbuoy1,qdiss1,dqke1,diss_heat - real(kind_phys), dimension(:,:), intent(out) :: Sh3D,Sm3D + real(kind_phys), dimension(:,:), intent(out), optional :: Sh3D,Sm3D - real(kind_phys), dimension(:,:), intent(inout) :: & + real(kind_phys), dimension(:,:), intent(inout), optional :: & &qc_bl,qi_bl,cldfra_bl real(kind_phys), dimension(kts:kte) :: qc_bl1D,qi_bl1D, & &cldfra_bl1D,qc_bl1D_old,qi_bl1D_old,cldfra_bl1D_old ! smoke/chemical arrays integer, intent(IN ) :: nchem, kdvel, ndvel - real(kind_phys), dimension(:,:,:), intent(INOUT) :: chem3d - real(kind_phys), dimension(:,:), intent(IN) :: vdep - real(kind_phys), dimension(:), intent(IN) :: frp,EMIS_ANT_NO + real(kind_phys), dimension(:,:,:), intent(INOUT), optional :: chem3d + real(kind_phys), dimension(:,:), intent(IN), optional :: vdep + real(kind_phys), dimension(:), intent(IN), optional :: frp + real(kind_phys), dimension(:), intent(IN) :: EMIS_ANT_NO !local real(kind_phys), dimension(kts:kte ,nchem) :: chem1 real(kind_phys), dimension(kts:kte+1,nchem) :: s_awchem1 @@ -575,7 +580,7 @@ SUBROUTINE mynn_bl_driver( & ! Stochastic fields integer, intent(IN) :: spp_pbl - real(kind_phys), dimension(:,:), intent(IN) :: pattern_spp_pbl + real(kind_phys), dimension(:,:), intent(IN), optional :: pattern_spp_pbl real(kind_phys), dimension(KTS:KTE) :: rstoch_col ! Substepping TKE diff --git a/physics/SFC_Layer/MYNN/module_sf_mynn.F90 b/physics/SFC_Layer/MYNN/module_sf_mynn.F90 index 3d847348d..588cb0898 100644 --- a/physics/SFC_Layer/MYNN/module_sf_mynn.F90 +++ b/physics/SFC_Layer/MYNN/module_sf_mynn.F90 @@ -284,7 +284,7 @@ SUBROUTINE SFCLAY_mynn( & th3d,pi3d !GJF: This array must be assumed-shape since it is conditionally-allocated - REAL(kind_phys), DIMENSION( :,: ), & + REAL(kind_phys), DIMENSION( :,: ), OPTIONAL, & INTENT(IN) :: pattern_spp_sfc !=================================== ! 2D VARIABLES @@ -304,21 +304,23 @@ SUBROUTINE SFCLAY_mynn( & REAL(kind_phys), DIMENSION( ims:ime ) , & INTENT(INOUT) :: HFLX,HFX, & QFLX,QFX, & - LH, & - MOL,RMOL, & + RMOL, & QSFC, & QGH, & ZNT, & - ZOL, & - USTM, & CPM, & - CHS2, & - CQS2, & CHS, & CH, & FLHC,FLQC, & GZ1OZ0,WSPD, & - PSIM,PSIH, & + PSIM,PSIH + REAL(kind_phys), DIMENSION( ims:ime ), OPTIONAL , & + INTENT(INOUT) :: USTM, & + CHS2, & + CQS2, & + LH, & + ZOL, & + MOL, & WSTAR LOGICAL, DIMENSION( ims:ime ), INTENT(IN) :: & @@ -607,18 +609,20 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & RMOL REAL(kind_phys), DIMENSION( ims:ime ), & INTENT(INOUT) :: HFLX,QFLX, & - LH,MOL, & QGH,QSFC, & ZNT, & - ZOL, & CPM, & - CHS2,CQS2, & CHS,CH, & FLHC,FLQC, & GZ1OZ0, & WSPD, & PSIM, & - PSIH, & + PSIH + REAL(kind_phys), DIMENSION( ims:ime ), OPTIONAL, & + INTENT(INOUT) :: MOL, & + ZOL, & + LH, & + CHS2,CQS2, & USTM LOGICAL, DIMENSION( ims:ime ), INTENT(IN) :: & @@ -656,8 +660,10 @@ SUBROUTINE SFCLAY1D_mynn(flag_iter, & !-------------------------------------------- !JOE-additinal output REAL(kind_phys), DIMENSION( ims:ime ), & - & INTENT(OUT) :: wstar, & - & qstar + & INTENT(OUT) :: qstar + REAL(kind_phys), DIMENSION( ims:ime ), OPTIONAL, & + & INTENT(OUT) :: wstar + !JOE-end ! CCPP error handling From 7b6a23e393ad33dc56f13362c789ca5e3911e733 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 1 May 2024 07:21:48 -0600 Subject: [PATCH 214/249] Add missing optional attributes in physics/CONV/Grell_Freitas/cu_gf_deep.F90 --- physics/CONV/Grell_Freitas/cu_gf_deep.F90 | 8 ++-- physics/CONV/Grell_Freitas/cu_gf_driver.F90 | 53 ++++++++++----------- 2 files changed, 30 insertions(+), 31 deletions(-) diff --git a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 index 8a2c73600..bb5ff4b90 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 @@ -158,7 +158,7 @@ subroutine cu_gf_deep_run( & !$acc declare copyin(rand_clos,rand_mom,rand_vmas) integer, intent(in) :: do_capsuppress - real(kind=kind_phys), intent(in), dimension(:) :: cap_suppress_j + real(kind=kind_phys), intent(in), dimension(:), optional :: cap_suppress_j !$acc declare create(cap_suppress_j) ! ! @@ -217,11 +217,11 @@ subroutine cu_gf_deep_run( & mconv,ccn !$acc declare copy(mconv,ccn) real(kind=kind_phys), dimension (:,:,:) & - ,intent (inout) :: & + ,intent (inout), optional :: & chem3d logical, intent (in) :: do_smoke_transport real(kind=kind_phys), dimension (:,:) & - , intent (out) :: wetdpc_deep + , intent (out), optional :: wetdpc_deep real(kind=kind_phys), intent (in) :: fscav(:) !$acc declare copy(chem3d) copyout(wetdpc_deep) copyin(fscav) @@ -376,7 +376,7 @@ subroutine cu_gf_deep_run( & !$acc ktopdby,kbconx,ierr2,ierr3,kbmax) integer, dimension (its:ite), intent(inout) :: ierr - integer, dimension (its:ite), intent(in) :: csum + integer, dimension (its:ite), intent(in), optional :: csum !$acc declare copy(ierr) copyin(csum) integer :: & iloop,nens3,ki,kk,i,k diff --git a/physics/CONV/Grell_Freitas/cu_gf_driver.F90 b/physics/CONV/Grell_Freitas/cu_gf_driver.F90 index 9db7dcfd9..df5a196b1 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_driver.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_driver.F90 @@ -816,33 +816,32 @@ subroutine cu_gf_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,dx & ,mconv & ,omeg & - - ,cactiv & - ,cnvwt & - ,zu & - ,zd & - ,zdm & ! hli - ,edt & - ,edtm & ! hli - ,xmb & - ,xmbm & - ,xmbs & - ,pret & - ,outu & - ,outv & - ,outt & - ,outq & - ,outqc & - ,kbcon & - ,ktop & - ,cupclw & - ,frhd & - ,ierr & - ,ierrc & - ,nchem & - ,fscav & - ,chem3d & - ,wetdpc_deep & + ,cactiv & + ,cnvwt & + ,zu & + ,zd & + ,zdm & ! hli + ,edt & + ,edtm & ! hli + ,xmb & + ,xmbm & + ,xmbs & + ,pret & + ,outu & + ,outv & + ,outt & + ,outq & + ,outqc & + ,kbcon & + ,ktop & + ,cupclw & + ,frhd & + ,ierr & + ,ierrc & + ,nchem & + ,fscav & + ,chem3d & + ,wetdpc_deep & ,do_smoke_transport & ! the following should be set to zero if not available ,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist From 25330edc814d276ee62fc59984a0c5233888ef42 Mon Sep 17 00:00:00 2001 From: drnimbusrain Date: Thu, 2 May 2024 18:49:03 +0000 Subject: [PATCH 215/249] Initial commit of canopy resistane (rca) in Noah-MP for AQM. --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 25 +++++++++++++++---- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 12 ++++++--- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 8 ++++++ 3 files changed, 36 insertions(+), 9 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 6abd59f69..b93d6799c 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -449,7 +449,7 @@ subroutine noahmp_sflx (parameters, & ghb , irg , irc , irb , tr , evc , & ! out : chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & - laisha , rb , qsfcveg , qsfcbare & + laisha , rb , qsfcveg , qsfcbare, rca & #ifdef CCPP ,errmsg, errflg) #else @@ -602,6 +602,7 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(out) :: t2mb !< 2-m air temperature over bare ground part [k] real (kind=kind_phys), intent(out) :: rssun !< sunlit leaf stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: rssha !< shaded leaf stomatal resistance (s/m) + real (kind=kind_phys), intent(out) :: rca !total canopy/stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: bgap real (kind=kind_phys), intent(out) :: wgap real (kind=kind_phys), dimension(1:2) , intent(out) :: albd !< albedo (direct) @@ -854,7 +855,7 @@ subroutine noahmp_sflx (parameters, & fsrg ,rssun ,rssha ,albd ,albi ,albsnd,albsni, bgap ,wgap, tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb , & !out emissi ,pah ,canhs, & - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2,rca ) !out qsfcveg = eah*ep_2/(sfcprs + epsm1*eah) qsfcbare = qsfc @@ -1697,7 +1698,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in t2mv ,t2mb ,fsrv , & fsrg ,rssun ,rssha ,albd ,albi,albsnd ,albsni,bgap ,wgap,tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb, emissi,pah,canhs,& - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2,rca ) !out !jref:end ! -------------------------------------------------------------------------------------------------- @@ -1846,6 +1847,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(out) :: fsrg !< ground reflected solar radiation (w/m2) real (kind=kind_phys), intent(out) :: rssun !< sunlit leaf stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: rssha !< shaded leaf stomatal resistance (s/m) + real (kind=kind_phys), intent(out) :: rca !total canopy/stomatal resistance (s/m) + !jref:end - out for debug !jref:start; output @@ -2263,7 +2266,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in csigmaf1, & !out !jref:start qc ,qsfc ,psfc , & !in - q2v ,chv2, chleaf, chuc) !inout + q2v ,chv2, chleaf, chuc, & !inout + rca) !out ! new coupling code @@ -3712,7 +3716,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & t2mv ,psnsun ,psnsha ,canhs , & !out csigmaf1, & !out qc ,qsfc ,psfc , & !in - q2v ,cah2 ,chleaf ,chuc ) !inout + q2v ,cah2 ,chleaf ,chuc, & !inout + rca) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve for vegetation (tv) and @@ -3862,6 +3867,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: rssun !sunlit leaf stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: rssha !shaded leaf stomatal resistance (s/m) + real (kind=kind_phys), intent(out) :: rca !total canopy/stomatal resistance (s/m) real (kind=kind_phys) :: mol !monin-obukhov length (m) real (kind=kind_phys) :: dtv !change in tv, last iteration (k) @@ -4203,6 +4209,15 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & end if end if +! total stomatal/canopy resistance Based on Bonan et al. (2011) conductance (1/Rs) equation + if(rssun .le. 0.0 .or. rssha .le. 0.0 .or. & + laisune .eq. 0.0 .or. laishae .eq. 0.0) then + rca = 0.0 + else + rca = ((1.0/(rssun+rb)*laisune) + ((1.0/(rssha+rb))*laishae)) + rca = 1.0/rca !resistance + end if + ! prepare for sensible heat flux above veg. cah = 1./rahc diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 6aff50666..f064c6750 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -157,7 +157,7 @@ subroutine noahmpdrv_run & sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc,& stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, & - ztmax, errmsg, errflg, & + ztmax, rca, errmsg, errflg, & canopy_heat_storage_ccpp, & rainfall_ccpp, & sw_absorbed_total_ccpp, & @@ -400,6 +400,8 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: q2mp ! combined q2m from tiles real(kind=kind_phys), dimension(:) , intent(out) :: zvfun ! real(kind=kind_phys), dimension(:) , intent(out) :: ztmax ! thermal roughness length + real(kind=kind_phys), dimension(:) , intent(out) :: rca ! total canopy/stomatal resistance (s/m) + character(len=*) , intent(out) :: errmsg integer , intent(out) :: errflg @@ -623,6 +625,8 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: canopy_heat_storage ! out | within-canopy heat [W/m2] real (kind=kind_phys) :: spec_humid_sfc_veg ! out | surface specific humidty over vegetation [kg/kg] real (kind=kind_phys) :: spec_humid_sfc_bare ! out | surface specific humidty over bare soil [kg/kg] + + real (kind=kind_phys) :: canopy_resistance ! out | total canopy/stomatal resistance (s/m) real (kind=kind_phys) :: ustarx ! inout |surface friction velocity real (kind=kind_phys) :: prslkix ! in exner function @@ -1015,10 +1019,10 @@ subroutine noahmpdrv_run & precip_adv_heat_total ,snow_sublimation ,canopy_heat_storage , & lai_sunlit ,lai_shaded ,leaf_air_resistance , & #ifdef CCPP - spec_humid_sfc_veg ,spec_humid_sfc_bare , & + spec_humid_sfc_veg ,spec_humid_sfc_bare ,canopy_resistance , & errmsg ,errflg ) #else - spec_humid_sfc_veg ,spec_humid_sfc_bare ) + spec_humid_sfc_veg ,spec_humid_sfc_bare ,canopy_resistance ) #endif #ifdef CCPP @@ -1056,7 +1060,7 @@ subroutine noahmpdrv_run & chxy (i) = ch_noahmp zorl (i) = z0_total * 100.0 ! convert to cm ztmax (i) = z0h_total - + rca (i) = canopy_resistance smc (i,:) = soil_moisture_vol slc (i,:) = soil_liquid_vol snowxy (i) = float(snow_levels) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 39eed1493..7fa13f3af 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -1360,6 +1360,14 @@ type = real kind = kind_phys intent = out +[rca] + standard_name = aerodynamic_resistance_in_canopy + long_name = canopy resistance + units = s m-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 68ea1635d07b025dcb247995ff16b5fbe94ca444 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Mon, 6 May 2024 14:44:19 -0400 Subject: [PATCH 216/249] move calculation of rca to noahmpdrv.F90 from module_sf_noahmplsm (add some output variables in module_sf_noahmplsm subroutines to accomplish this) --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 61 ++++++++----------- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 23 +++++-- 2 files changed, 44 insertions(+), 40 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index b93d6799c..6a04aabaa 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -449,7 +449,7 @@ subroutine noahmp_sflx (parameters, & ghb , irg , irc , irb , tr , evc , & ! out : chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & - laisha , rb , qsfcveg , qsfcbare, rca & + laisha , laisune , laishae , rb , qsfcveg , qsfcbare & #ifdef CCPP ,errmsg, errflg) #else @@ -594,6 +594,8 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(out) :: rb !< leaf boundary layer resistance (s/m) real (kind=kind_phys) , intent(out) :: laisun !< sunlit leaf area index (m2/m2) real (kind=kind_phys) , intent(out) :: laisha !< shaded leaf area index (m2/m2) + real (kind=kind_phys) , intent(out) :: laisune !< sunlit leaf area index, one-sided (m2/m2),effective + real (kind=kind_phys) , intent(out) :: laishae !< shaded leaf area index, one-sided (m2/m2),effective real (kind=kind_phys) , intent(out) :: qsfcveg !< effective spec humid over vegetation real (kind=kind_phys) , intent(out) :: qsfcbare !< effective spec humid over bare soil @@ -602,7 +604,6 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(out) :: t2mb !< 2-m air temperature over bare ground part [k] real (kind=kind_phys), intent(out) :: rssun !< sunlit leaf stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: rssha !< shaded leaf stomatal resistance (s/m) - real (kind=kind_phys), intent(out) :: rca !total canopy/stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: bgap real (kind=kind_phys), intent(out) :: wgap real (kind=kind_phys), dimension(1:2) , intent(out) :: albd !< albedo (direct) @@ -843,11 +844,10 @@ subroutine noahmp_sflx (parameters, & tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout - ustarx , & !inout + ustarx ,tauss , & !inout + laisun ,laisha ,laisune, laishae, rb , & !out #ifdef CCPP - tauss ,laisun ,laisha ,rb , errmsg ,errflg , & !inout -#else - tauss ,laisun ,laisha ,rb , & !inout + errmsg ,errflg , & !out #endif !jref:start qc ,qsfc ,psfc , & !in @@ -855,7 +855,7 @@ subroutine noahmp_sflx (parameters, & fsrg ,rssun ,rssha ,albd ,albi ,albsnd,albsni, bgap ,wgap, tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb , & !out emissi ,pah ,canhs, & - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2,rca ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out qsfcveg = eah*ep_2/(sfcprs + epsm1*eah) qsfcbare = qsfc @@ -1687,18 +1687,17 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout - ustarx , & !inout + ustarx ,tauss , & !inout + laisun ,laisha ,laisune,laishae,rb , & !out #ifdef CCPP - tauss ,laisun ,laisha ,rb ,errmsg ,errflg, & !inout -#else - tauss ,laisun ,laisha ,rb , & !inout + errmsg ,errflg, & !out #endif !jref:start qc ,qsfc ,psfc , & !in t2mv ,t2mb ,fsrv , & fsrg ,rssun ,rssha ,albd ,albi,albsnd ,albsni,bgap ,wgap,tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb, emissi,pah,canhs,& - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2,rca ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out !jref:end ! -------------------------------------------------------------------------------------------------- @@ -1847,8 +1846,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(out) :: fsrg !< ground reflected solar radiation (w/m2) real (kind=kind_phys), intent(out) :: rssun !< sunlit leaf stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: rssha !< shaded leaf stomatal resistance (s/m) - real (kind=kind_phys), intent(out) :: rca !total canopy/stomatal resistance (s/m) - !jref:end - out for debug !jref:start; output @@ -1882,9 +1879,11 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(inout) :: ch !< sensible heat exchange coefficient real (kind=kind_phys) , intent(inout) :: q1 !< real (kind=kind_phys) , intent(inout) :: ustarx !< friction velocity - real (kind=kind_phys) , intent(inout) :: rb !< leaf boundary layer resistance (s/m) - real (kind=kind_phys) , intent(inout) :: laisun !< sunlit leaf area index (m2/m2) - real (kind=kind_phys) , intent(inout) :: laisha !< shaded leaf area index (m2/m2) + real (kind=kind_phys) , intent( out) :: rb !< leaf boundary layer resistance (s/m) + real (kind=kind_phys) , intent( out) :: laisun !< sunlit leaf area index (m2/m2) + real (kind=kind_phys) , intent( out) :: laisha !< shaded leaf area index (m2/m2) + real (kind=kind_phys) , intent( out) :: laisune!< sunlit leaf area index, one-sided (m2/m2),effective + real (kind=kind_phys) , intent( out) :: laishae!< shaded leaf area index, one-sided (m2/m2),effective #ifdef CCPP character(len=*) , intent(inout) :: errmsg integer , intent(inout) :: errflg @@ -2016,6 +2015,10 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in chuc = 0. chv2 = 0. rb = 0. + laisun = 0. + laisha = 0. + laisune = 0. + laishae = 0. cdmnv = 0.0 ezpdv = 0.0 @@ -2266,8 +2269,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in csigmaf1, & !out !jref:start qc ,qsfc ,psfc , & !in - q2v ,chv2, chleaf, chuc, & !inout - rca) !out + q2v ,chv2 ,chleaf , chuc , & !inout + rb ,laisune ,laishae ) !out ! new coupling code @@ -3716,8 +3719,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & t2mv ,psnsun ,psnsha ,canhs , & !out csigmaf1, & !out qc ,qsfc ,psfc , & !in - q2v ,cah2 ,chleaf ,chuc, & !inout - rca) !out + q2v ,cah2 ,chleaf ,chuc, & !inout + rb ,laisune ,laishae) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve for vegetation (tv) and @@ -3841,6 +3844,9 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: chuc !< under canopy exchange coefficient real (kind=kind_phys), intent(out) :: canhs !< canopy heat storage change (w/m2) real (kind=kind_phys), intent(out) :: q2v !< + real (kind=kind_phys), intent(out) :: rb !< bulk leaf boundary layer resistance (s/m) + real (kind=kind_phys), intent(out) :: laisune!< sunlit leaf area index, one-sided (m2/m2),effective + real (kind=kind_phys), intent(out) :: laishae!< shaded leaf area index, one-sided (m2/m2),effective real (kind=kind_phys) :: cah !< sensible heat conductance, canopy air to zlvl air (m/s) real (kind=kind_phys) :: u10v !< 10 m wind speed in eastward dir (m/s) real (kind=kind_phys) :: v10v !< 10 m wind speed in eastward dir (m/s) @@ -3857,7 +3863,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: z0mo !roughness length for intermediate output only (m) real (kind=kind_phys) :: z0h !roughness length, sensible heat (m) real (kind=kind_phys) :: z0hg !roughness length, sensible heat (m) - real (kind=kind_phys) :: rb !bulk leaf boundary layer resistance (s/m) real (kind=kind_phys) :: ramc !aerodynamic resistance for momentum (s/m) real (kind=kind_phys) :: rahc !aerodynamic resistance for sensible heat (s/m) real (kind=kind_phys) :: rawc !aerodynamic resistance for water vapor (s/m) @@ -3867,7 +3872,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: rssun !sunlit leaf stomatal resistance (s/m) real (kind=kind_phys), intent(out) :: rssha !shaded leaf stomatal resistance (s/m) - real (kind=kind_phys), intent(out) :: rca !total canopy/stomatal resistance (s/m) real (kind=kind_phys) :: mol !monin-obukhov length (m) real (kind=kind_phys) :: dtv !change in tv, last iteration (k) @@ -3938,8 +3942,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: hcv !canopy heat capacity j/m2/k, C.He added real (kind=kind_phys) :: vaie !total leaf area index + stem area index,effective - real (kind=kind_phys) :: laisune !sunlit leaf area index, one-sided (m2/m2),effective - real (kind=kind_phys) :: laishae !shaded leaf area index, one-sided (m2/m2),effective integer :: k !index integer :: iter !iteration index @@ -4209,15 +4211,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & end if end if -! total stomatal/canopy resistance Based on Bonan et al. (2011) conductance (1/Rs) equation - if(rssun .le. 0.0 .or. rssha .le. 0.0 .or. & - laisune .eq. 0.0 .or. laishae .eq. 0.0) then - rca = 0.0 - else - rca = ((1.0/(rssun+rb)*laisune) + ((1.0/(rssha+rb))*laishae)) - rca = 1.0/rca !resistance - end if - ! prepare for sensible heat flux above veg. cah = 1./rahc diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index f064c6750..4bed8d4d4 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -620,14 +620,14 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: snow_sublimation ! out | snow sublimation [W/m2] real (kind=kind_phys) :: lai_sunlit ! out | sunlit leaf area index [m2/m2] real (kind=kind_phys) :: lai_shaded ! out | shaded leaf area index [m2/m2] + real (kind=kind_phys) :: lai_sunlit_eff ! out | sunlit leaf area index, one-sided, effective [m2/m2] + real (kind=kind_phys) :: lai_shaded_eff ! out | shaded leaf area index, one-sided, effective [m2/m2] real (kind=kind_phys) :: leaf_air_resistance ! out | leaf boundary layer resistance [s/m] real (kind=kind_phys) :: canopy_heat_storage ! out | within-canopy heat [W/m2] real (kind=kind_phys) :: spec_humid_sfc_veg ! out | surface specific humidty over vegetation [kg/kg] real (kind=kind_phys) :: spec_humid_sfc_bare ! out | surface specific humidty over bare soil [kg/kg] - real (kind=kind_phys) :: canopy_resistance ! out | total canopy/stomatal resistance (s/m) - real (kind=kind_phys) :: ustarx ! inout |surface friction velocity real (kind=kind_phys) :: prslkix ! in exner function real (kind=kind_phys) :: prsik1x ! in exner function @@ -1017,12 +1017,13 @@ subroutine noahmpdrv_run & ch_vegetated_2m ,ch_bare_ground_2m ,precip_frozen_frac , & precip_adv_heat_veg ,precip_adv_heat_grd_v ,precip_adv_heat_grd_b , & precip_adv_heat_total ,snow_sublimation ,canopy_heat_storage , & - lai_sunlit ,lai_shaded ,leaf_air_resistance , & + lai_sunlit ,lai_shaded ,lai_sunlit_eff , & + lai_shaded_eff ,leaf_air_resistance , & #ifdef CCPP - spec_humid_sfc_veg ,spec_humid_sfc_bare ,canopy_resistance , & + spec_humid_sfc_veg ,spec_humid_sfc_bare , & errmsg ,errflg ) #else - spec_humid_sfc_veg ,spec_humid_sfc_bare ,canopy_resistance ) + spec_humid_sfc_veg ,spec_humid_sfc_bare ) #endif #ifdef CCPP @@ -1060,7 +1061,17 @@ subroutine noahmpdrv_run & chxy (i) = ch_noahmp zorl (i) = z0_total * 100.0 ! convert to cm ztmax (i) = z0h_total - rca (i) = canopy_resistance + + ! total stomatal/canopy resistance Based on Bonan et al. (2011) conductance (1/Rs) equation + if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. & + lai_sunlit_eff .eq. 0.0 .or. lai_shaded_eff .eq. 0.0) then + rca(i) = 0.0 + else + rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit_eff) + & + ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded_eff)) + rca(i) = 1.0/rca(i) !resistance + end if + smc (i,:) = soil_moisture_vol slc (i,:) = soil_liquid_vol snowxy (i) = float(snow_levels) From 55518990828cef94a050b8c8a4bc2dfc2520f516 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 7 May 2024 06:40:21 -0600 Subject: [PATCH 217/249] No opt flags for gcycle.F90 with Intel --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c56070123..a9f7bcac8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -156,7 +156,8 @@ endif() # No optimization for certain schemes when compiling with Intel in Release mode if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel") # Define a list of schemes that can't be optimized with Intel in Release mode - set(SCHEME_NAMES_NO_OPTIMIZATION GFS_typedefs.F90) + set(SCHEME_NAMES_NO_OPTIMIZATION GFS_typedefs.F90 + gcycle.F90) foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_NO_OPTIMIZATION) set(SCHEMES_TMP ${SCHEMES}) # Need to determine the name of the scheme with its path From ef9b15ff614f573d4fa0fdcf51557756444f6cba Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 7 May 2024 06:43:16 -0600 Subject: [PATCH 218/249] Comment out block to nullify local pointers at the end of mp_thompson_run to avoid problems with Intel compiler? --- physics/MP/Thompson/mp_thompson.F90 | 89 +++++++++++++++-------------- 1 file changed, 47 insertions(+), 42 deletions(-) diff --git a/physics/MP/Thompson/mp_thompson.F90 b/physics/MP/Thompson/mp_thompson.F90 index 4bb9964ba..71ac1ac20 100644 --- a/physics/MP/Thompson/mp_thompson.F90 +++ b/physics/MP/Thompson/mp_thompson.F90 @@ -819,48 +819,53 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & pfl_lsan(:,:) = pflls(:,:,1) end if - unset_extended_diagnostic_pointers: if (ext_diag) then - !vts1 => null() - !txri => null() - !txrc => null() - prw_vcdc => null() - prw_vcde => null() - tpri_inu => null() - tpri_ide_d => null() - tpri_ide_s => null() - tprs_ide => null() - tprs_sde_d => null() - tprs_sde_s => null() - tprg_gde_d => null() - tprg_gde_s => null() - tpri_iha => null() - tpri_wfz => null() - tpri_rfz => null() - tprg_rfz => null() - tprs_scw => null() - tprg_scw => null() - tprg_rcs => null() - tprs_rcs => null() - tprr_rci => null() - tprg_rcg => null() - tprw_vcd_c => null() - tprw_vcd_e => null() - tprr_sml => null() - tprr_gml => null() - tprr_rcg => null() - tprr_rcs => null() - tprv_rev => null() - tten3 => null() - qvten3 => null() - qrten3 => null() - qsten3 => null() - qgten3 => null() - qiten3 => null() - niten3 => null() - nrten3 => null() - ncten3 => null() - qcten3 => null() - end if unset_extended_diagnostic_pointers + ! DH* Not really needed because they go out of scope ... + ! But having them in here seems to cause problems with Intel? + ! It looked like this is also nullifying the pointers passed + ! from the CCPP caps. + !unset_extended_diagnostic_pointers: if (ext_diag) then + ! !vts1 => null() + ! !txri => null() + ! !txrc => null() + ! prw_vcdc => null() + ! prw_vcde => null() + ! tpri_inu => null() + ! tpri_ide_d => null() + ! tpri_ide_s => null() + ! tprs_ide => null() + ! tprs_sde_d => null() + ! tprs_sde_s => null() + ! tprg_gde_d => null() + ! tprg_gde_s => null() + ! tpri_iha => null() + ! tpri_wfz => null() + ! tpri_rfz => null() + ! tprg_rfz => null() + ! tprs_scw => null() + ! tprg_scw => null() + ! tprg_rcs => null() + ! tprs_rcs => null() + ! tprr_rci => null() + ! tprg_rcg => null() + ! tprw_vcd_c => null() + ! tprw_vcd_e => null() + ! tprr_sml => null() + ! tprr_gml => null() + ! tprr_rcg => null() + ! tprr_rcs => null() + ! tprv_rev => null() + ! tten3 => null() + ! qvten3 => null() + ! qrten3 => null() + ! qsten3 => null() + ! qgten3 => null() + ! qiten3 => null() + ! niten3 => null() + ! nrten3 => null() + ! ncten3 => null() + ! qcten3 => null() + !end if unset_extended_diagnostic_pointers + ! *DH end subroutine mp_thompson_run !>@} From cafda682f324c2086ec58930b47a6470e824cc58 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 7 May 2024 06:43:44 -0600 Subject: [PATCH 219/249] Remove mistakenly added physics/TODO_DONE.txt --- physics/TODO_DONE.txt | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 physics/TODO_DONE.txt diff --git a/physics/TODO_DONE.txt b/physics/TODO_DONE.txt deleted file mode 100644 index 2984e4be1..000000000 --- a/physics/TODO_DONE.txt +++ /dev/null @@ -1,6 +0,0 @@ -https://docs.google.com/document/d/1fa7kTJXCX0qFv4OTj2BtgIxPBj63vbi_Fa9B4M_InfM/edit#heading=h.rs78qntnlzly - -TODO - - -DONE From 67789c9f20d9fd9bb29ccf81e78b0deb908039f0 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Tue, 7 May 2024 06:44:05 -0600 Subject: [PATCH 220/249] Add optional arguments to physics/CONV/C3/cu_c3* --- physics/CONV/C3/cu_c3_deep.F90 | 11 +++++--- physics/CONV/C3/cu_c3_driver.F90 | 47 ++++++++++++++++---------------- physics/CONV/C3/cu_c3_sh.F90 | 10 +++++-- 3 files changed, 37 insertions(+), 31 deletions(-) diff --git a/physics/CONV/C3/cu_c3_deep.F90 b/physics/CONV/C3/cu_c3_deep.F90 index b7cd5f62d..9bcbe5910 100644 --- a/physics/CONV/C3/cu_c3_deep.F90 +++ b/physics/CONV/C3/cu_c3_deep.F90 @@ -167,7 +167,7 @@ subroutine cu_c3_deep_run( & real(kind=kind_phys), dimension (its:) & ,intent (in ) :: rand_mom,rand_vmas !$acc declare copyin(rand_clos,rand_mom,rand_vmas) - real(kind=kind_phys), intent(in), dimension (its:) :: ca_deep(:) + real(kind=kind_phys), intent(in), dimension (its:), optional :: ca_deep(:) integer, intent(in) :: do_capsuppress real(kind=kind_phys), intent(in), dimension(:) :: cap_suppress_j !$acc declare create(cap_suppress_j) @@ -188,7 +188,10 @@ subroutine cu_c3_deep_run( & frh_out,rainevap real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & - tmf, qmicro, sigmain, forceqv_spechum + tmf + real(kind=kind_phys), dimension (its:,kts:) & + ,intent (in ), optional :: & + qmicro, sigmain, forceqv_spechum real(kind=kind_phys), dimension (its:) & ,intent (inout ) :: & pre,xmb_out @@ -223,7 +226,7 @@ subroutine cu_c3_deep_run( & q,qo,zuo,zdo,zdm !$acc declare sigmaout real(kind=kind_phys), dimension (its:,kts:) & - ,intent (out) :: & + ,intent (out), optional :: & sigmaout real(kind=kind_phys), dimension (its:) & ,intent (in ) :: & @@ -376,7 +379,7 @@ subroutine cu_c3_deep_run( & !$acc ktopdby,kbconx,ierr2,ierr3,kbmax) integer, dimension (its:), intent(inout) :: ierr - integer, dimension (its:), intent(in) :: csum + integer, dimension (its:), intent(in), optional :: csum logical, intent(in) :: do_ca, progsigma logical, intent(in) :: flag_init, flag_restart !$acc declare copy(ierr) copyin(csum) diff --git a/physics/CONV/C3/cu_c3_driver.F90 b/physics/CONV/C3/cu_c3_driver.F90 index 8057ed030..a08d47463 100644 --- a/physics/CONV/C3/cu_c3_driver.F90 +++ b/physics/CONV/C3/cu_c3_driver.F90 @@ -846,30 +846,29 @@ subroutine cu_c3_driver_run(ntracer,garea,im,km,dt,flag_init,flag_restart,& ,ca_deep & ,mconv & ,omeg & - - ,cactiv & - ,cnvwt & - ,zu & - ,zd & - ,zdm & ! hli - ,edt & - ,edtm & ! hli - ,xmb & - ,xmbm & - ,xmbs & - ,pret & - ,outu & - ,outv & - ,outt & - ,outq & - ,outqc & - ,kbcon & - ,ktop & - ,cupclw & - ,frhd & - ,rainevap & - ,ierr & - ,ierrc & + ,cactiv & + ,cnvwt & + ,zu & + ,zd & + ,zdm & ! hli + ,edt & + ,edtm & ! hli + ,xmb & + ,xmbm & + ,xmbs & + ,pret & + ,outu & + ,outv & + ,outt & + ,outq & + ,outqc & + ,kbcon & + ,ktop & + ,cupclw & + ,frhd & + ,rainevap & + ,ierr & + ,ierrc & ! the following should be set to zero if not available ,rand_mom & ! for stochastics mom, if temporal and spatial patterns exist ,rand_vmas & ! for stochastics vertmass, if temporal and spatial patterns exist diff --git a/physics/CONV/C3/cu_c3_sh.F90 b/physics/CONV/C3/cu_c3_sh.F90 index 736292092..0625b2949 100644 --- a/physics/CONV/C3/cu_c3_sh.F90 +++ b/physics/CONV/C3/cu_c3_sh.F90 @@ -102,7 +102,11 @@ subroutine cu_c3_sh_run ( & !$acc declare copy(cnvwt,outt,outq,outqc,cupclw,zuo,outu,outv) real(kind=kind_phys), dimension (its:,kts:) & ,intent (in ) :: & - tmf, qmicro, sigmain, forceqv_spechum + tmf + real(kind=kind_phys), dimension (its:,kts:) & + ,intent (in ), optional :: & + qmicro, sigmain, forceqv_spechum + real(kind=kind_phys), dimension (its:) & ,intent (out ) :: & xmb_out @@ -133,9 +137,9 @@ subroutine cu_c3_sh_run ( & real(kind=kind_phys) & ,intent (in ) :: & dtime,tcrit,fv,r_d,betascu,betamcu,betadcu -!$acc declare sigmaout +!$acc declare sigmaout real(kind=kind_phys), dimension (its:,kts:) & - ,intent (out) :: & + ,intent (out), optional :: & sigmaout From 25a5fc7da60c9f7f7a85c99c8cf2fe1d524e8b74 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Tue, 7 May 2024 13:46:45 -0400 Subject: [PATCH 221/249] use regular lai rather than lai_eff --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 40 +++++++++---------- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 11 ++--- 2 files changed, 22 insertions(+), 29 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 6a04aabaa..2472f11ba 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -449,7 +449,7 @@ subroutine noahmp_sflx (parameters, & ghb , irg , irc , irb , tr , evc , & ! out : chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & - laisha , laisune , laishae , rb , qsfcveg , qsfcbare & + laisha , rb , qsfcveg , qsfcbare & #ifdef CCPP ,errmsg, errflg) #else @@ -594,8 +594,6 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(out) :: rb !< leaf boundary layer resistance (s/m) real (kind=kind_phys) , intent(out) :: laisun !< sunlit leaf area index (m2/m2) real (kind=kind_phys) , intent(out) :: laisha !< shaded leaf area index (m2/m2) - real (kind=kind_phys) , intent(out) :: laisune !< sunlit leaf area index, one-sided (m2/m2),effective - real (kind=kind_phys) , intent(out) :: laishae !< shaded leaf area index, one-sided (m2/m2),effective real (kind=kind_phys) , intent(out) :: qsfcveg !< effective spec humid over vegetation real (kind=kind_phys) , intent(out) :: qsfcbare !< effective spec humid over bare soil @@ -844,10 +842,11 @@ subroutine noahmp_sflx (parameters, & tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout - ustarx ,tauss , & !inout - laisun ,laisha ,laisune, laishae, rb , & !out + ustarx , & !inout #ifdef CCPP - errmsg ,errflg , & !out + tauss ,laisun ,laisha ,rb , errmsg ,errflg , & !inout +#else + tauss ,laisun ,laisha ,rb , & !inout #endif !jref:start qc ,qsfc ,psfc , & !in @@ -1687,10 +1686,11 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in tv ,tg ,stc ,snowh ,eah ,tah , & !inout sneqvo ,sneqv ,sh2o ,smc ,snice ,snliq , & !inout albold ,cm ,ch ,dx ,dz8w ,q2 , & !inout - ustarx ,tauss , & !inout - laisun ,laisha ,laisune,laishae,rb , & !out + ustarx , & !inout #ifdef CCPP - errmsg ,errflg, & !out + tauss ,laisun ,laisha ,rb ,errmsg ,errflg, & !inout +#else + tauss ,laisun ,laisha ,rb , & !inout #endif !jref:start qc ,qsfc ,psfc , & !in @@ -1879,11 +1879,9 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(inout) :: ch !< sensible heat exchange coefficient real (kind=kind_phys) , intent(inout) :: q1 !< real (kind=kind_phys) , intent(inout) :: ustarx !< friction velocity - real (kind=kind_phys) , intent( out) :: rb !< leaf boundary layer resistance (s/m) - real (kind=kind_phys) , intent( out) :: laisun !< sunlit leaf area index (m2/m2) - real (kind=kind_phys) , intent( out) :: laisha !< shaded leaf area index (m2/m2) - real (kind=kind_phys) , intent( out) :: laisune!< sunlit leaf area index, one-sided (m2/m2),effective - real (kind=kind_phys) , intent( out) :: laishae!< shaded leaf area index, one-sided (m2/m2),effective + real (kind=kind_phys) , intent(inout) :: rb !< leaf boundary layer resistance (s/m) + real (kind=kind_phys) , intent(inout) :: laisun !< sunlit leaf area index (m2/m2) + real (kind=kind_phys) , intent(inout) :: laisha !< shaded leaf area index (m2/m2) #ifdef CCPP character(len=*) , intent(inout) :: errmsg integer , intent(inout) :: errflg @@ -2017,8 +2015,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in rb = 0. laisun = 0. laisha = 0. - laisune = 0. - laishae = 0. cdmnv = 0.0 ezpdv = 0.0 @@ -2269,8 +2265,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in csigmaf1, & !out !jref:start qc ,qsfc ,psfc , & !in - q2v ,chv2 ,chleaf , chuc , & !inout - rb ,laisune ,laishae ) !out + q2v ,chv2 ,chleaf ,chuc , & + rb) !out ! new coupling code @@ -3719,8 +3715,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & t2mv ,psnsun ,psnsha ,canhs , & !out csigmaf1, & !out qc ,qsfc ,psfc , & !in - q2v ,cah2 ,chleaf ,chuc, & !inout - rb ,laisune ,laishae) !out + q2v ,cah2 ,chleaf ,chuc , & !inout + rb) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve for vegetation (tv) and @@ -3845,8 +3841,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: canhs !< canopy heat storage change (w/m2) real (kind=kind_phys), intent(out) :: q2v !< real (kind=kind_phys), intent(out) :: rb !< bulk leaf boundary layer resistance (s/m) - real (kind=kind_phys), intent(out) :: laisune!< sunlit leaf area index, one-sided (m2/m2),effective - real (kind=kind_phys), intent(out) :: laishae!< shaded leaf area index, one-sided (m2/m2),effective real (kind=kind_phys) :: cah !< sensible heat conductance, canopy air to zlvl air (m/s) real (kind=kind_phys) :: u10v !< 10 m wind speed in eastward dir (m/s) real (kind=kind_phys) :: v10v !< 10 m wind speed in eastward dir (m/s) @@ -3942,6 +3936,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: hcv !canopy heat capacity j/m2/k, C.He added real (kind=kind_phys) :: vaie !total leaf area index + stem area index,effective + real (kind=kind_phys) :: laisune !sunlit leaf area index, one-sided (m2/m2),effective + real (kind=kind_phys) :: laishae !shaded leaf area index, one-sided (m2/m2),effective integer :: k !index integer :: iter !iteration index diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 4bed8d4d4..7003add22 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -620,8 +620,6 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: snow_sublimation ! out | snow sublimation [W/m2] real (kind=kind_phys) :: lai_sunlit ! out | sunlit leaf area index [m2/m2] real (kind=kind_phys) :: lai_shaded ! out | shaded leaf area index [m2/m2] - real (kind=kind_phys) :: lai_sunlit_eff ! out | sunlit leaf area index, one-sided, effective [m2/m2] - real (kind=kind_phys) :: lai_shaded_eff ! out | shaded leaf area index, one-sided, effective [m2/m2] real (kind=kind_phys) :: leaf_air_resistance ! out | leaf boundary layer resistance [s/m] real (kind=kind_phys) :: canopy_heat_storage ! out | within-canopy heat [W/m2] @@ -1017,8 +1015,7 @@ subroutine noahmpdrv_run & ch_vegetated_2m ,ch_bare_ground_2m ,precip_frozen_frac , & precip_adv_heat_veg ,precip_adv_heat_grd_v ,precip_adv_heat_grd_b , & precip_adv_heat_total ,snow_sublimation ,canopy_heat_storage , & - lai_sunlit ,lai_shaded ,lai_sunlit_eff , & - lai_shaded_eff ,leaf_air_resistance , & + lai_sunlit ,lai_shaded ,leaf_air_resistance , & #ifdef CCPP spec_humid_sfc_veg ,spec_humid_sfc_bare , & errmsg ,errflg ) @@ -1064,11 +1061,11 @@ subroutine noahmpdrv_run & ! total stomatal/canopy resistance Based on Bonan et al. (2011) conductance (1/Rs) equation if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. & - lai_sunlit_eff .eq. 0.0 .or. lai_shaded_eff .eq. 0.0) then + lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then rca(i) = 0.0 else - rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit_eff) + & - ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded_eff)) + rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit) + & + ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded)) rca(i) = 1.0/rca(i) !resistance end if From 94852dbb08ac37185072c60dd79fab7a04cbc436 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 9 May 2024 12:20:48 -0400 Subject: [PATCH 222/249] add initialization for variables that are not calculated at Noahmp glacier points --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 7003add22..f2f6b6941 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -950,6 +950,10 @@ subroutine noahmpdrv_run & ch_vegetated = 0.0 ch_bare_ground = ch_noahmp canopy_heat_storage = 0.0 + lai_sunlit = 0.0 + lai_shaded = 0.0 + rs_sunlit = 0.0 + rs_shaded = 0.0 else ! not glacier From 81793d13e38c99bc10e6232a2ecd0ebff38a3514 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 10 May 2024 08:51:30 -0600 Subject: [PATCH 223/249] Reduce optimization for mynnedmf_wrapper.F90 Use -O1 instead of -O0 for gcycle.F90 with Intel --- CMakeLists.txt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9f7bcac8..715af8afe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -142,7 +142,9 @@ SET_PROPERTY(SOURCE ${SCHEMES} ${CAPS} # Lower optimization for certain schemes when compiling with Intel in Release mode if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel") # Define a list of schemes that need lower optimization with Intel in Release mode - set(SCHEME_NAMES_LOWER_OPTIMIZATION module_sf_mynn.F90) + set(SCHEME_NAMES_LOWER_OPTIMIZATION module_sf_mynn.F90 + mynnedmf_wrapper.F90 + gcycle.F90) foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_LOWER_OPTIMIZATION) set(SCHEMES_TMP ${SCHEMES}) # Need to determine the name of the scheme with its path @@ -156,8 +158,7 @@ endif() # No optimization for certain schemes when compiling with Intel in Release mode if(CMAKE_BUILD_TYPE STREQUAL "Release" AND ${CMAKE_Fortran_COMPILER_ID} STREQUAL "Intel") # Define a list of schemes that can't be optimized with Intel in Release mode - set(SCHEME_NAMES_NO_OPTIMIZATION GFS_typedefs.F90 - gcycle.F90) + set(SCHEME_NAMES_NO_OPTIMIZATION GFS_typedefs.F90) foreach(SCHEME_NAME IN LISTS SCHEME_NAMES_NO_OPTIMIZATION) set(SCHEMES_TMP ${SCHEMES}) # Need to determine the name of the scheme with its path From e2c101076a3be15a9bdf34e3677628f3118c6e56 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 10 May 2024 08:53:03 -0600 Subject: [PATCH 224/249] Bug fix for merra2 aerosol setup in physics/MP/Thompson/mp_thompson.F90 --- physics/MP/Thompson/mp_thompson.F90 | 44 ++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/physics/MP/Thompson/mp_thompson.F90 b/physics/MP/Thompson/mp_thompson.F90 index 71ac1ac20..3b99deec1 100644 --- a/physics/MP/Thompson/mp_thompson.F90 +++ b/physics/MP/Thompson/mp_thompson.F90 @@ -690,7 +690,7 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & qcten3 => diag3d(:,:,37:37) end if set_extended_diagnostic_pointers !> - Call mp_gt_driver() with or without aerosols, with or without effective radii, ... - if (is_aerosol_aware .or. merra2_aerosol_aware) then + if (is_aerosol_aware) then call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & nc=nc, nwfa=nwfa, nifa=nifa, nwfa2d=nwfa2d, nifa2d=nifa2d, & tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, & @@ -732,6 +732,48 @@ subroutine mp_thompson_run(ncol, nlev, con_g, con_rd, & qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, & qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, & qcten3=qcten3, pfils=pfils, pflls=pflls) + else if (merra2_aerosol_aware) then + call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & + nc=nc, nwfa=nwfa, nifa=nifa, & + tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, & + sedi_semi=sedi_semi, decfl=decfl, lsm=islmsk, & + rainnc=rain_mp, rainncv=delta_rain_mp, & + snownc=snow_mp, snowncv=delta_snow_mp, & + icenc=ice_mp, icencv=delta_ice_mp, & + graupelnc=graupel_mp, graupelncv=delta_graupel_mp, sr=sr, & + refl_10cm=refl_10cm, & + diagflag=diagflag, do_radar_ref=do_radar_ref_mp, & + max_hail_diam_sfc=max_hail_diam_sfc, & + has_reqc=has_reqc, has_reqi=has_reqi, has_reqs=has_reqs, & + aero_ind_fdb=aero_ind_fdb, rand_perturb_on=spp_mp_opt, & + kme_stoch=kme_stoch, & + rand_pert=spp_wts_mp, spp_var_list=spp_var_list, & + spp_prt_list=spp_prt_list, n_var_spp=n_var_spp, & + spp_stddev_cutoff=spp_stddev_cutoff, & + ids=ids, ide=ide, jds=jds, jde=jde, kds=kds, kde=kde, & + ims=ims, ime=ime, jms=jms, jme=jme, kms=kms, kme=kme, & + its=its, ite=ite, jts=jts, jte=jte, kts=kts, kte=kte, & + fullradar_diag=fullradar_diag, istep=istep, nsteps=nsteps, & + first_time_step=first_time_step, errmsg=errmsg, errflg=errflg, & + ! Extended diagnostics + ext_diag=ext_diag, & + ! vts1=vts1, txri=txri, txrc=txrc, & + prw_vcdc=prw_vcdc, & + prw_vcde=prw_vcde, tpri_inu=tpri_inu, tpri_ide_d=tpri_ide_d, & + tpri_ide_s=tpri_ide_s, tprs_ide=tprs_ide, & + tprs_sde_d=tprs_sde_d, & + tprs_sde_s=tprs_sde_s, tprg_gde_d=tprg_gde_d, & + tprg_gde_s=tprg_gde_s, tpri_iha=tpri_iha, & + tpri_wfz=tpri_wfz, tpri_rfz=tpri_rfz, tprg_rfz=tprg_rfz, & + tprs_scw=tprs_scw, tprg_scw=tprg_scw, tprg_rcs=tprg_rcs, & + tprs_rcs=tprs_rcs, & + tprr_rci=tprr_rci, tprg_rcg=tprg_rcg, tprw_vcd_c=tprw_vcd_c, & + tprw_vcd_e=tprw_vcd_e, tprr_sml=tprr_sml, tprr_gml=tprr_gml, & + tprr_rcg=tprr_rcg, tprr_rcs=tprr_rcs, & + tprv_rev=tprv_rev, tten3=tten3, & + qvten3=qvten3, qrten3=qrten3, qsten3=qsten3, qgten3=qgten3, & + qiten3=qiten3, niten3=niten3, nrten3=nrten3, ncten3=ncten3, & + qcten3=qcten3, pfils=pfils, pflls=pflls) else call mp_gt_driver(qv=qv, qc=qc, qr=qr, qi=qi, qs=qs, qg=qg, ni=ni, nr=nr, & tt=tgrs, p=prsl, w=w, dz=dz, dt_in=dtstep, dt_inner=dt_inner, & From b98faf38d4ba1d8e8a34f7037d7998875be04db1 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 13 May 2024 16:50:01 +0000 Subject: [PATCH 225/249] Update CODEOWNERS --- CODEOWNERS | 367 ++++++++++++++++++++++++++--------------------------- 1 file changed, 181 insertions(+), 186 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index d55a200fc..9a43092a2 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -11,192 +11,187 @@ # https://docs.google.com/spreadsheets/d/14y0Th_sSpCqlssEMNfSZ_Ni9wrpPqfpPY0kRG7jCZB8/edit#gid=0 # (Internal NOAA document.) -smoke_dust/* @haiqinli @grantfirl @Qingfu-Liu @dustinswales -physics/aer_cloud.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/aerclm_def.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/aerinterp.F90 @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/bl_mynn_common.f90 @joeolson42 @grantfirl @Qingfu-Liu @dustinswales -physics/calpreciptype.f90 @grantfirl @Qingfu-Liu @dustinswales -physics/cires_orowam2017.f @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/cires_tauamf_data.F90 @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/cires_ugwp* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/cldmacro.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/cldwat2m_micro.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/clm_lake.* @tanyasmirnova @SamuelTrahanNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/cnvc90.* @grantfirl @Qingfu-Liu @dustinswales -physics/cs_conv_aw_adj.* @AnningCheng-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/cs_conv.* @AnningCheng-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/cu_gf* @haiqinli @grantfirl @Qingfu-Liu @dustinswales -physics/cu_ntiedtke* @JongilHan66 @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/cu_c3* @lisa-bengtsson @haiqinli @grantfirl @Qingfu-Liu @dustinswales -physics/date_def.f @XuLi-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/dcyc2t3.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/drag_suite.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/flake* @barlage @grantfirl @Qingfu-Liu @dustinswales -physics/funcphys.f90 @grantfirl @Qingfu-Liu @dustinswales -physics/fv_sat_adj.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales -physics/gcycle.F90 @grantfirl @Qingfu-Liu @dustinswales -physics/get_phi_fv3.* @grantfirl @Qingfu-Liu @dustinswales -physics/get_prs_fv3.* @grantfirl @Qingfu-Liu @dustinswales -physics/gfdl_cloud_microphys.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales -physics/GFDL_parse_tracers.F90 @grantfirl @Qingfu-Liu @dustinswales -physics/gfdl_sfc_layer.* @ZhanZhang-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_cloud_diagnostics.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_DCNV_generic_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_DCNV_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_debug.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_GWD_generic_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_GWD_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_MP_generic_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_MP_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_PBL_generic_common.F90 @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_PBL_generic_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_PBL_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_phys_time_vary.fv3.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_phys_time_vary.scm.* @grantfirl @Qingfu-Liu @dustinswales -physics/gfs_phy_tracer_config.F @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_radiation_surface.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rad_time_vary.fv3.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rad_time_vary.scm.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmgp_cloud_mp.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmgp_cloud_overlap.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmg_post.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmgp_pre.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmg_pre.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmgp_setup.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmgp_post.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_rrtmg_setup.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_SCNV_generic_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_SCNV_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_stochastics.* @pjpegion @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_interstitial_1.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_interstitial_2.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_interstitial_3.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_interstitial_4.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_interstitial_5.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_interstitial_phys_reset.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_interstitial_rad_reset.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_stateout_reset.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_suite_stateout_update.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_surface_composites_inter.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_surface_composites_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_surface_composites_pre.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_surface_generic_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_surface_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_surface_loop_control_part1.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_surface_loop_control_part2.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_time_vary_pre.fv3.* @grantfirl @Qingfu-Liu @dustinswales -physics/GFS_time_vary_pre.scm.* @grantfirl @Qingfu-Liu @dustinswales -physics/gocart_tracer_config_stub.f @grantfirl @Qingfu-Liu @dustinswales -physics/gwdc.* @Songyou184 @grantfirl @Qingfu-Liu @dustinswales -physics/gwdps.* @Songyou184 @grantfirl @Qingfu-Liu @dustinswales -physics/h2o_def.* @grantfirl @Qingfu-Liu @dustinswales -physics/h2ointerp.f90 @grantfirl @Qingfu-Liu @dustinswales -physics/h2ophys.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/hedmf.* @JongilHan66 @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/iccn_def.F @grantfirl @Qingfu-Liu @dustinswales -physics/iccninterp.F90 @grantfirl @Qingfu-Liu @dustinswales -physics/iounitdef.f @grantfirl @Qingfu-Liu @dustinswales -physics/lsm_noah.* @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/lsm_ruc.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales -physics/machine.* @grantfirl @Qingfu-Liu @dustinswales -physics/maximum_hourly_diagnostics.* @grantfirl @Qingfu-Liu @dustinswales -physics/mersenne_twister.f @grantfirl @Qingfu-Liu @dustinswales -physics/mfpbl.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/mfpblt.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/mfpbltq.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/mfscu.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/mfscuq.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/micro_mg* @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/m_micro* @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/module_bfmicrophysics.f @grantfirl @Qingfu-Liu @dustinswales -physics/module_BL_MYJPBL.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/module_bl_mynn.* @joeolson42 @grantfirl @Qingfu-Liu @dustinswales -physics/module_gfdl_cloud_microphys.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales -physics/module_MP_FER_HIRES.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/module_mp_nssl_2mom.F90 @MicroTed @grantfirl @Qingfu-Liu @dustinswales -physics/module_mp_radar.* @gthompsnWRF @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales -physics/module_mp_thompson* @gthompsnWRF @RuiyuSun @AndersJensen-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/module_nst* @XuLi-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/module_sf_exchcoef.f90 @ZhanZhang-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/module_SF_JSFC.F90 @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/module_sf_mynn.F90 @joeolson42 @grantfirl @Qingfu-Liu @dustinswales -physics/module_sf_ruclsm.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales -physics/module_soil_pre.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales -physics/moninshoc.* @grantfirl @Qingfu-Liu @dustinswales -physics/mp_fer_hires.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/mp_nssl.* @MicroTed @grantfirl @Qingfu-Liu @dustinswales -physics/mp_thompson* @gthompsnWRF @RuiyuSun @AndersJensen-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/multi_gases.F90 @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales -physics/myjpbl_wrapper.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/myjsfc_wrapper.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/mynnedmf_wrapper.* @joeolson42 @grantfirl @Qingfu-Liu @dustinswales -physics/mynnsfc_wrapper.* @joeolson42 @grantfirl @Qingfu-Liu @dustinswales -physics/namelist_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @grantfirl @Qingfu-Liu @dustinswales -physics/namelist_soilveg_ruc.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales -physics/*noahmp* @barlage @cenlinhe @grantfirl @Qingfu-Liu @dustinswales -physics/ozinterp.f90 @grantfirl @Qingfu-Liu @dustinswales -physics/ozne_def.* @grantfirl @Qingfu-Liu @dustinswales -physics/ozphys* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/physcons.F90 @grantfirl @Qingfu-Liu @dustinswales -physics/phys_tend.* @grantfirl @Qingfu-Liu @dustinswales -physics/progsigma_calc.f90 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales -physics/radcons.f90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radiation_aerosols.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radiation_astronomy.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radiation_cloud_overlap.F90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radiation_clouds.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radiation_gases.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radiation_surface.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radiation_tools.F90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/radlw_* @mjiacono @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/radsw_* @mjiacono @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/rascnv.* @haiqinli @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/rayleigh_damp.* @yangfanglin @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmg_lw_cloud_optics.F90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmg_lw_post.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmg_lw_pre.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmgp_aerosol_optics.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmgp_lw_* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmgp_sw_* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmg_sw_cloud_optics.F90 @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/rrtmg_sw_post.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales -physics/rte-rrtmgp @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales -physics/samfdeepcnv.* @JongilHan66 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales -physics/samfshalcnv.* @JongilHan66 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales -physics/samfaerosols.* @JongilHan66 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales -physics/sascnvn.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/satmedmfvdif.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/satmedmfvdifq.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/scm_sfc_flux_spec.* @grantfirl @grantfirl @Qingfu-Liu @dustinswales -physics/set_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @grantfirl @Qingfu-Liu @dustinswales -physics/set_soilveg_ruc.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales -physics/sfc_cice.* @wd20xw @grantfirl @Qingfu-Liu @dustinswales -physics/sfc_diag.* @grantfirl @Qingfu-Liu @dustinswales -physics/sfc_diag_post.* @grantfirl @Qingfu-Liu @dustinswales -physics/sfc_diff.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/sfc_nst* @XuLi-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/sfc_ocean.* @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/sfc_sice.* @wd20xw @grantfirl @Qingfu-Liu @dustinswales -physics/sfcsub.F @grantfirl @Qingfu-Liu @dustinswales -physics/sflx.f @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/sgscloud_radpost.* @grantfirl @Qingfu-Liu @dustinswales -physics/sgscloud_radpre.* @grantfirl @Qingfu-Liu @dustinswales -physics/shalcnv.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales -physics/shinhongvdif.* @Qingfu-Liu @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/shoc.* @grantfirl @Qingfu-Liu @dustinswales -physics/surface_perturbation.* @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/tridi.f @JongilHan66 @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/ugwp_driver_v0.F @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/ugwpv1_gsldrag.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/ugwpv1_gsldrag_post.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/unified_ugwp* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/wv_saturation.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales -physics/ysuvdif.* @Qingfu-Liu @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales -physics/zhaocarr_gscond.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales -physics/zhaocarr_precpd.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales - -physics/sfc_land.* @uturuncoglu @barlage +physics/CONV/C3/cu_c3* @lisa-bengtsson @haiqinli @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/Chikira_Sugiyama/cs_conv_aw_adj.* @AnningCheng-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/Chikira_Sugiyama/cs_conv.* @AnningCheng-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/Grell_Freitas/cu_gf* @haiqinli @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/RAS/rascnv.* @haiqinli @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/SAMF/samfdeepcnv.* @JongilHan66 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/SAMF/samfshalcnv.* @JongilHan66 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/SAMF/samfaerosols.* @JongilHan66 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/SAS/sascnvn.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/SAS/shalcnv.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/nTiedtke/cu_ntiedtke* @JongilHan66 @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/CONV/progsigma_calc.f90 @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/cires_orowam2017.f @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/cires_tauamf_data.F90 @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/cires_ugwp* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/drag_suite.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/gwdc.* @Songyou184 @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/gwdps.* @Songyou184 @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/rayleigh_damp.* @yangfanglin @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/ugwp_driver_v0.F @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/ugwpv1_gsldrag.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/ugwpv1_gsldrag_post.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/unified_ugwp* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Ferrier_Aligo/module_MP_FER_HIRES.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Ferrier_Aligo/mp_fer_hires.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/MP/GFDL/GFDL_parse_tracers.F90 @grantfirl @Qingfu-Liu @dustinswales +physics/MP/GFDL/gfdl_cloud_microphys.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales +physics/MP/GFDL/module_gfdl_cloud_microphys.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales +physics/MP/GFDL/fv_sat_adj.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales +physics/MP/GFDL/multi_gases.F90 @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/aer_cloud.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/aerclm_def.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/aerinterp.F90 @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/cldmacro.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/cldwat2m_micro.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/micro_mg* @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/m_micro* @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Morrison_Gettelman/wv_saturation.F @AnningCheng-NOAA @andrewgettelman @grantfirl @Qingfu-Liu @dustinswales +physics/MP/NSSL/module_mp_nssl_2mom.F90 @MicroTed @grantfirl @Qingfu-Liu @dustinswales +physics/MP/NSSL/mp_nssl.* @MicroTed @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Thompson/module_mp_thompson* @gthompsnWRF @RuiyuSun @AndersJensen-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Thompson/mp_thompson* @gthompsnWRF @RuiyuSun @AndersJensen-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Zhao_Carr/zhaocarr_gscond.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales +physics/MP/Zhao_Carr/zhaocarr_precpd.* @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales +physics/MP/calpreciptype.f90 @grantfirl @Qingfu-Liu @dustinswales +physics/MP/module_mp_radar.* @gthompsnWRF @RuiyuSun @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/HEDMF/hedmf.* @JongilHan66 @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/MYJ/module_BL_MYJPBL.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/MYJ/myjpbl_wrapper.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/MYNN_EDMF/bl_mynn_common.f90 @joeolson42 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/MYNN_EDMF/module_bl_mynn.* @joeolson42 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/MYNN_EDMF/mynnedmf_wrapper.* @joeolson42 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/SATMEDMF/satmedmfvdif.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/SATMEDMF/satmedmfvdifq.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/SATMEDMF/mfscu.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/SATMEDMF/mfscuq.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/SHOC/moninshoc.* @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/SHOC/shoc.* @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/YSU/ysuvdif.* @Qingfu-Liu @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/saYSU/shinhongvdif.* @Qingfu-Liu @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/mfpbl.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/mfpblt.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/mfpbltq.f @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/PBL/tridi.f @JongilHan66 @WeiguoWang-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/iounitdef.f @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/module_bfmicrophysics.f @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/rad_sw_pre* @mjiacono @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/radcons.f90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/radlw_* @mjiacono @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/radsw_* @mjiacono @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/rrtmg_lw_cloud_optics.F90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/rrtmg_lw_post.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/rrtmg_sw_cloud_optics.F90 @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMG/rrtmg_sw_post.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMGP/rte-rrtmgp @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMGP/rrtmgp_aerosol_optics.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMGP/rrtmgp_lw_* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/RRTMGP/rrtmgp_sw_* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/mersenne_twister.f @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/radiation_aerosols.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/radiation_astronomy.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/radiation_cloud_overlap.F90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/radiation_clouds.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/radiation_gases.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/radiation_surface.f @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Radiation/radiation_tools.F90 @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/GFDL/gfdl_sfc_layer.* @ZhanZhang-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/GFDL/module_sf_exchcoef.f90 @ZhanZhang-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/MYJ/myjsfc_wrapper.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/MYJ/module_SF_JSFC.F90 @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/MYNN/mynnsfc_wrapper.* @joeolson42 @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/MYNN/module_sf_mynn.F90 @joeolson42 @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/UFS/date_def.f @XuLi-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/UFS/module_nst* @XuLi-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/UFS/sfc_diag.* @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/UFS/sfc_diag_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/UFS/sfc_diff.* @JongilHan66 @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Layer/UFS/sfc_nst* @XuLi-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Lake/CLM/clm_lake.* @tanyasmirnova @SamuelTrahanNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Lake/Flake/flake* @barlage @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/Noah/lsm_noah.* @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/Noah/namelist_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/Noah/set_soilveg.* @HelinWei-NOAA @barlage @cenlinhe @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/Noah/sflx.f @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/Noah/surface_perturbation.* @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/Noahmp/*noahmp* @barlage @cenlinhe @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/RUC/lsm_ruc.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/RUC/module_sf_ruclsm.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/RUC/module_soil_pre.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/RUC/namelist_soilveg_ruc.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/RUC/set_soilveg_ruc.* @tanyasmirnova @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Land/sfc_land.* @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/Ocean/UFS/sfc_ocean.* @HelinWei-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/SeaIce/CICE/sfc_cice.* @wd20xw @grantfirl @Qingfu-Liu @dustinswales +physics/SFC_Models/SeaIce/CICE/sfc_sice.* @wd20xw @grantfirl @Qingfu-Liu @dustinswales +physics/hooks/machine.* @grantfirl @Qingfu-Liu @dustinswales +physics/hooks/physcons.F90 @grantfirl @Qingfu-Liu @dustinswales +physics/photochem/h2o_def.* @grantfirl @Qingfu-Liu @dustinswales +physics/photochem/h2ointerp.f90 @grantfirl @Qingfu-Liu @dustinswales +physics/photochem/h2ophys.* @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/photochem/module_ozphys.* @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/smoke_dust/* @haiqinli @grantfirl @Qingfu-Liu @dustinswales +physics/tools/funcphys.f90 @grantfirl @Qingfu-Liu @dustinswales +physics/tools/get_phi_fv3.* @grantfirl @Qingfu-Liu @dustinswales +physics/tools/get_prs_fv3.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_cloud_diagnostics.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_DCNV_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_debug.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_GWD_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_MP_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_common.F90 @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_PBL_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_phys_time_vary.scm.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_physics_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_radiation_surface.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.fv3.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rad_time_vary.scm.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_mp.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_cloud_overlap.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_post.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_pre.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_pre.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_setup.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmgp_post.* @dustinswales @Qingfu-Liu @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_rrtmg_setup.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_SCNV_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_stochastics.* @pjpegion @lisa-bengtsson @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_1.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_2.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_3.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_4.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_5.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_phys_reset.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_interstitial_rad_reset.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_reset.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_suite_stateout_update.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_inter.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_composites_pre.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_post.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_generic_pre.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part1.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_surface_loop_control_part2.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.fv3.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/GFS_time_vary_pre.scm.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/cnvc90.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/dcyc2t3.* @Qingfu-Liu @dustinswales @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/gcycle.F90 @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/iccn_def.F @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/iccninterp.F90 @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/maximum_hourly_diagnostics.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/scm_sfc_flux_spec.* @grantfirl @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/sfcsub.F @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpost.* @grantfirl @Qingfu-Liu @dustinswales +physics/Interstitials/UFS_SCM_NEPTUNE/sgscloud_radpre.* @grantfirl @Qingfu-Liu @dustinswales ######################################################################## From 30cfb46c79b34850e7e32c59a1ab58d9c6147cb1 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Mon, 13 May 2024 15:47:11 -0400 Subject: [PATCH 226/249] add BoYang-NOAA to CODEOWNERS for ugwpv1_gsldrag* --- CODEOWNERS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CODEOWNERS b/CODEOWNERS index 9a43092a2..99d6697f2 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -31,8 +31,8 @@ physics/GWD/gwdc.* @So physics/GWD/gwdps.* @Songyou184 @grantfirl @Qingfu-Liu @dustinswales physics/GWD/rayleigh_damp.* @yangfanglin @grantfirl @Qingfu-Liu @dustinswales physics/GWD/ugwp_driver_v0.F @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/GWD/ugwpv1_gsldrag.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales -physics/GWD/ugwpv1_gsldrag_post.* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/ugwpv1_gsldrag.* @mdtoyNOAA @BoYang-NOAA @grantfirl @Qingfu-Liu @dustinswales +physics/GWD/ugwpv1_gsldrag_post.* @mdtoyNOAA @BoYang-NOAA @grantfirl @Qingfu-Liu @dustinswales physics/GWD/unified_ugwp* @mdtoyNOAA @grantfirl @Qingfu-Liu @dustinswales physics/MP/Ferrier_Aligo/module_MP_FER_HIRES.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales physics/MP/Ferrier_Aligo/mp_fer_hires.* @ericaligo-NOAA @grantfirl @Qingfu-Liu @dustinswales From bff4e2919682fc11c7bcc5764d2cafe601249f61 Mon Sep 17 00:00:00 2001 From: drnimbusrain Date: Wed, 15 May 2024 02:18:10 +0000 Subject: [PATCH 227/249] Updated rca calculation with rsmin and rsmax limits. --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index f2f6b6941..db3ae472f 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -1063,14 +1063,14 @@ subroutine noahmpdrv_run & zorl (i) = z0_total * 100.0 ! convert to cm ztmax (i) = z0h_total - ! total stomatal/canopy resistance Based on Bonan et al. (2011) conductance (1/Rs) equation + !LAI-scale canopy resistance based on weighted sunlit shaded fraction if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. & lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then - rca(i) = 0.0 - else + rca(i) = parameters%rsmax + else !calculate LAI-scale canopy conductance (1/Rs) rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit) + & ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded)) - rca(i) = 1.0/rca(i) !resistance + rca(i) = max((1.0/rca(i)),parameters%rsmin) !resistance end if smc (i,:) = soil_moisture_vol From be05ec28d5d4968d3e0cb6e6a7fdb47fb8a5fad0 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Wed, 15 May 2024 19:42:37 -0400 Subject: [PATCH 228/249] fix openACC directive bug in cu_gf_deep.F90 --- physics/CONV/Grell_Freitas/cu_gf_deep.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 index 8a2c73600..9db1697dc 100644 --- a/physics/CONV/Grell_Freitas/cu_gf_deep.F90 +++ b/physics/CONV/Grell_Freitas/cu_gf_deep.F90 @@ -316,7 +316,7 @@ subroutine cu_gf_deep_run( & real(kind=kind_phys), dimension (its:ite,kts:kte) :: pwdper, massflx integer :: nv !$acc declare create(chem,chem_cup,chem_up,chem_down,dellac,dellac2,chem_c,chem_pw,chem_pwd, & -!$acc chem_pwav,chem_psum,pwdper,massflux) +!$acc chem_pwav,chem_psum,pwdper,massflx) real(kind=kind_phys), dimension (its:ite,kts:kte) :: & entr_rate_2d,mentrd_rate_2d,he,hes,qes,z, heo,heso,qeso,zo, & From 833f7dc7520a4e57d52b94a1ed5f4df3ee7b1684 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Sat, 18 May 2024 09:56:56 -0400 Subject: [PATCH 229/249] HR4 GWD update for files drag_suite.F90 ugwpv1_gsldrag.F90 unified_ugwp.F90 module_sf_noahmplsm.F90 noahmpdrv.F90 --- physics/GWD/drag_suite.F90 | 1217 +++++++++++++++++ physics/GWD/drag_suite.meta | 15 + physics/GWD/ugwpv1_gsldrag.F90 | 37 +- physics/GWD/ugwpv1_gsldrag.meta | 22 + physics/GWD/unified_ugwp.F90 | 36 +- physics/GWD/unified_ugwp.meta | 46 + .../Land/Noahmp/module_sf_noahmplsm.F90 | 59 +- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 14 +- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 23 + 9 files changed, 1446 insertions(+), 23 deletions(-) diff --git a/physics/GWD/drag_suite.F90 b/physics/GWD/drag_suite.F90 index ff68f4216..2dfd0a598 100644 --- a/physics/GWD/drag_suite.F90 +++ b/physics/GWD/drag_suite.F90 @@ -1413,6 +1413,1223 @@ subroutine drag_suite_run( & return end subroutine drag_suite_run !------------------------------------------------------------------- + + subroutine drag_suite_psl( & + & IM,KM,dvdt,dudt,dtdt,U1,V1,T1,Q1,KPBL, & + & PRSI,DEL,PRSL,PRSLK,PHII,PHIL,DELTIM,KDT, & + & var,oc1,oa4,ol4, & + & varss,oc1ss,oa4ss,ol4ss, & + & THETA,SIGMA,GAMMA,ELVMAX, & + & dtaux2d_ls,dtauy2d_ls,dtaux2d_bl,dtauy2d_bl, & + & dtaux2d_ss,dtauy2d_ss,dtaux2d_fd,dtauy2d_fd, & + & dusfc,dvsfc, & + & dusfc_ls,dvsfc_ls,dusfc_bl,dvsfc_bl, & + & dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, & + & slmsk,br1,hpbl,vtype, & + & g, cp, rd, rv, fv, pi, imx, cdmbgwd, me, master, & + & lprnt, ipr, rdxzb, dx, gwd_opt, & + & do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & + & psl_gwd_dx_factor, & + & dtend, dtidx, index_of_process_orographic_gwd, & + & index_of_temperature, index_of_x_wind, & + & index_of_y_wind, ldiag3d, ldiag_ugwp, ugwp_seq_update, & + & spp_wts_gwd, spp_gwd, errmsg, errflg) + +! ******************************************************************** +! -----> I M P L E M E N T A T I O N V E R S I O N <---------- +! +! ----- This code ----- +!begin WRF code + +! this code handles the time tendencies of u v due to the effect of mountain +! induced gravity wave drag from sub-grid scale orography. this routine +! not only treats the traditional upper-level wave breaking due to mountain +! variance (alpert 1988), but also the enhanced lower-tropospheric wave +! breaking due to mountain convexity and asymmetry (kim and arakawa 1995). +! thus, in addition to the terrain height data in a model grid box, +! additional 10-2d topographic statistics files are needed, including +! orographic standard deviation (var), convexity (oc1), asymmetry (oa4) +! and ol (ol4). these data sets are prepared based on the 30 sec usgs orography +! hong (1999). the current scheme was implmented as in hong et al.(2008) +! +! Originally coded by song-you hong and young-joon kim and implemented by song-you hong +! +! program history log: +! 2014-10-01 Hyun-Joo Choi (from KIAPS) flow-blocking drag of kim and doyle +! with blocked height by dividing streamline theory +! 2017-04-06 Joseph Olson (from Gert-Jan Steeneveld) added small-scale +! orographic grabity wave drag: +! 2017-09-15 Joseph Olson, with some bug fixes from Michael Toy: added the +! topographic form drag of Beljaars et al. (2004, QJRMS) +! Activation of each component is done by specifying the integer-parameters +! (defined below) to 0: inactive or 1: active +! gwd_opt_ls = 0 or 1: large-scale +! gwd_opt_bl = 0 or 1: blocking drag +! gwd_opt_ss = 0 or 1: small-scale gravity wave drag +! gwd_opt_fd = 0 or 1: topographic form drag +! 2017-09-25 Michael Toy (from NCEP GFS model) added dissipation heating +! gsd_diss_ht_opt = 0: dissipation heating off +! gsd_diss_ht_opt = 1: dissipation heating on +! 2020-08-25 Michael Toy changed logic control for drag component selection +! for CCPP. +! Namelist options: +! do_gsl_drag_ls_bl - logical flag for large-scale GWD + blocking +! do_gsl_drag_ss - logical flag for small-scale GWD +! do_gsl_drag_tofd - logical flag for turbulent form drag +! Compile-time options (same as before): +! gwd_opt_ls = 0 or 1: large-scale GWD +! gwd_opt_bl = 0 or 1: blocking drag +! +! References: +! Choi and Hong (2015) J. Geophys. Res. +! Hong et al. (2008), wea. and forecasting +! Kim and Doyle (2005), Q. J. R. Meteor. Soc. +! Kim and Arakawa (1995), j. atmos. sci. +! Alpert et al. (1988), NWP conference. +! Hong (1999), NCEP office note 424. +! Steeneveld et al (2008), JAMC +! Tsiringakis et al. (2017), Q. J. R. Meteor. Soc. +! Beljaars et al. (2004), Q. J. R. Meteor. Soc. +! +! notice : comparible or lower resolution orography files than model resolution +! are desirable in preprocess (wps) to prevent weakening of the drag +!------------------------------------------------------------------------------- +! +! input +! dudt (im,km) non-lin tendency for u wind component +! dvdt (im,km) non-lin tendency for v wind component +! u1(im,km) zonal wind / sqrt(rcl) m/sec at t0-dt +! v1(im,km) meridional wind / sqrt(rcl) m/sec at t0-dt +! t1(im,km) temperature deg k at t0-dt +! q1(im,km) specific humidity at t0-dt +! deltim time step secs +! del(km) positive increment of pressure across layer (pa) +! KPBL(IM) is the index of the top layer of the PBL +! ipr & lprnt for diagnostics +! +! output +! dudt, dvdt wind tendency due to gwdo +! dTdt +! +!------------------------------------------------------------------------------- + +!end wrf code +!----------------------------------------------------------------------C +! USE +! ROUTINE IS CALLED FROM CCPP (AFTER CALLING PBL SCHEMES) +! +! PURPOSE +! USING THE GWD PARAMETERIZATIONS OF PS-GLAS AND PH- +! GFDL TECHNIQUE. THE TIME TENDENCIES OF U V +! ARE ALTERED TO INCLUDE THE EFFECT OF MOUNTAIN INDUCED +! GRAVITY WAVE DRAG FROM SUB-GRID SCALE OROGRAPHY INCLUDING +! CONVECTIVE BREAKING, SHEAR BREAKING AND THE PRESENCE OF +! CRITICAL LEVELS +! +! +! ******************************************************************** + USE MACHINE , ONLY : kind_phys + implicit none + + ! Interface variables + integer, intent(in) :: im, km, imx, kdt, ipr, me, master + integer, intent(in) :: gwd_opt + 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(:,:,:) + logical, intent(in) :: ldiag3d + integer, intent(in) :: dtidx(:,:), index_of_temperature, & + & index_of_process_orographic_gwd, index_of_x_wind, index_of_y_wind + + integer :: kpblmax + integer, parameter :: ims=1, kms=1, its=1, kts=1 + real(kind=kind_phys), intent(in) :: fv, pi + real(kind=kind_phys) :: rcl, cdmb + real(kind=kind_phys) :: g_inv + + real(kind=kind_phys), intent(inout) :: & + & dudt(:,:),dvdt(:,:), & + & dtdt(:,:) + real(kind=kind_phys), intent(out) :: rdxzb(:) + real(kind=kind_phys), intent(in) :: & + & u1(:,:),v1(:,:), & + & t1(:,:),q1(:,:), & + & PHII(:,:),prsl(:,:), & + & prslk(:,:),PHIL(:,:) + real(kind=kind_phys), intent(in) :: prsi(:,:), & + & del(:,:) + real(kind=kind_phys), intent(in) :: var(:),oc1(:), & + & oa4(:,:),ol4(:,:), & + & dx(:) + real(kind=kind_phys), intent(in) :: varss(:),oc1ss(:), & + & oa4ss(:,:),ol4ss(:,:) + real(kind=kind_phys), intent(in) :: THETA(:),SIGMA(:), & + & GAMMA(:),ELVMAX(:) + +! added for small-scale orographic wave drag + real(kind=kind_phys), dimension(im,km) :: utendwave,vtendwave,thx,thvx + integer, intent(in) :: vtype(:) + real(kind=kind_phys), intent(in) :: br1(:), & + & hpbl(:), & + & slmsk(:) + real(kind=kind_phys), dimension(im) :: govrth,xland + !real(kind=kind_phys), dimension(im,km) :: dz2 + real(kind=kind_phys) :: tauwavex0,tauwavey0, & + & XNBV,density,tvcon,hpbl2 + integer :: kpbl2,kvar + !real(kind=kind_phys), dimension(im,km+1) :: zq ! = PHII/g + real(kind=kind_phys), dimension(im,km) :: zl ! = PHIL/g + +!SPP + real(kind=kind_phys), dimension(im) :: var_stoch, varss_stoch, & + varmax_ss_stoch, varmax_fd_stoch + real(kind=kind_phys), intent(in) :: spp_wts_gwd(:,:) + integer, intent(in) :: spp_gwd + + real(kind=kind_phys), dimension(im) :: rstoch + +!Output: + real(kind=kind_phys), intent(out) :: & + & dusfc(:), dvsfc(:) +!Output (optional): + real(kind=kind_phys), intent(out) :: & + & dusfc_ls(:),dvsfc_ls(:), & + & dusfc_bl(:),dvsfc_bl(:), & + & dusfc_ss(:),dvsfc_ss(:), & + & dusfc_fd(:),dvsfc_fd(:) + real(kind=kind_phys), intent(out) :: & + & dtaux2d_ls(:,:),dtauy2d_ls(:,:), & + & dtaux2d_bl(:,:),dtauy2d_bl(:,:), & + & dtaux2d_ss(:,:),dtauy2d_ss(:,:), & + & dtaux2d_fd(:,:),dtauy2d_fd(:,:) + +!Misc arrays + real(kind=kind_phys), dimension(im,km) :: dtaux2d, dtauy2d + +!------------------------------------------------------------------------- +! Flags to regulate the activation of specific components of drag suite: +! Each component is tapered off automatically as a function of dx, so best to +! keep them activated (.true.). + logical, intent(in) :: & + do_gsl_drag_ls_bl, & ! large-scale gravity wave drag and blocking + do_gsl_drag_ss, & ! small-scale gravity wave drag (Steeneveld et al. 2008) + do_gsl_drag_tofd ! form drag (Beljaars et al. 2004, QJRMS) +! Flag for diagnostic outputs + logical, intent(in) :: ldiag_ugwp + +! Flag for sequential update of u and v between +! LSGWD + BLOCKING and SSGWD + TOFD calculations + logical, intent(in) :: ugwp_seq_update +! +! Additional flags + integer, parameter :: & + gwd_opt_ls = 1, & ! large-scale gravity wave drag + gwd_opt_bl = 1, & ! blocking drag + gsd_diss_ht_opt = 0 + +! Parameters for bounding the scale-adaptive variability: +! Small-scale GWD + turbulent form drag + real(kind=kind_phys), parameter :: dxmin_ss = 1000., & + & dxmax_ss = 12000. ! min,max range of tapering (m) +! Large-scale GWD + blocking + real(kind=kind_phys), parameter :: dxmin_ls = 3000., & + & dxmax_ls = 13000. ! min,max range of tapering (m) + real(kind=kind_phys), dimension(im) :: ss_taper, ls_taper ! small- and large-scale tapering factors (-) +! +! Variables for limiting topographic standard deviation (var) + real(kind=kind_phys), parameter :: varmax_ss = 50., & + varmax_fd = 150., & + beta_ss = 0.1, & + beta_fd = 0.2 + real(kind=kind_phys) :: var_temp, var_temp2 + +! added Beljaars orographic form drag + real(kind=kind_phys), dimension(im,km) :: utendform,vtendform + real(kind=kind_phys) :: a1,a2,wsp + real(kind=kind_phys) :: H_efold + +! multification factor of standard deviation : ! larger drag with larger value +!!! real(kind=kind_phys), parameter :: psl_gwd_dx_factor = 6.0 + real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor + +! critical richardson number for wave breaking : ! larger drag with larger value + real(kind=kind_phys), parameter :: ric = 0.25 + real(kind=kind_phys), parameter :: dw2min = 1. + real(kind=kind_phys), parameter :: rimin = -100. + real(kind=kind_phys), parameter :: bnv2min = 1.0e-5 + real(kind=kind_phys), parameter :: efmin = 0.0 + real(kind=kind_phys), parameter :: efmax = 10.0 + real(kind=kind_phys), parameter :: xl = 4.0e4 + real(kind=kind_phys), parameter :: critac = 1.0e-5 + real(kind=kind_phys), parameter :: gmax = 1. + real(kind=kind_phys), parameter :: veleps = 1.0 + real(kind=kind_phys), parameter :: factop = 0.5 + real(kind=kind_phys), parameter :: frc = 1.0 + real(kind=kind_phys), parameter :: ce = 0.8 + real(kind=kind_phys), parameter :: cg = 1.0 +! real(kind=kind_phys), parameter :: var_min = 100.0 + real(kind=kind_phys), parameter :: var_min = 10.0 + real(kind=kind_phys), parameter :: hmt_min = 50. + real(kind=kind_phys), parameter :: oc_min = 1.0 + real(kind=kind_phys), parameter :: oc_max = 10.0 +! 7.5 mb -- 33 km ... 0.01 kgm-3 reduce gwd drag above cutoff level + real(kind=kind_phys), parameter :: pcutoff = 7.5e2 +! 0.76 mb -- 50 km ...0.001 kgm-3 --- 0.1 mb 65 km 0.0001 kgm-3 + real(kind=kind_phys), parameter :: pcutoff_den = 0.01 ! + + integer,parameter :: kpblmin = 2 + +! +! local variables +! + integer :: i,j,k,lcap,lcapp1,nwd,idir, & + klcap,kp1 +! + real(kind=kind_phys) :: rcs,csg,fdir,cs, & + rcsks,wdir,ti,rdz,tem2,dw2,shr2, & + bvf2,rdelks,wtkbj,tem,gfobnv,hd,fro, & + rim,temc,tem1,efact,temv,dtaux,dtauy, & + dtauxb,dtauyb,eng0,eng1 + real(kind=kind_phys) :: denfac +! + logical :: ldrag(im),icrilv(im), & + flag(im) +! + real(kind=kind_phys) :: invgrcs +! + real(kind=kind_phys) :: taub(im),taup(im,km+1), & + xn(im),yn(im), & + ubar(im),vbar(im), & + fr(im),ulow(im), & + rulow(im),bnv(im), & + oa(im),ol(im),oc(im), & + oass(im),olss(im), & + roll(im),dtfac(im,km), & + brvf(im),xlinv(im), & + delks(im),delks1(im), & + bnv2(im,km),usqj(im,km), & + taud_ls(im,km),taud_bl(im,km), & + ro(im,km), & + vtk(im,km),vtj(im,km), & + zlowtop(im),velco(im,km-1), & + coefm(im),coefm_ss(im) + real(kind=kind_phys) :: cleff(im),cleff_ss(im) +! + integer :: kbl(im),klowtop(im) + integer,parameter :: mdir=8 + !integer :: nwdir(mdir) + !data nwdir/6,7,5,8,2,3,1,4/ + integer, parameter :: nwdir(8) = (/6,7,5,8,2,3,1,4/) +! +! variables for flow-blocking drag +! + real(kind=kind_phys),parameter :: frmax = 10. + real(kind=kind_phys),parameter :: olmin = 1.e-5 + real(kind=kind_phys),parameter :: odmin = 0.1 + real(kind=kind_phys),parameter :: odmax = 10. + real(kind=kind_phys),parameter :: cdmin = 0.0 + real(kind=kind_phys),parameter :: erad = 6371.315e+3 + integer :: komax(im),kbmax(im),kblk(im) + real(kind=kind_phys) :: hmax(im) + real(kind=kind_phys) :: cd + real(kind=kind_phys) :: zblk,tautem + real(kind=kind_phys) :: pe,ke + real(kind=kind_phys) :: delx,dely + real(kind=kind_phys) :: dxy4(im,4),dxy4p(im,4) + real(kind=kind_phys) :: dxy(im),dxyp(im) + real(kind=kind_phys) :: ol4p(4),olp(im),od(im) + real(kind=kind_phys) :: taufb(im,km+1) + + character(len=*), intent(out) :: errmsg + integer, intent(out) :: errflg + + integer :: udtend, vdtend, Tdtend + + ! Calculate inverse of gravitational acceleration + g_inv = 1./G + + ! Initialize CCPP error handling variables + errmsg = '' + errflg = 0 + + ! Initialize local variables + var_temp2 = 0. + udtend = -1 + vdtend = -1 + Tdtend = -1 + + if(ldiag3d) then + udtend = dtidx(index_of_x_wind,index_of_process_orographic_gwd) + vdtend = dtidx(index_of_y_wind,index_of_process_orographic_gwd) + Tdtend = dtidx(index_of_temperature,index_of_process_orographic_gwd) + endif +! +!---- constants +! + rcl = 1. + rcs = sqrt(rcl) + cs = 1. / sqrt(rcl) + csg = cs * g + lcap = km + lcapp1 = lcap + 1 + fdir = mdir / (2.0*pi) + invgrcs = 1._kind_phys/g*rcs + kpblmax = km / 2 ! maximum pbl height : # of vertical levels / 2 + denfac = 1.0 + + do i=1,im + if (slmsk(i)==1. .or. slmsk(i)==2.) then !sea/land/ice mask (=0/1/2) in FV3 + xland(i)=1.0 !but land/water = (1/2) in this module + else + xland(i)=2.0 + endif + RDXZB(i) = 0.0 + enddo + +!--- calculate scale-aware tapering factors +do i=1,im + if ( dx(i) .ge. dxmax_ls ) then + ls_taper(i) = 1. + else + if ( dx(i) .le. dxmin_ls) then + ls_taper(i) = 0. + else + ls_taper(i) = 0.5 * ( SIN(pi*(dx(i)-0.5*(dxmax_ls+dxmin_ls))/ & + (dxmax_ls-dxmin_ls)) + 1. ) + endif + endif +enddo + +! Remove ss_tapering +ss_taper(:) = 1. + +! SPP, if spp_gwd is 0, no perturbations are applied. +if ( spp_gwd==1 ) then + do i = its,im + var_stoch(i) = var(i) + var(i)*0.75*spp_wts_gwd(i,1) + varss_stoch(i) = varss(i) + varss(i)*0.75*spp_wts_gwd(i,1) + varmax_ss_stoch(i) = varmax_ss + varmax_ss*0.75*spp_wts_gwd(i,1) + varmax_fd_stoch(i) = varmax_fd + varmax_fd*0.75*spp_wts_gwd(i,1) + enddo +else + do i = its,im + var_stoch(i) = var(i) + varss_stoch(i) = varss(i) + varmax_ss_stoch(i) = varmax_ss + varmax_fd_stoch(i) = varmax_fd + enddo +endif + +!--- calculate length of grid for flow-blocking drag +! +do i=1,im + delx = dx(i) + dely = dx(i) + dxy4(i,1) = delx + dxy4(i,2) = dely + dxy4(i,3) = sqrt(delx*delx + dely*dely) + dxy4(i,4) = dxy4(i,3) + dxy4p(i,1) = dxy4(i,2) + dxy4p(i,2) = dxy4(i,1) + dxy4p(i,3) = dxy4(i,4) + dxy4p(i,4) = dxy4(i,3) + cleff(i) = psl_gwd_dx_factor*(delx+dely)*0.5 + cleff_ss(i) = 0.1 * max(dxmax_ss,dxy4(i,3)) +! cleff_ss(i) = cleff(i) ! consider ..... +enddo +! +!-----initialize arrays +! + dtaux = 0.0 + dtauy = 0.0 + do i = its,im + klowtop(i) = 0 + kbl(i) = 0 + enddo +! + do i = its,im + xn(i) = 0.0 + yn(i) = 0.0 + ubar (i) = 0.0 + vbar (i) = 0.0 + roll (i) = 0.0 + taub (i) = 0.0 + oa(i) = 0.0 + ol(i) = 0.0 + oc(i) = 0.0 + oass(i) = 0.0 + olss(i) = 0.0 + ulow (i) = 0.0 + rstoch(i) = 0.0 + ldrag(i) = .false. + icrilv(i) = .false. + enddo + + do k = kts,km + do i = its,im + usqj(i,k) = 0.0 + bnv2(i,k) = 0.0 + vtj(i,k) = 0.0 + vtk(i,k) = 0.0 + taup(i,k) = 0.0 + taud_ls(i,k) = 0.0 + taud_bl(i,k) = 0.0 + dtaux2d(i,k) = 0.0 + dtauy2d(i,k) = 0.0 + dtfac(i,k) = 1.0 + enddo + enddo +! + if ( ldiag_ugwp ) then + do i = its,im + dusfc_ls(i) = 0.0 + dvsfc_ls(i) = 0.0 + dusfc_bl(i) = 0.0 + dvsfc_bl(i) = 0.0 + dusfc_ss(i) = 0.0 + dvsfc_ss(i) = 0.0 + dusfc_fd(i) = 0.0 + dvsfc_fd(i) = 0.0 + enddo + do k = kts,km + do i = its,im + dtaux2d_ls(i,k)= 0.0 + dtauy2d_ls(i,k)= 0.0 + dtaux2d_bl(i,k)= 0.0 + dtauy2d_bl(i,k)= 0.0 + dtaux2d_ss(i,k)= 0.0 + dtauy2d_ss(i,k)= 0.0 + dtaux2d_fd(i,k)= 0.0 + dtauy2d_fd(i,k)= 0.0 + enddo + enddo + endif + + do i = its,im + taup(i,km+1) = 0.0 + xlinv(i) = 1.0/xl + dusfc(i) = 0.0 + dvsfc(i) = 0.0 + enddo +! +! initialize array for flow-blocking drag +! + taufb(1:im,1:km+1) = 0.0 + hmax(1:im) = 0.0 + komax(1:im) = 0 + kbmax(1:im) = 0 + kblk(1:im) = 0 +! + do k = kts,km + do i = its,im + vtj(i,k) = t1(i,k) * (1.+fv*q1(i,k)) + vtk(i,k) = vtj(i,k) / prslk(i,k) + ro(i,k) = 1./rd * prsl(i,k) / vtj(i,k) ! density kg/m**3 + enddo + enddo +! +! calculate mid-layer height (zl), interface height (zq), and layer depth (dz2). +! + !zq=0. + do k = kts,km + do i = its,im + !zq(i,k+1) = PHII(i,k+1)*g_inv + !dz2(i,k) = (PHII(i,k+1)-PHII(i,k))*g_inv + zl(i,k) = PHIL(i,k)*g_inv + enddo + enddo +! +! determine reference level: maximum of 2*var and pbl heights +! + do i = its,im + if(vtype(i)==15) then + zlowtop(i) = 1.0 * var_stoch(i) !!! reduce drag over land ice + else + zlowtop(i) = 2.0 * var_stoch(i) + endif + enddo +! + do i = its,im + flag(i) = .true. + enddo +! + do k = kts+1,km + do i = its,im + if(flag(i).and.zl(i,k).ge.zlowtop(i)) then + klowtop(i) = k+1 + flag(i) = .false. + endif + enddo + enddo +! +! determine the maximum height level +! note taht elvmax and zl are the heights from the model surface whereas +! oro (mean orography) is the height from the sea level +! + do i = its,im + flag(i) = .true. + enddo +! + do k = kts+1,km + do i = its,im + if(flag(i).and.zl(i,k).ge.elvmax(i)) then + komax(i) = k+1 + flag(i) = .false. + endif + enddo + enddo +! +! determine the launching level in determining blocking layer +! + do i = its,im + flag(i) = .true. + enddo +! + do k = kts+1,km + do i = its,im + if(flag(i).and.zl(i,k).ge.elvmax(i)+zlowtop(i)) then + kbmax(i) = k+1 + flag(i) = .false. + endif + enddo + enddo +! +! determing the reference level for gwd and blockding... +! + do i = its,im + hmax(i) = max(elvmax(i),zlowtop(i)) + enddo +! + do i = its,im +!!! kbl(i) = max(kpbl(i), klowtop(i)) ! do not use pbl height for the time being... + kbl(i) = max(komax(i), klowtop(i)) + kbl(i) = max(min(kbl(i),kpblmax),kpblmin) + enddo +! +! compute low level averages below reference level +! + do i = its,im + delks(i) = 1.0 / (prsi(i,1) - prsi(i,kbl(i))) + delks1(i) = 1.0 / (prsl(i,1) - prsl(i,kbl(i))) + enddo + do k = kts,kpblmax + do i = its,im + if (k.lt.kbl(i)) then + rcsks = rcs * del(i,k) * delks(i) + rdelks = del(i,k) * delks(i) + ubar(i) = ubar(i) + rcsks * u1(i,k) ! pbl u mean + vbar(i) = vbar(i) + rcsks * v1(i,k) ! pbl v mean + roll(i) = roll(i) + rdelks * ro(i,k) ! ro mean + endif + enddo + enddo +! +! figure out low-level horizontal wind direction +! +! nwd 1 2 3 4 5 6 7 8 +! wd w s sw nw e n ne se +! + do i = its,im + wdir = atan2(ubar(i),vbar(i)) + pi + idir = mod(nint(fdir*wdir),mdir) + 1 + nwd = nwdir(idir) + oa(i) = (1-2*int( (nwd-1)/4 )) * oa4(i,mod(nwd-1,4)+1) + ol(i) = max(ol4(i,mod(nwd-1,4)+1),olmin) + oc(i) = min(max(oc1(i),oc_min),oc_max) +! if (var(i).le.var_min) then +! oc(i) = max(oc(i)*var(i)/var_min,oc_min) +! endif + ! Repeat for small-scale gwd + oass(i) = (1-2*int( (nwd-1)/4 )) * oa4ss(i,mod(nwd-1,4)+1) + olss(i) = ol4ss(i,mod(nwd-1,4)+1) + +! +!----- compute orographic width along (ol) and perpendicular (olp) +!----- the direction of wind +! + ol4p(1) = ol4(i,2) + ol4p(2) = ol4(i,1) + ol4p(3) = ol4(i,4) + ol4p(4) = ol4(i,3) + olp(i) = max(ol4p(mod(nwd-1,4)+1),olmin) +! +!----- compute orographic direction (horizontal orographic aspect ratio) +! + od(i) = olp(i)/ol(i) + od(i) = min(od(i),odmax) + od(i) = max(od(i),odmin) +! +!----- compute length of grid in the along(dxy) and cross(dxyp) wind directions +! + dxy(i) = dxy4(i,MOD(nwd-1,4)+1) + dxyp(i) = dxy4p(i,MOD(nwd-1,4)+1) + enddo +! +! END INITIALIZATION; BEGIN GWD CALCULATIONS: +! +IF ( (do_gsl_drag_ls_bl).and. & + ((gwd_opt_ls .EQ. 1).or.(gwd_opt_bl .EQ. 1)) ) then + + do i=its,im + + if ( ls_taper(i).GT.1.E-02 ) then + +! +!--- saving richardson number in usqj for migwdi +! + do k = kts,km-1 + ti = 2.0 / (t1(i,k)+t1(i,k+1)) + rdz = 1./(zl(i,k+1) - zl(i,k)) + tem1 = u1(i,k) - u1(i,k+1) + tem2 = v1(i,k) - v1(i,k+1) + dw2 = rcl*(tem1*tem1 + tem2*tem2) + shr2 = max(dw2,dw2min) * rdz * rdz + bvf2 = g*(g/cp+rdz*(vtj(i,k+1)-vtj(i,k))) * ti + usqj(i,k) = max(bvf2/shr2,rimin) + bnv2(i,k) = 2.0*g*rdz*(vtk(i,k+1)-vtk(i,k))/(vtk(i,k+1)+vtk(i,k)) + bnv2(i,k) = max( bnv2(i,k), bnv2min ) + enddo +! +!----compute the "low level" or 1/3 wind magnitude (m/s) +! + ulow(i) = max(sqrt(ubar(i)*ubar(i) + vbar(i)*vbar(i)), 1.0) + rulow(i) = 1./ulow(i) +! + do k = kts,km-1 + velco(i,k) = (0.5*rcs) * ((u1(i,k)+u1(i,k+1)) * ubar(i) & + + (v1(i,k)+v1(i,k+1)) * vbar(i)) + velco(i,k) = velco(i,k) * rulow(i) + if ((velco(i,k).lt.veleps) .and. (velco(i,k).gt.0.)) then + velco(i,k) = veleps + endif + enddo +! +! no drag when sub-oro is too small.. +! + ldrag(i) = hmax(i).le.hmt_min +! +! no drag when critical level in the base layer +! + ldrag(i) = ldrag(i).or. velco(i,1).le.0. +! +! no drag when velco.lt.0 +! + do k = kpblmin,kpblmax + if (k .lt. kbl(i)) ldrag(i) = ldrag(i).or. velco(i,k).le.0. + enddo +! +! no drag when bnv2.lt.0 +! + do k = kts,kpblmax + if (k .lt. kbl(i)) ldrag(i) = ldrag(i).or. bnv2(i,k).lt.0. + enddo +! +!-----the low level weighted average ri is stored in usqj(1,1; im) +!-----the low level weighted average n**2 is stored in bnv2(1,1; im) +!---- this is called bnvl2 in phys_gwd_alpert_sub not bnv2 +!---- rdelks (del(k)/delks) vert ave factor so we can * instead of / +! + wtkbj = (prsl(i,1)-prsl(i,2)) * delks1(i) + bnv2(i,1) = wtkbj * bnv2(i,1) + usqj(i,1) = wtkbj * usqj(i,1) +! + do k = kpblmin,kpblmax + if (k .lt. kbl(i)) then + rdelks = (prsl(i,k)-prsl(i,k+1)) * delks1(i) + bnv2(i,1) = bnv2(i,1) + bnv2(i,k) * rdelks + usqj(i,1) = usqj(i,1) + usqj(i,k) * rdelks + endif + enddo +! + ldrag(i) = ldrag(i) .or. bnv2(i,1).le.0.0 + ldrag(i) = ldrag(i) .or. ulow(i).eq.1.0 + ldrag(i) = ldrag(i) .or. var_stoch(i) .le. 0.0 + ldrag(i) = ldrag(i) .or. xland(i) .gt. 1.5 +! +! set all ri low level values to the low level value +! + do k = kpblmin,kpblmax + if (k .lt. kbl(i)) usqj(i,k) = usqj(i,1) + enddo +! + if (.not.ldrag(i)) then + bnv(i) = sqrt( bnv2(i,1) ) + fr(i) = bnv(i) * rulow(i) * 2. * var_stoch(i) * od(i) + fr(i) = min(fr(i),frmax) + xn(i) = ubar(i) * rulow(i) + yn(i) = vbar(i) * rulow(i) + endif +! +! compute the base level stress and store it in taub +! calculate enhancement factor, number of mountains & aspect +! ratio const. use simplified relationship between standard +! deviation & critical hgt + + if (.not. ldrag(i)) then + efact = (oa(i) + 2.) ** (ce*fr(i)/frc) + efact = min( max(efact,efmin), efmax ) + coefm(i) = (1. + ol(i)) ** (oa(i)+1.) + xlinv(i) = coefm(i) / cleff(i) + tem = fr(i) * fr(i) * oc(i) + gfobnv = gmax * tem / ((tem + cg)*bnv(i)) + if ( gwd_opt_ls .NE. 0 ) then + taub(i) = xlinv(i) * roll(i) * ulow(i) * ulow(i) & + * ulow(i) * gfobnv * efact + else ! We've gotten what we need for the blocking scheme + taub(i) = 0.0 + end if + else + taub(i) = 0.0 + xn(i) = 0.0 + yn(i) = 0.0 + endif + + endif ! (ls_taper(i).GT.1.E-02) + + enddo ! do i=its,im + +ENDIF ! (do_gsl_drag_ls_bl).and.((gwd_opt_ls .EQ. 1).or.(gwd_opt_bl .EQ. 1)) + +!========================================================= +! add small-scale wavedrag for stable boundary layer +!========================================================= + XNBV=0. + tauwavex0=0. + tauwavey0=0. + density=1.2 + utendwave=0. + vtendwave=0. +! +IF ( do_gsl_drag_ss ) THEN + + do i=its,im + + if ( ss_taper(i).GT.1.E-02 ) then + ! + ! calculating potential temperature + ! + do k = kts,km + thx(i,k) = t1(i,k)/prslk(i,k) + enddo + ! + do k = kts,km + tvcon = (1.+fv*q1(i,k)) + thvx(i,k) = thx(i,k)*tvcon + enddo + + hpbl2 = hpbl(i)+10. + kpbl2 = kpbl(i) + !kvar = MIN(kpbl, k-level of var) + kvar = 1 + do k=kts+1,MAX(kpbl(i),kts+1) +! IF (zl(i,k)>2.*var(i) .or. zl(i,k)>2*varmax) then + IF (zl(i,k)>300.) then + kpbl2 = k + IF (k == kpbl(i)) then + hpbl2 = hpbl(i)+10. + ELSE + hpbl2 = zl(i,k)+10. + ENDIF + exit + ENDIF + enddo + if((xland(i)-1.5).le.0. .and. 2.*varss_stoch(i).le.hpbl(i))then + if(br1(i).gt.0. .and. thvx(i,kpbl2)-thvx(i,kts) > 0.)then + coefm_ss(i) = (1. + olss(i)) ** (oass(i)+1.) + xlinv(i) = coefm_ss(i) / cleff_ss(i) + !govrth(i)=g/(0.5*(thvx(i,kpbl(i))+thvx(i,kts))) + govrth(i)=g/(0.5*(thvx(i,kpbl2)+thvx(i,kts))) + !XNBV=sqrt(govrth(i)*(thvx(i,kpbl(i))-thvx(i,kts))/hpbl(i)) + XNBV=sqrt(govrth(i)*(thvx(i,kpbl2)-thvx(i,kts))/hpbl2) +! + !if(abs(XNBV/u1(i,kpbl(i))).gt.xlinv(i))then + if(abs(XNBV/u1(i,kpbl2)).gt.xlinv(i))then + !tauwavex0=0.5*XNBV*xlinv(i)*(2*MIN(varss(i),75.))**2*ro(i,kts)*u1(i,kpbl(i)) + !tauwavex0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*u1(i,kpbl2) + !tauwavex0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*u1(i,3) + ! Remove limit on varss_stoch + var_temp = varss_stoch(i) + ! Note: This is a semi-implicit treatment of the time differencing + var_temp2 = 0.5*XNBV*xlinv(i)*(2.*var_temp)**2*ro(i,kvar) ! this is greater than zero + tauwavex0=var_temp2*u1(i,kvar)/(1.+var_temp2*deltim) + tauwavex0=tauwavex0*ss_taper(i) + else + tauwavex0=0. + endif +! + !if(abs(XNBV/v1(i,kpbl(i))).gt.xlinv(i))then + if(abs(XNBV/v1(i,kpbl2)).gt.xlinv(i))then + !tauwavey0=0.5*XNBV*xlinv(i)*(2*MIN(varss(i),75.))**2*ro(i,kts)*v1(i,kpbl(i)) + !tauwavey0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*v1(i,kpbl2) + !tauwavey0=0.5*XNBV*xlinv(i)*(2.*MIN(varss(i),40.))**2*ro(i,kts)*v1(i,3) + ! Remove limit on varss_stoch + var_temp = varss_stoch(i) + ! Note: This is a semi-implicit treatment of the time differencing + var_temp2 = 0.5*XNBV*xlinv(i)*(2.*var_temp)**2*ro(i,kvar) ! this is greater than zero + tauwavey0=var_temp2*v1(i,kvar)/(1.+var_temp2*deltim) + tauwavey0=tauwavey0*ss_taper(i) + else + tauwavey0=0. + endif + + do k=kts,kpbl(i) !MIN(kpbl2+1,km-1) +!original + !utendwave(i,k)=-1.*tauwavex0*2.*max((1.-zl(i,k)/hpbl(i)),0.)/hpbl(i) + !vtendwave(i,k)=-1.*tauwavey0*2.*max((1.-zl(i,k)/hpbl(i)),0.)/hpbl(i) +!new + utendwave(i,k)=-1.*tauwavex0*2.*max((1.-zl(i,k)/hpbl2),0.)/hpbl2 + vtendwave(i,k)=-1.*tauwavey0*2.*max((1.-zl(i,k)/hpbl2),0.)/hpbl2 +!mod-to be used in HRRRv3/RAPv4 + !utendwave(i,k)=-1.*tauwavex0 * max((1.-zl(i,k)/hpbl2),0.)**2 + !vtendwave(i,k)=-1.*tauwavey0 * max((1.-zl(i,k)/hpbl2),0.)**2 + enddo + endif + endif + + do k = kts,km + dudt(i,k) = dudt(i,k) + utendwave(i,k) + dvdt(i,k) = dvdt(i,k) + vtendwave(i,k) + dusfc(i) = dusfc(i) + utendwave(i,k) * del(i,k) + dvsfc(i) = dvsfc(i) + vtendwave(i,k) * del(i,k) + enddo + if(udtend>0) then + dtend(i,kts:km,udtend) = dtend(i,kts:km,udtend) + utendwave(i,kts:km)*deltim + endif + if(vdtend>0) then + dtend(i,kts:km,vdtend) = dtend(i,kts:km,vdtend) + vtendwave(i,kts:km)*deltim + endif + if ( ldiag_ugwp ) then + do k = kts,km + dusfc_ss(i) = dusfc_ss(i) + utendwave(i,k) * del(i,k) + dvsfc_ss(i) = dvsfc_ss(i) + vtendwave(i,k) * del(i,k) + dtaux2d_ss(i,k) = utendwave(i,k) + dtauy2d_ss(i,k) = vtendwave(i,k) + enddo + endif + + endif ! if (ss_taper(i).GT.1.E-02) + + enddo ! i=its,im + +ENDIF ! if (do_gsl_drag_ss) + +!================================================================ +! Topographic Form Drag from Beljaars et al. (2004, QJRMS, equ. 16): +!================================================================ +IF ( do_gsl_drag_tofd ) THEN + + do i=its,im + + if ( ss_taper(i).GT.1.E-02 ) then + + utendform=0. + vtendform=0. + + IF ((xland(i)-1.5) .le. 0.) then + !(IH*kflt**n1)**-1 = (0.00102*0.00035**-1.9)**-1 = 0.00026615161 + ! Remove limit on varss_stoch + var_temp = varss_stoch(i) + !var_temp = MIN(var_temp, 250.) + a1=0.00026615161*var_temp**2 +! a1=0.00026615161*MIN(varss(i),varmax)**2 +! a1=0.00026615161*(0.5*varss(i))**2 + ! k1**(n1-n2) = 0.003**(-1.9 - -2.8) = 0.003**0.9 = 0.005363 + a2=a1*0.005363 + ! Beljaars H_efold + H_efold = 1500. + DO k=kts,km + wsp=SQRT(u1(i,k)**2 + v1(i,k)**2) + ! alpha*beta*Cmd*Ccorr*2.109 = 12.*1.*0.005*0.6*2.109 = 0.0759 + var_temp = 0.0759*EXP(-(zl(i,k)/H_efold)**1.5)*a2* & + zl(i,k)**(-1.2)*ss_taper(i) ! this is greater than zero + ! Note: This is a semi-implicit treatment of the time differencing + ! per Beljaars et al. (2004, QJRMS) + utendform(i,k) = - var_temp*wsp*u1(i,k)/(1. + var_temp*deltim*wsp) + vtendform(i,k) = - var_temp*wsp*v1(i,k)/(1. + var_temp*deltim*wsp) + !IF(zl(i,k) > 4000.) exit + ENDDO + ENDIF + + do k = kts,km + dudt(i,k) = dudt(i,k) + utendform(i,k) + dvdt(i,k) = dvdt(i,k) + vtendform(i,k) + dusfc(i) = dusfc(i) + utendform(i,k) * del(i,k) + dvsfc(i) = dvsfc(i) + vtendform(i,k) * del(i,k) + enddo + if(udtend>0) then + dtend(i,kts:km,udtend) = dtend(i,kts:km,udtend) + utendform(i,kts:km)*deltim + endif + if(vdtend>0) then + dtend(i,kts:km,vdtend) = dtend(i,kts:km,vdtend) + vtendform(i,kts:km)*deltim + endif + if ( ldiag_ugwp ) then + do k = kts,km + dtaux2d_fd(i,k) = utendform(i,k) + dtauy2d_fd(i,k) = vtendform(i,k) + dusfc_fd(i) = dusfc_fd(i) + utendform(i,k) * del(i,k) + dvsfc_fd(i) = dvsfc_fd(i) + vtendform(i,k) * del(i,k) + enddo + endif + + endif ! if (ss_taper(i).GT.1.E-02) + + enddo ! i=its,im + +ENDIF ! if (do_gsl_drag_tofd) +!======================================================= +! More for the large-scale gwd component +IF ( (do_gsl_drag_ls_bl).and.(gwd_opt_ls .EQ. 1) ) THEN + + do i=its,im + + if ( ls_taper(i).GT.1.E-02 ) then + +! +! now compute vertical structure of the stress. + do k = kts,kpblmax + if (k .le. kbl(i)) taup(i,k) = taub(i) + enddo +! + do k = kpblmin, km-1 ! vertical level k loop! + kp1 = k + 1 +! +! unstablelayer if ri < ric +! unstable layer if upper air vel comp along surf vel <=0 (crit lay) +! at (u-c)=0. crit layer exists and bit vector should be set (.le.) +! + if (k .ge. kbl(i)) then + icrilv(i) = icrilv(i) .or. ( usqj(i,k) .lt. ric) & + .or. (velco(i,k) .le. 0.0) + brvf(i) = max(bnv2(i,k),bnv2min) ! brunt-vaisala frequency squared + brvf(i) = sqrt(brvf(i)) ! brunt-vaisala frequency + endif +! + if (k .ge. kbl(i) .and. (.not. ldrag(i))) then + if (.not.icrilv(i) .and. taup(i,k) .gt. 0.0 ) then + temv = 1.0 / velco(i,k) + tem1 = coefm(i)/dxy(i)*(ro(i,kp1)+ro(i,k))*brvf(i)* & + velco(i,k)*0.5 + hd = sqrt(taup(i,k) / tem1) + fro = brvf(i) * hd * temv +! +! rim is the minimum-richardson number by shutts (1985) + tem2 = sqrt(usqj(i,k)) + tem = 1. + tem2 * fro + rim = usqj(i,k) * (1.-fro) / (tem * tem) +! +! check stability to employ the 'saturation hypothesis' +! of lindzen (1981) except at tropospheric downstream regions +! + if (rim .le. ric) then ! saturation hypothesis! + temc = 2.0 + 1.0 / tem2 + hd = velco(i,k) * (2.*sqrt(temc)-temc) / brvf(i) + taup(i,kp1) = tem1 * hd * hd + else ! no wavebreaking! + taup(i,kp1) = taup(i,k) + endif + endif + endif + enddo +! + if(lcap.lt.km) then + do klcap = lcapp1,km + taup(i,klcap) = prsi(i,klcap) / prsi(i,lcap) * taup(i,lcap) + enddo + endif + + endif ! if ( ls_taper(i).GT.1.E-02 ) + + enddo ! do i=its,im + +ENDIF ! (do_gsl_drag_ls_bl).and.(gwd_opt_ls .EQ. 1) +!=============================================================== +!COMPUTE BLOCKING COMPONENT +!=============================================================== +IF ( (do_gsl_drag_ls_bl) .and. (gwd_opt_bl .EQ. 1) ) THEN + do i = its,im + flag(i) = .true. + enddo + + do i=its,im + + if ( ls_taper(i).GT.1.E-02 ) then + + if (.not.ldrag(i)) then +! +!------- determine the height of flow-blocking layer +! + pe = 0.0 + ke = 0.0 + do k = km, kpblmin, -1 + if(flag(i).and. k.le.kbmax(i)) then + pe = pe + bnv2(i,k)*(zl(i,kbmax(i))-zl(i,k))* & + del(i,k)/g/ro(i,k) + ke = 0.5*((rcs*u1(i,k))**2.+(rcs*v1(i,k))**2.) +! +!---------- apply flow-blocking drag when pe >= ke +! + if(pe.ge.ke.and.zl(i,k).le.hmax(i)) then + kblk(i)= k + zblk = zl(i,k) + RDXZB(i) = real(k,kind=kind_phys) + flag(i) = .false. + endif + endif + enddo + if(.not.flag(i)) then +! +!--------- compute flow-blocking stress +! + cd = max(2.0-1.0/od(i),cdmin) + taufb(i,kts) = 0.5 * roll(i) * coefm(i) / & + max(dxmax_ls,dxy(i))**2 * cd * dxyp(i) * & + olp(i) * zblk * ulow(i)**2 + tautem = taufb(i,kts)/float(kblk(i)-kts) + do k = kts+1, kpblmax + if (k .le. kblk(i)) taufb(i,k) = taufb(i,k-1) - tautem + enddo +! +! reset gwd stress below blocking layer +! + do k = kts,kpblmax + if (k .le. kblk(i)) taup(i,k) = taup(i,kblk(i)) + enddo +! if(kblk(i).gt.5) print *,' gwd kbl komax kbmax kblk ',kbl(i),komax(i),kbmax(i),kblk(i) +! if(kblk(i).gt.5) print *,' gwd elvmax zlowtop zblk ',elvmax(i),zlowtop(i),zl(i,kblk(i)) + endif + + endif ! if (.not.ldrag(i)) + + endif ! if ( ls_taper(i).GT.1.E-02 ) + + enddo ! do i=its,im + +ENDIF ! IF ( (do_gsl_drag_ls_bl) .and. (gwd_opt_bl .EQ. 1) ) +!=========================================================== +IF ( (do_gsl_drag_ls_bl) .and. & + (gwd_opt_ls .EQ. 1 .OR. gwd_opt_bl .EQ. 1) ) THEN + + do i=its,im + + if ( ls_taper(i) .GT. 1.E-02 ) then + +! +! calculate - (g)*d(tau)/d(pressure) and deceleration terms dtaux, dtauy +! + do k = kts,km + taud_ls(i,k) = 1. * (taup(i,k+1) - taup(i,k)) * csg / del(i,k) + taud_bl(i,k) = 1. * (taufb(i,k+1) - taufb(i,k)) * csg / del(i,k) + enddo +! +! limit de-acceleration (momentum deposition ) at top to 1/2 value +! the idea is some stuff must go out the 'top' + do klcap = lcap,km + taud_ls(i,klcap) = taud_ls(i,klcap) * factop + taud_bl(i,klcap) = taud_bl(i,klcap) * factop + enddo +! +! if the gravity wave drag would force a critical line +! in the lower ksmm1 layers during the next deltim timestep, +! then only apply drag until that critical line is reached. +! + do k = kts,kpblmax-1 + if ((taud_ls(i,k)+taud_bl(i,k)).ne.0.) then + dtfac(i,k) = min(dtfac(i,k),abs(velco(i,k) & + /(deltim*rcs*(taud_ls(i,k)+taud_bl(i,k))))) + endif + enddo +! apply limiter to mesosphere drag, reduce the drag by density factor 10-3 +! prevent wind reversal... +! + do k = kpblmax,km + if ((taud_ls(i,k)+taud_bl(i,k)).ne.0..and.prsl(i,k).le.pcutoff) then + denfac = min(ro(i,k)/pcutoff_den,1.) + dtfac(i,k) = min(dtfac(i,k),denfac*abs(velco(i,k) & + /(deltim*rcs*(taud_ls(i,k)+taud_bl(i,k))))) + endif + enddo +! + do k = kts,km + taud_ls(i,k) = taud_ls(i,k)*dtfac(i,k)* ls_taper(i) *(1.-rstoch(i)) + taud_bl(i,k) = taud_bl(i,k)*dtfac(i,k)* ls_taper(i) *(1.-rstoch(i)) + dtaux = taud_ls(i,k) * xn(i) + dtauy = taud_ls(i,k) * yn(i) + dtauxb = taud_bl(i,k) * xn(i) + dtauyb = taud_bl(i,k) * yn(i) + + !add blocking and large-scale contributions to tendencies + dudt(i,k) = dtaux + dtauxb + dudt(i,k) + dvdt(i,k) = dtauy + dtauyb + dvdt(i,k) + + if ( gsd_diss_ht_opt .EQ. 1 ) then + ! Calculate dissipation heating + ! Initial kinetic energy (at t0-dt) + eng0 = 0.5*( (rcs*u1(i,k))**2. + (rcs*v1(i,k))**2. ) + ! Kinetic energy after wave-breaking/flow-blocking + eng1 = 0.5*( (rcs*(u1(i,k)+(dtaux+dtauxb)*deltim))**2 + & + (rcs*(v1(i,k)+(dtauy+dtauyb)*deltim))**2 ) + ! Modify theta tendency + dtdt(i,k) = dtdt(i,k) + max((eng0-eng1),0.0)/cp/deltim + if ( Tdtend>0 ) then + dtend(i,k,Tdtend) = dtend(i,k,Tdtend) + max((eng0-eng1),0.0)/cp + endif + endif + + dusfc(i) = dusfc(i) + taud_ls(i,k)*xn(i)*del(i,k) + & + taud_bl(i,k)*xn(i)*del(i,k) + dvsfc(i) = dvsfc(i) + taud_ls(i,k)*yn(i)*del(i,k) + & + taud_bl(i,k)*yn(i)*del(i,k) + if(udtend>0) then + dtend(i,k,udtend) = dtend(i,k,udtend) + (taud_ls(i,k) * & + xn(i) + taud_bl(i,k) * xn(i)) * deltim + endif + if(vdtend>0) then + dtend(i,k,vdtend) = dtend(i,k,vdtend) + (taud_ls(i,k) * & + yn(i) + taud_bl(i,k) * yn(i)) * deltim + endif + + enddo + + ! Finalize dusfc and dvsfc diagnostics + dusfc(i) = -(invgrcs) * dusfc(i) + dvsfc(i) = -(invgrcs) * dvsfc(i) + + if ( ldiag_ugwp ) then + do k = kts,km + dtaux2d_ls(i,k) = taud_ls(i,k) * xn(i) + dtauy2d_ls(i,k) = taud_ls(i,k) * yn(i) + dtaux2d_bl(i,k) = taud_bl(i,k) * xn(i) + dtauy2d_bl(i,k) = taud_bl(i,k) * yn(i) + dusfc_ls(i) = dusfc_ls(i) + dtaux2d_ls(i,k) * del(i,k) + dvsfc_ls(i) = dvsfc_ls(i) + dtauy2d_ls(i,k) * del(i,k) + dusfc_bl(i) = dusfc_bl(i) + dtaux2d_bl(i,k) * del(i,k) + dvsfc_bl(i) = dvsfc_bl(i) + dtauy2d_bl(i,k) * del(i,k) + enddo + endif + + endif ! if ( ls_taper(i) .GT. 1.E-02 ) + + enddo ! do i=its,im + +ENDIF ! (do_gsl_drag_ls_bl).and.(gwd_opt_ls.EQ.1 .OR. gwd_opt_bl.EQ.1) + +if ( ldiag_ugwp ) then + ! Finalize dusfc and dvsfc diagnostics + do i = its,im + dusfc_ls(i) = -(invgrcs) * dusfc_ls(i) + dvsfc_ls(i) = -(invgrcs) * dvsfc_ls(i) + dusfc_bl(i) = -(invgrcs) * dusfc_bl(i) + dvsfc_bl(i) = -(invgrcs) * dvsfc_bl(i) + dusfc_ss(i) = -(invgrcs) * dusfc_ss(i) + dvsfc_ss(i) = -(invgrcs) * dvsfc_ss(i) + dusfc_fd(i) = -(invgrcs) * dusfc_fd(i) + dvsfc_fd(i) = -(invgrcs) * dvsfc_fd(i) + enddo +endif +! + return + end subroutine drag_suite_psl ! !> @} diff --git a/physics/GWD/drag_suite.meta b/physics/GWD/drag_suite.meta index 94dddcc93..6981d4761 100644 --- a/physics/GWD/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -438,6 +438,13 @@ type = real kind = kind_phys intent = in +[vtype] + standard_name = vegetation_type_classification + long_name = vegetation type for lsm + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent = in [g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -573,6 +580,14 @@ dimensions = () type = logical intent = in +[psl_gwd_dx_factor] + standard_name = effective_grid_spacing_of_psl_gwd_suite + long_name = multiplication of grid spacing + units = count + dimensions = () + type = real + kind = kind_phys + intent = in [dtend] standard_name = cumulative_change_of_state_variables long_name = diagnostic tendencies for state variables diff --git a/physics/GWD/ugwpv1_gsldrag.F90 b/physics/GWD/ugwpv1_gsldrag.F90 index 9303e0221..233377f29 100644 --- a/physics/GWD/ugwpv1_gsldrag.F90 +++ b/physics/GWD/ugwpv1_gsldrag.F90 @@ -44,7 +44,7 @@ module ugwpv1_gsldrag use cires_ugwpv1_solv2, only: cires_ugwpv1_ngw_solv2 use cires_ugwpv1_oro, only: orogw_v1 - use drag_suite, only: drag_suite_run + use drag_suite, only: drag_suite_run, drag_suite_psl implicit none @@ -305,11 +305,13 @@ end subroutine ugwpv1_gsldrag_finalize !! @{ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, & fhzero, kdt, ldiag3d, lssav, flag_for_gwd_generic_tend, do_gsl_drag_ls_bl, & - do_gsl_drag_ss, do_gsl_drag_tofd, do_ugwp_v1, do_ugwp_v1_orog_only, & + do_gsl_drag_ss, do_gsl_drag_tofd, & + do_gwd_opt_psl, psl_gwd_dx_factor, & + do_ugwp_v1, do_ugwp_v1_orog_only, & do_ugwp_v1_w_gsldrag, gwd_opt, do_tofd, ldiag_ugwp, ugwp_seq_update, & cdmbgwd, jdat, nmtvr, hprime, oc, theta, sigma, gamma, & elvmax, clx, oa4, varss,oc1ss,oa4ss,ol4ss, dx, xlat, xlat_d, sinlat, coslat, & - area, rain, br1, hpbl, kpbl, slmsk, & + area, rain, br1, hpbl,vtype, kpbl, slmsk, & ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, del, tau_amf, & dudt_ogw, dvdt_ogw, du_ogwcol, dv_ogwcol, & dudt_obl, dvdt_obl, du_oblcol, dv_oblcol, & @@ -367,7 +369,9 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, real(kind=kind_phys), intent(in) :: dtp, fhzero real(kind=kind_phys), intent(in) :: ak(:), bk(:) integer, intent(in) :: kdt, jdat(:) - +! option for psl gwd + logical, intent(in) :: do_gwd_opt_psl ! option for psl gravity wave drag + real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor ! ! SSO parameters and variables integer, intent(in) :: gwd_opt !gwd_opt and nmtvr are "redundant" controls integer, intent(in) :: nmtvr @@ -396,6 +400,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii real(kind=kind_phys), intent(in), dimension(:,:) :: q1 integer, intent(in), dimension(:) :: kpbl + integer, intent(in), dimension(:) :: vtype real(kind=kind_phys), intent(in), dimension(:) :: rain real(kind=kind_phys), intent(in), dimension(:) :: br1, hpbl, slmsk @@ -544,6 +549,27 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, ! dusfcg, dvsfcg ! ! + if (do_gwd_opt_psl) then + call drag_suite_psl(im, levs, Pdvdt, Pdudt, Pdtdt, & + ugrs,vgrs,tgrs,q1, & + kpbl,prsi,del,prsl,prslk,phii,phil,dtp, & + kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, & + ol4ss,theta,sigma,gamma,elvmax, & + dudt_ogw, dvdt_ogw, dudt_obl, dvdt_obl, & + dudt_oss, dvdt_oss, dudt_ofd, dvdt_ofd, & + dusfcg, dvsfcg, & + du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, & + du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, & + slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, & + con_fv, con_pi, lonr, & + cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & + do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & + psl_gwd_dx_factor, & + dtend, dtidx, index_of_process_orographic_gwd, & + index_of_temperature, index_of_x_wind, & + index_of_y_wind, ldiag3d, ldiag_ugwp, & + ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg) + else call drag_suite_run(im, levs, Pdvdt, Pdudt, Pdtdt, & ugrs,vgrs,tgrs,q1, & kpbl,prsi,del,prsl,prslk,phii,phil,dtp, & @@ -554,7 +580,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, dusfcg, dvsfcg, & du_ogwcol, dv_ogwcol, du_oblcol, dv_oblcol, & du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, & - slmsk,br1,hpbl, con_g,con_cp,con_rd,con_rv, & + slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, & con_fv, con_pi, lonr, & cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & @@ -562,6 +588,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, index_of_temperature, index_of_x_wind, & index_of_y_wind, ldiag3d, ldiag_ugwp, & ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg) + endif ! ! dusfcg = du_ogwcol + du_oblcol + du_osscol + du_ofdcol ! diff --git a/physics/GWD/ugwpv1_gsldrag.meta b/physics/GWD/ugwpv1_gsldrag.meta index 73d7eee1c..76e0c4d47 100644 --- a/physics/GWD/ugwpv1_gsldrag.meta +++ b/physics/GWD/ugwpv1_gsldrag.meta @@ -402,6 +402,21 @@ dimensions = () type = logical intent = in +[do_gwd_opt_psl] + standard_name = do_gsl_drag_suite_with_psl_gwd_option + long_name = flag to activate PSL drag suite - mesoscale GWD and blocking + units = flag + dimensions = () + type = logical + intent = in +[psl_gwd_dx_factor] + standard_name = effective_grid_spacing_of_psl_gwd_suite + long_name = multiplication of grid spacing + units = count + dimensions = () + type = real + kind = kind_phys + intent = in [do_ugwp_v1] standard_name = flag_for_ugwp_version_1 long_name = flag to activate ver 1 CIRES UGWP @@ -641,6 +656,13 @@ type = real kind = kind_phys intent = in +[vtype] + standard_name = vegetation_type_classification + long_name = vegetation type for lsm + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent = in [kpbl] standard_name = vertical_index_at_top_of_atmosphere_boundary_layer long_name = vertical index at top atmospheric boundary layer diff --git a/physics/GWD/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 index fcdee3b5d..a2f56c0e4 100644 --- a/physics/GWD/unified_ugwp.F90 +++ b/physics/GWD/unified_ugwp.F90 @@ -40,7 +40,7 @@ module unified_ugwp use gwdps, only: gwdps_run use cires_ugwp_triggers use ugwp_driver_v0 - use drag_suite, only: drag_suite_run + use drag_suite, only: drag_suite_run, drag_suite_psl implicit none @@ -249,11 +249,11 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt varss,oc1ss,oa4ss,ol4ss,dx,dusfc_ms,dvsfc_ms,dusfc_bl,dvsfc_bl,dusfc_ss, & dvsfc_ss,dusfc_fd,dvsfc_fd,dtaux2d_ms,dtauy2d_ms,dtaux2d_bl,dtauy2d_bl, & dtaux2d_ss,dtauy2d_ss,dtaux2d_fd,dtauy2d_fd,dudt_ngw,dvdt_ngw,dtdt_ngw, & - br1,hpbl,slmsk, do_tofd, ldiag_ugwp, ugwp_seq_update, & + br1,hpbl,vtype,slmsk, do_tofd, ldiag_ugwp, ugwp_seq_update, & cdmbgwd, jdat, xlat, xlat_d, sinlat, coslat, area, & ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, & del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & - tau_tofd, tau_mtb, tau_ogw, tau_ngw, & + tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_omega, con_pi, con_cp, con_rd, con_rv, & con_rerth, con_fvirt, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & @@ -262,6 +262,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt index_of_process_nonorographic_gwd, & lssav, flag_for_gwd_generic_tend, do_ugwp_v0, do_ugwp_v0_orog_only, & do_ugwp_v0_nst_only, do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & + do_gwd_opt_psl, psl_gwd_dx_factor, & gwd_opt, spp_wts_gwd, spp_gwd, errmsg, errflg) implicit none @@ -270,6 +271,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt integer, intent(in) :: me, master, im, levs, ntrac, kdt, lonr, nmtvr integer, intent(in) :: gwd_opt integer, intent(in), dimension(:) :: kpbl + integer, intent(in), dimension(:) :: vtype 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 @@ -309,7 +311,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt & slmsk(:) real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg - real(kind=kind_phys), intent(out), dimension(:) :: rdxzb + real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw 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 @@ -345,6 +347,10 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt real(kind=kind_phys), intent(in) :: spp_wts_gwd(:,:) integer, intent(in) :: spp_gwd + ! option for psl gwd + logical, intent(in) :: do_gwd_opt_psl ! option for psl gravity wave drag + real(kind=kind_phys), intent(in) :: psl_gwd_dx_factor ! + character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg @@ -487,7 +493,26 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt ! Note: In case of GSL drag_suite, this includes ss and tofd if ( do_gsl_drag_ls_bl.or.do_gsl_drag_ss.or.do_gsl_drag_tofd ) then - +! +if (do_gwd_opt_psl) then + call drag_suite_psl(im,levs,dvdt,dudt,dtdt,uwnd1,vwnd1, & + tgrs,q1,kpbl,prsi,del,prsl,prslk,phii,phil,dtp, & + kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, & + ol4ss,theta,sigma,gamma,elvmax,dtaux2d_ms, & + dtauy2d_ms,dtaux2d_bl,dtauy2d_bl,dtaux2d_ss, & + dtauy2d_ss,dtaux2d_fd,dtauy2d_fd,dusfcg, & + dvsfcg,dusfc_ms,dvsfc_ms,dusfc_bl,dvsfc_bl, & + dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, & + slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, & + con_fvirt,con_pi,lonr, & + cdmbgwd,me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & + do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & + psl_gwd_dx_factor, & + dtend, dtidx, index_of_process_orographic_gwd, & + index_of_temperature, index_of_x_wind, & + index_of_y_wind, ldiag3d, ldiag_ugwp, & + ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg) +else call drag_suite_run(im,levs,dvdt,dudt,dtdt,uwnd1,vwnd1, & tgrs,q1,kpbl,prsi,del,prsl,prslk,phii,phil,dtp, & kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, & @@ -504,6 +529,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt index_of_temperature, index_of_x_wind, & index_of_y_wind, ldiag3d, ldiag_ugwp, & ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg) +endif ! ! put zeros due to xy GSL-drag style: dtaux2d_bl,dtauy2d_bl,dtaux2d_ss.......dusfc_ms,dvsfc_ms ! diff --git a/physics/GWD/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta index 189f7072c..e0d60459f 100644 --- a/physics/GWD/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -648,6 +648,13 @@ type = real kind = kind_phys intent = in +[vtype] + standard_name = vegetation_type_classification + long_name = vegetation type for lsm + units = index + dimensions = (horizontal_loop_extent) + type = integer + intent = in [slmsk] standard_name = area_type long_name = landmask: sea/land/ice=0/1/2 @@ -900,6 +907,30 @@ type = real kind = kind_phys intent = out +[zmtb] + standard_name = height_of_mountain_blocking + long_name = height of mountain blocking drag + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[zlwb] + standard_name = height_of_low_level_wave_breaking + long_name = height of low level wave breaking + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out +[zogw] + standard_name = height_of_launch_level_of_orographic_gravity_wave + long_name = height of launch level of orographic gravity wave + units = m + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys + intent = out [dudt_mtb] standard_name = instantaneous_change_in_x_wind_due_to_mountain_blocking_drag long_name = instantaneous change in x wind due to mountain blocking drag @@ -1194,6 +1225,21 @@ dimensions = () type = logical intent = in +[do_gwd_opt_psl] + standard_name = do_gsl_drag_suite_with_psl_gwd_option + long_name = flag to activate PSL drag suite - mesoscale GWD and blocking + units = flag + dimensions = () + type = logical + intent = in +[psl_gwd_dx_factor] + standard_name = effective_grid_spacing_of_psl_gwd_suite + long_name = multiplication of grid spacing + units = count + dimensions = () + type = real + kind = kind_phys + intent = in [gwd_opt] standard_name = control_for_drag_suite_gravity_wave_drag long_name = flag to choose gwd scheme diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 2472f11ba..38f88f487 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -423,8 +423,9 @@ subroutine noahmp_sflx (parameters, & smceq , & ! in : vegetation/soil characteristics sfctmp , sfcprs , psfc , uu , vv , q2, garea1 , & ! in : forcing qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing + varf , psl_gwd_z0m_factor, & ! in : small scale oro std pblhx , iz0tlnd , itime ,psi_opt ,& - prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing + prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing ep_1 , ep_2 , epsm1 , cp , & ! in : constants albold , sneqvo , & ! in/out : @@ -436,7 +437,7 @@ subroutine noahmp_sflx (parameters, & cm , ch , tauss , & ! in/out : grain , gdd , pgs , & ! in/out smcwtd ,deeprech , rech , ustarx , & ! in/out : - z0wrf , z0hwrf , ts , & ! out : + z0wrf , z0hwrf , ts , & ! out : fsa , fsr , fira , fsh , ssoil , fcev , & ! out : fgev , fctr , ecan , etran , edir , trad , & ! out : tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out : @@ -445,9 +446,9 @@ subroutine noahmp_sflx (parameters, & qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out : albd , albi , albsnd , albsni , & ! out : bgap , wgap , chv , chb , emissi , & ! out : - shg , shc , shb , evg , evb , ghv , & ! out : - ghb , irg , irc , irb , tr , evc , & ! out : - chleaf , chuc , chv2 , chb2 , fpice , pahv , & + shg , shc , shb , evg , evb , ghv , & ! out : + ghb , irg , irc , irb , tr , evc , & ! out : + chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & laisha , rb , qsfcveg , qsfcbare & #ifdef CCPP @@ -493,6 +494,8 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(in) :: prslk1x !< in exner function real (kind=kind_phys) , intent(in) :: garea1 !< in exner function + real (kind=kind_phys) , intent(in) :: varf !< small scale oro std + real (kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor ! real (kind=kind_phys) , intent(in) :: pblhx !< pbl height integer , intent(in) :: iz0tlnd !< z0t option integer , intent(in) :: itime !< @@ -832,6 +835,7 @@ subroutine noahmp_sflx (parameters, & fveg ,shdfac, pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , & !in thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in + varf,psl_gwd_z0m_factor , & !in pblhx ,iz0tlnd, itime ,psi_opt, ep_1, ep_2, epsm1,cp, & z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out @@ -1676,6 +1680,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in fveg ,shdfac, pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in + varf,psl_gwd_z0m_factor , & !in pblhx , iz0tlnd, itime,psi_opt,ep_1, ep_2, epsm1, cp, & z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out @@ -1757,6 +1762,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(in) :: prslk1x !< in exner function real (kind=kind_phys) , intent(in) :: garea1 !< + real (kind=kind_phys) , intent(in) :: varf + real (kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor real (kind=kind_phys) , intent(in) :: pblhx !< pbl height real (kind=kind_phys) , intent(in) :: ep_1 !< real (kind=kind_phys) , intent(in) :: ep_2 !< @@ -2252,6 +2259,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in + varf , psl_gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & eah ,tah ,tv ,tgv ,cmv, ustarx , & !inout #ifdef CCPP @@ -2266,7 +2274,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in !jref:start qc ,qsfc ,psfc , & !in q2v ,chv2 ,chleaf ,chuc , & - rb) !out + rb) !out ! new coupling code @@ -2290,6 +2298,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in emg ,stc ,df ,rsurf ,latheag , & !in gammag ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in + varf ,psl_gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & #ifdef CCPP tgb ,cmb ,chb, ustarx,errmsg ,errflg , & !inout @@ -3703,6 +3712,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in + varf ,psl_gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & eah ,tah ,tv ,tg ,cm,ustarx,& !inout #ifdef CCPP @@ -3716,7 +3726,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & csigmaf1, & !out qc ,qsfc ,psfc , & !in q2v ,cah2 ,chleaf ,chuc , & !inout - rb) !out + rb) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve for vegetation (tv) and @@ -3753,6 +3763,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(in) :: dt !< time step (s) real (kind=kind_phys), intent(in) :: fsno !< snow fraction + real (kind=kind_phys) , intent(in) :: varf ! + real (kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor ! real (kind=kind_phys) , intent(in) :: pblhx !< pbl height real (kind=kind_phys) , intent(in) :: ep_1 !< real (kind=kind_phys) , intent(in) :: ep_2 !< @@ -4125,6 +4137,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tah ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h, zpd ,snowh ,shdfac ,garea1 , & !in + varf,psl_gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -4434,6 +4447,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & emg ,stc ,df ,rsurf ,lathea , & !in gamma ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in + varf,psl_gwd_z0m_factor, & !in pblhx , iz0tlnd , itime ,psi_opt,ep_1,ep_2,epsm1,cp ,& #ifdef CCPP tgb ,cm ,ch,ustarx,errmsg ,errflg , & !inout @@ -4488,6 +4502,8 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(in) :: rhsur !< raltive humidity in surface soil/snow air space (-) real (kind=kind_phys), intent(in) :: fsno !< snow fraction + real (kind=kind_phys), intent(in) :: varf ! + real (kind=kind_phys), intent(in) :: psl_gwd_z0m_factor ! real (kind=kind_phys), intent(in) :: pblhx !< pbl height (m) real (kind=kind_phys), intent(in) :: ep_1 !< real (kind=kind_phys), intent(in) :: ep_2 !< @@ -4731,6 +4747,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h, zpd,snowh ,shdfac ,garea1 , & !in + varf,psl_gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -5437,6 +5454,7 @@ end subroutine sfcdif2 subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h,zpd ,snowh ,fveg ,garea1 , & !in + varf,psl_gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -5466,6 +5484,8 @@ subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur real (kind=kind_phys), intent(in ) :: snowh !< snow depth [m] real (kind=kind_phys), intent(in ) :: fveg !< fractional vegetation cover real (kind=kind_phys), intent(in ) :: garea1 !< grid area [km2] + real (kind=kind_phys), intent(in ) :: varf ! standard deviation org [m] + real (kind=kind_phys), intent(in ) :: psl_gwd_z0m_factor ! z0m factor in psl tofd real (kind=kind_phys), intent(inout) :: ustarx !< friction velocity [m/s] real (kind=kind_phys), intent(inout) :: fm !< momentum stability correction, weighted by prior iters real (kind=kind_phys), intent(inout) :: fh !< sen heat stability correction, weighted by prior iters @@ -5520,7 +5540,7 @@ subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur endif call gfs_stability (zlvlb, zvfun1, gdx, tv1, thv1, ur, z0m, z0h, tvs, grav, thsfc_loc, & - rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv) + varf,psl_gwd_z0m_factor,rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv) end subroutine sfcdif3 @@ -5530,6 +5550,7 @@ subroutine gfs_stability & ! --- inputs: ( z1, zvfun, gdx, tv1, thv1, wind, z0max, ztmax, tvs, grav, & thsfc_loc, & + varf,psl_gwd_z0m_factor, & ! --- outputs: rb, fm, fh, fm10, fh2, cm, ch, stress, ustar) @@ -5549,6 +5570,8 @@ subroutine gfs_stability & real(kind=kind_phys), intent(in) :: ztmax ! thermal roughness length real(kind=kind_phys), intent(in) :: tvs ! surface virtual temperature real(kind=kind_phys), intent(in) :: grav ! local gravity +real(kind=kind_phys), intent(in) :: varf ! turbulent scale oro std +real(kind=kind_phys), intent(in) :: psl_gwd_z0m_factor ! tofd factor logical, intent(in) :: thsfc_loc ! use local theta reference flag real(kind=kind_phys), intent(out) :: rb ! bulk richardson number [-] @@ -5607,6 +5630,11 @@ subroutine gfs_stability & real(kind=kind_phys) :: zolmax real(kind=kind_phys) xkzo +! tofd + real(kind=kind_phys) :: cf, zf, fri, fphim + real(kind=kind_phys), parameter :: varf_min = 50.0 + real(kind=kind_phys), parameter :: varf_max = 500.0 +!!! real(kind=kind_phys), parameter :: psl_gwd_z0m_factor = 0.003 z1i = one / z1 ! inverse of model height @@ -5727,6 +5755,17 @@ subroutine gfs_stability & endif ! end of if (dtv >= 0 ) then loop ! +! form drag coefficient +! + if ( varf.gt.varf_min .and. psl_gwd_z0m_factor.gt.0.0 ) then + zf = min( min(varf,varf_max)*psl_gwd_z0m_factor,z1 ) + fri = min( max( 1.-rb,0. ), 1.) + fphim = log( ( z1 + zf) / zf ) + cf = ca*ca / (fphim*fphim) * fri + else + cf = 0. + endif +! ! finish the exchange coefficient computation to provide fm and fh ! fm = fm - pm ! phi_m @@ -5738,7 +5777,7 @@ subroutine gfs_stability & tem1 = 0.00001_kind_phys/z1 ! minimum exhange coef (?) cm = max(cm, tem1) ch = max(ch, tem1) - stress = cm * wind * wind ! surface stress = Cm*U*U + stress = (cm + cf)* wind * wind ! cf for tofd 10.15) or (10.19) in Arya ustar = sqrt(stress) ! friction velocity return @@ -5887,7 +5926,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, else z0h_out = z0m_out * 0.01 endif - + elseif (opt_trs == blumel99) then reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index db3ae472f..90cc14a8d 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -137,6 +137,7 @@ subroutine noahmpdrv_run & rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, rhonewsn1,& con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, & con_fvirt, con_rd, con_hfus, thsfc_loc, cpllnd, cpllnd2atm,& + nmtvr,mntvar,psl_gwd_z0m_factor, & ! --- in/outs: weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & @@ -287,6 +288,7 @@ subroutine noahmpdrv_run & integer , intent(in) :: iopt_stc ! option for snow/soil temperature time scheme (only layer 1) integer , intent(in) :: iopt_trs ! option for thermal roughness scheme integer , intent(in) :: iopt_diag ! option for surface diagnose approach + integer , intent(in) :: nmtvr ! number of subgrid scale oroghic data real(kind=kind_phys), dimension(:) , intent(in) :: xlatin ! latitude real(kind=kind_phys), dimension(:) , intent(in) :: xcoszin ! cosine of zenith angle integer , intent(in) :: iyrlen ! year length [days] @@ -297,6 +299,8 @@ subroutine noahmpdrv_run & 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) :: mntvar ! subgrid orographic statistics data + real(kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor ! psl tofd zom factor 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] @@ -625,7 +629,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: canopy_heat_storage ! out | within-canopy heat [W/m2] real (kind=kind_phys) :: spec_humid_sfc_veg ! out | surface specific humidty over vegetation [kg/kg] real (kind=kind_phys) :: spec_humid_sfc_bare ! out | surface specific humidty over bare soil [kg/kg] - + real (kind=kind_phys) :: ustarx ! inout |surface friction velocity real (kind=kind_phys) :: prslkix ! in exner function real (kind=kind_phys) :: prsik1x ! in exner function @@ -635,6 +639,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: cq2 real (kind=kind_phys) :: qfx real (kind=kind_phys) :: wspd1 ! wind speed with all components + real (kind=kind_phys) :: varf_grid ! std deviation orography real (kind=kind_phys) :: pblhx ! height of pbl integer :: mnice @@ -740,6 +745,7 @@ subroutine noahmpdrv_run & area_grid = garea(i) pblhx = pblh(i) + varf_grid = mntvar(i,15) prslkix = prslki(i) prsik1x = prsik1(i) @@ -971,6 +977,7 @@ subroutine noahmpdrv_run & spec_humidity_forcing ,area_grid ,cloud_water_forcing , & sw_radiation_forcing ,radiation_lw_forcing ,thsfc_loc , & prslkix ,prsik1x ,prslk1x , & + varf_grid,psl_gwd_z0m_factor , & pblhx ,iz0tlnd ,itime , & psi_opt , & precip_convective , & @@ -1062,7 +1069,7 @@ subroutine noahmpdrv_run & chxy (i) = ch_noahmp zorl (i) = z0_total * 100.0 ! convert to cm ztmax (i) = z0h_total - + !LAI-scale canopy resistance based on weighted sunlit shaded fraction if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. & lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then @@ -1072,7 +1079,7 @@ subroutine noahmpdrv_run & ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded)) rca(i) = max((1.0/rca(i)),parameters%rsmin) !resistance end if - + smc (i,:) = soil_moisture_vol slc (i,:) = soil_liquid_vol snowxy (i) = float(snow_levels) @@ -1215,6 +1222,7 @@ subroutine noahmpdrv_run & call gfs_stability & (zf(i), zvfun(i), gdx, virtual_temperature, vptemp,wind(i), z0_total, z0h_total, & tvs1, con_g, thsfc_loc, & + varf_grid, psl_gwd_z0m_factor, & rb1(i), fm1(i), fh1(i), fm101(i), fh21(i), cm(i), ch(i), stress1(i), ustar1(i)) rmol1(i) = undefined !not used in GFS sfcdif -> to satsify output diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 7fa13f3af..3e24624fa 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -649,6 +649,29 @@ dimensions = () type = logical intent = in +[nmtvr] + standard_name = number_of_statistical_measures_of_subgrid_orography + long_name = number of statistical measures of subgrid height_above_mean_sea_level + units = count + dimensions = () + type = integer + intent = in +[mntvar] + standard_name = statistical_measures_of_subgrid_orography_collection_array + long_name = array of statistical measures of subgrid height_above_mean_sea_level + units = mixed + dimensions = (horizontal_loop_extent,number_of_statistical_measures_of_subgrid_orography) + type = real + kind = kind_phys + intent = in +[psl_gwd_z0m_factor] + standard_name = momentum_roughness_factor_in_turbulent_form_drag + long_name = multiplication of Z0m in PSL turbulent form drag + units = count + dimensions = () + type = real + kind = kind_phys + intent = in [weasd] standard_name = water_equivalent_accumulated_snow_depth_over_land long_name = water equiv of acc snow depth over land From 3342a4545eaabb3e5997dd78b693c40a961c3d0c Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Sun, 19 May 2024 15:55:12 -0400 Subject: [PATCH 230/249] Change code format in file module_sf_noahmplsm.F90 --- physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 38f88f487..8086831e9 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -425,7 +425,7 @@ subroutine noahmp_sflx (parameters, & qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing varf , psl_gwd_z0m_factor, & ! in : small scale oro std pblhx , iz0tlnd , itime ,psi_opt ,& - prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing + prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing ep_1 , ep_2 , epsm1 , cp , & ! in : constants albold , sneqvo , & ! in/out : @@ -437,7 +437,7 @@ subroutine noahmp_sflx (parameters, & cm , ch , tauss , & ! in/out : grain , gdd , pgs , & ! in/out smcwtd ,deeprech , rech , ustarx , & ! in/out : - z0wrf , z0hwrf , ts , & ! out : + z0wrf , z0hwrf , ts , & ! out : fsa , fsr , fira , fsh , ssoil , fcev , & ! out : fgev , fctr , ecan , etran , edir , trad , & ! out : tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out : @@ -446,9 +446,9 @@ subroutine noahmp_sflx (parameters, & qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out : albd , albi , albsnd , albsni , & ! out : bgap , wgap , chv , chb , emissi , & ! out : - shg , shc , shb , evg , evb , ghv , & ! out : - ghb , irg , irc , irb , tr , evc , & ! out : - chleaf , chuc , chv2 , chb2 , fpice , pahv , & + shg , shc , shb , evg , evb , ghv , & ! out : + ghb , irg , irc , irb , tr , evc , & ! out : + chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & laisha , rb , qsfcveg , qsfcbare & #ifdef CCPP From 7e59eba2835711f7046e0b7528dc846bd875f754 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 20 May 2024 10:40:13 -0600 Subject: [PATCH 231/249] Bug fixes in NoahMP LSM and Noah LSM: rca is an optional argument --- physics/SFC_Models/Land/Noah/lsm_noah.f | 5 ++--- physics/SFC_Models/Land/Noah/lsm_noah.meta | 1 + physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 2 +- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.f b/physics/SFC_Models/Land/Noah/lsm_noah.f index 6ac87fb76..139c978a0 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.f +++ b/physics/SFC_Models/Land/Noah/lsm_noah.f @@ -284,10 +284,9 @@ subroutine lsm_noah_run & ! --- output: 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, & - & rca + & evbs, evcw, sbsno, snowc, stm, snohf, smcwlt2, smcref2 real (kind=kind_phys), dimension(:), intent(inout), optional :: & - & wet1, lai + & wet1, lai, rca character(len=*), intent(out) :: errmsg integer, intent(out) :: errflg diff --git a/physics/SFC_Models/Land/Noah/lsm_noah.meta b/physics/SFC_Models/Land/Noah/lsm_noah.meta index 0a58312c8..f26b075d9 100644 --- a/physics/SFC_Models/Land/Noah/lsm_noah.meta +++ b/physics/SFC_Models/Land/Noah/lsm_noah.meta @@ -768,6 +768,7 @@ type = real kind = kind_phys intent = inout + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 1ee773b90..6234f46d9 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -400,7 +400,7 @@ subroutine noahmpdrv_run & 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 - real(kind=kind_phys), dimension(:) , intent(out) :: rca ! total canopy/stomatal resistance (s/m) + real(kind=kind_phys), dimension(:) , intent(out), optional :: rca ! total canopy/stomatal resistance (s/m) character(len=*) , intent(out) :: errmsg integer , intent(out) :: errflg diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 20f8b9069..753550016 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -1410,6 +1410,7 @@ type = real kind = kind_phys intent = out + optional = True [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From e142700c7f015d1bd4e52ffb26b41cc8a538fe1b Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Wed, 22 May 2024 09:18:05 -0400 Subject: [PATCH 232/249] update files noahmpdrv.F90 noahmpdrv.meta module_sf_noahmplsm.F90 --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 93 +++++++++---------- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 29 ++---- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 19 +--- 3 files changed, 53 insertions(+), 88 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 8086831e9..9e9dfed91 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -423,9 +423,9 @@ subroutine noahmp_sflx (parameters, & smceq , & ! in : vegetation/soil characteristics sfctmp , sfcprs , psfc , uu , vv , q2, garea1 , & ! in : forcing qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing - varf , psl_gwd_z0m_factor, & ! in : small scale oro std + varf , gwd_z0m_factor, & ! in : turbulent orographic form drag pblhx , iz0tlnd , itime ,psi_opt ,& - prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing + prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing ep_1 , ep_2 , epsm1 , cp , & ! in : constants albold , sneqvo , & ! in/out : @@ -437,7 +437,7 @@ subroutine noahmp_sflx (parameters, & cm , ch , tauss , & ! in/out : grain , gdd , pgs , & ! in/out smcwtd ,deeprech , rech , ustarx , & ! in/out : - z0wrf , z0hwrf , ts , & ! out : + z0wrf , z0hwrf , ts , & ! out : fsa , fsr , fira , fsh , ssoil , fcev , & ! out : fgev , fctr , ecan , etran , edir , trad , & ! out : tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out : @@ -446,9 +446,9 @@ subroutine noahmp_sflx (parameters, & qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out : albd , albi , albsnd , albsni , & ! out : bgap , wgap , chv , chb , emissi , & ! out : - shg , shc , shb , evg , evb , ghv , & ! out : - ghb , irg , irc , irb , tr , evc , & ! out : - chleaf , chuc , chv2 , chb2 , fpice , pahv , & + shg , shc , shb , evg , evb , ghv , & ! out : + ghb , irg , irc , irb , tr , evc , & ! out : + chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & laisha , rb , qsfcveg , qsfcbare & #ifdef CCPP @@ -494,8 +494,8 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(in) :: prslk1x !< in exner function real (kind=kind_phys) , intent(in) :: garea1 !< in exner function - real (kind=kind_phys) , intent(in) :: varf !< small scale oro std - real (kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor ! + real (kind=kind_phys) , intent(in) :: varf !< sub-grid orography standard deviation [m] + real (kind=kind_phys) , intent(in) :: gwd_z0m_factor ! turbulent orographic form drag roughness length factor real (kind=kind_phys) , intent(in) :: pblhx !< pbl height integer , intent(in) :: iz0tlnd !< z0t option integer , intent(in) :: itime !< @@ -835,7 +835,7 @@ subroutine noahmp_sflx (parameters, & fveg ,shdfac, pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , & !in thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in - varf,psl_gwd_z0m_factor , & !in + varf ,gwd_z0m_factor , & !in pblhx ,iz0tlnd, itime ,psi_opt, ep_1, ep_2, epsm1,cp, & z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out @@ -1680,7 +1680,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in fveg ,shdfac, pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in - varf,psl_gwd_z0m_factor , & !in + varf,gwd_z0m_factor , & !in pblhx , iz0tlnd, itime,psi_opt,ep_1, ep_2, epsm1, cp, & z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out @@ -1762,8 +1762,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(in) :: prslk1x !< in exner function real (kind=kind_phys) , intent(in) :: garea1 !< - real (kind=kind_phys) , intent(in) :: varf - real (kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor + real (kind=kind_phys) , intent(in) :: varf !< sub-grid orography standard deviation [m] + real (kind=kind_phys) , intent(in) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys) , intent(in) :: pblhx !< pbl height real (kind=kind_phys) , intent(in) :: ep_1 !< real (kind=kind_phys) , intent(in) :: ep_2 !< @@ -2020,8 +2020,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in chuc = 0. chv2 = 0. rb = 0. - laisun = 0. - laisha = 0. cdmnv = 0.0 ezpdv = 0.0 @@ -2259,7 +2257,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in - varf , psl_gwd_z0m_factor, & !in + varf , gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & eah ,tah ,tv ,tgv ,cmv, ustarx , & !inout #ifdef CCPP @@ -2273,8 +2271,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in csigmaf1, & !out !jref:start qc ,qsfc ,psfc , & !in - q2v ,chv2 ,chleaf ,chuc , & - rb) !out + q2v ,chv2, chleaf, chuc) !inout ! new coupling code @@ -2298,7 +2295,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in emg ,stc ,df ,rsurf ,latheag , & !in gammag ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in - varf ,psl_gwd_z0m_factor, & !in + varf ,gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & #ifdef CCPP tgb ,cmb ,chb, ustarx,errmsg ,errflg , & !inout @@ -3712,7 +3709,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in - varf ,psl_gwd_z0m_factor, & !in + varf ,gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & eah ,tah ,tv ,tg ,cm,ustarx,& !inout #ifdef CCPP @@ -3725,8 +3722,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & t2mv ,psnsun ,psnsha ,canhs , & !out csigmaf1, & !out qc ,qsfc ,psfc , & !in - q2v ,cah2 ,chleaf ,chuc , & !inout - rb) !out + q2v ,cah2 ,chleaf ,chuc ) !inout ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve for vegetation (tv) and @@ -3763,8 +3759,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(in) :: dt !< time step (s) real (kind=kind_phys), intent(in) :: fsno !< snow fraction - real (kind=kind_phys) , intent(in) :: varf ! - real (kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor ! + real (kind=kind_phys) , intent(in) :: varf !< sub-grid orography standard deviation [m] + real (kind=kind_phys) , intent(in) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys) , intent(in) :: pblhx !< pbl height real (kind=kind_phys) , intent(in) :: ep_1 !< real (kind=kind_phys) , intent(in) :: ep_2 !< @@ -3852,7 +3848,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: chuc !< under canopy exchange coefficient real (kind=kind_phys), intent(out) :: canhs !< canopy heat storage change (w/m2) real (kind=kind_phys), intent(out) :: q2v !< - real (kind=kind_phys), intent(out) :: rb !< bulk leaf boundary layer resistance (s/m) real (kind=kind_phys) :: cah !< sensible heat conductance, canopy air to zlvl air (m/s) real (kind=kind_phys) :: u10v !< 10 m wind speed in eastward dir (m/s) real (kind=kind_phys) :: v10v !< 10 m wind speed in eastward dir (m/s) @@ -3869,6 +3864,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: z0mo !roughness length for intermediate output only (m) real (kind=kind_phys) :: z0h !roughness length, sensible heat (m) real (kind=kind_phys) :: z0hg !roughness length, sensible heat (m) + real (kind=kind_phys) :: rb !bulk leaf boundary layer resistance (s/m) real (kind=kind_phys) :: ramc !aerodynamic resistance for momentum (s/m) real (kind=kind_phys) :: rahc !aerodynamic resistance for sensible heat (s/m) real (kind=kind_phys) :: rawc !aerodynamic resistance for water vapor (s/m) @@ -4137,7 +4133,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tah ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h, zpd ,snowh ,shdfac ,garea1 , & !in - varf,psl_gwd_z0m_factor, & !in + varf,gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -4447,7 +4443,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & emg ,stc ,df ,rsurf ,lathea , & !in gamma ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in - varf,psl_gwd_z0m_factor, & !in + varf,gwd_z0m_factor, & !in pblhx , iz0tlnd , itime ,psi_opt,ep_1,ep_2,epsm1,cp ,& #ifdef CCPP tgb ,cm ,ch,ustarx,errmsg ,errflg , & !inout @@ -4502,8 +4498,8 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(in) :: rhsur !< raltive humidity in surface soil/snow air space (-) real (kind=kind_phys), intent(in) :: fsno !< snow fraction - real (kind=kind_phys), intent(in) :: varf ! - real (kind=kind_phys), intent(in) :: psl_gwd_z0m_factor ! + real (kind=kind_phys), intent(in) :: varf !< sub-grid orography standard deviation [m] + real (kind=kind_phys), intent(in) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys), intent(in) :: pblhx !< pbl height (m) real (kind=kind_phys), intent(in) :: ep_1 !< real (kind=kind_phys), intent(in) :: ep_2 !< @@ -4747,7 +4743,7 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h, zpd,snowh ,shdfac ,garea1 , & !in - varf,psl_gwd_z0m_factor, & !in + varf,gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -5454,7 +5450,7 @@ end subroutine sfcdif2 subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h,zpd ,snowh ,fveg ,garea1 , & !in - varf,psl_gwd_z0m_factor, & !in + varf,gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -5484,8 +5480,8 @@ subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur real (kind=kind_phys), intent(in ) :: snowh !< snow depth [m] real (kind=kind_phys), intent(in ) :: fveg !< fractional vegetation cover real (kind=kind_phys), intent(in ) :: garea1 !< grid area [km2] - real (kind=kind_phys), intent(in ) :: varf ! standard deviation org [m] - real (kind=kind_phys), intent(in ) :: psl_gwd_z0m_factor ! z0m factor in psl tofd + real (kind=kind_phys), intent(in ) :: varf !< sub-grid orography standard deviation [m] + real (kind=kind_phys), intent(in ) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys), intent(inout) :: ustarx !< friction velocity [m/s] real (kind=kind_phys), intent(inout) :: fm !< momentum stability correction, weighted by prior iters real (kind=kind_phys), intent(inout) :: fh !< sen heat stability correction, weighted by prior iters @@ -5540,7 +5536,7 @@ subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur endif call gfs_stability (zlvlb, zvfun1, gdx, tv1, thv1, ur, z0m, z0h, tvs, grav, thsfc_loc, & - varf,psl_gwd_z0m_factor,rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv) + varf,gwd_z0m_factor,rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv) end subroutine sfcdif3 @@ -5550,7 +5546,7 @@ subroutine gfs_stability & ! --- inputs: ( z1, zvfun, gdx, tv1, thv1, wind, z0max, ztmax, tvs, grav, & thsfc_loc, & - varf,psl_gwd_z0m_factor, & + varf,gwd_z0m_factor, & ! --- outputs: rb, fm, fh, fm10, fh2, cm, ch, stress, ustar) @@ -5570,8 +5566,8 @@ subroutine gfs_stability & real(kind=kind_phys), intent(in) :: ztmax ! thermal roughness length real(kind=kind_phys), intent(in) :: tvs ! surface virtual temperature real(kind=kind_phys), intent(in) :: grav ! local gravity -real(kind=kind_phys), intent(in) :: varf ! turbulent scale oro std -real(kind=kind_phys), intent(in) :: psl_gwd_z0m_factor ! tofd factor +real(kind=kind_phys), intent(in) :: varf ! turbulent orographic standard deviation [m] +real(kind=kind_phys), intent(in) :: gwd_z0m_factor ! turbulent orographic form drag roughness length factor logical, intent(in) :: thsfc_loc ! use local theta reference flag real(kind=kind_phys), intent(out) :: rb ! bulk richardson number [-] @@ -5630,11 +5626,10 @@ subroutine gfs_stability & real(kind=kind_phys) :: zolmax real(kind=kind_phys) xkzo -! tofd - real(kind=kind_phys) :: cf, zf, fri, fphim - real(kind=kind_phys), parameter :: varf_min = 50.0 - real(kind=kind_phys), parameter :: varf_max = 500.0 -!!! real(kind=kind_phys), parameter :: psl_gwd_z0m_factor = 0.003 +! +real(kind=kind_phys) :: cf, zf, fri, fphim +real(kind=kind_phys), parameter :: varf_min = 50.0 +real(kind=kind_phys), parameter :: varf_max = 500.0 z1i = one / z1 ! inverse of model height @@ -5755,13 +5750,15 @@ subroutine gfs_stability & endif ! end of if (dtv >= 0 ) then loop ! -! form drag coefficient +! compute the effect of orographic form drag : koo et al. (2018,jgr, eqs. 1 and 2) ! - if ( varf.gt.varf_min .and. psl_gwd_z0m_factor.gt.0.0 ) then - zf = min( min(varf,varf_max)*psl_gwd_z0m_factor,z1 ) - fri = min( max( 1.-rb,0. ), 1.) - fphim = log( ( z1 + zf) / zf ) - cf = ca*ca / (fphim*fphim) * fri + if ( varf.gt.varf_min .and. gwd_z0m_factor.gt.0.0_kind_phys ) then + tem1 = min(varf, varf_max) + zf = tem1 * gwd_z0m_factor ! effective roughness length + zf = min(zf, z1) + fri = min( max( 1.0_kind_phys-rb,0.0_kind_phys ), 1.0_kind_phys) ! a function of ther bulk Richardson number + fphim = log( ( z1 + zf) / zf ) ! integrated profile function for momentum + cf = ca*ca / (fphim*fphim) * fri ! exchange coefficient for momentum else cf = 0. endif @@ -5777,7 +5774,7 @@ subroutine gfs_stability & tem1 = 0.00001_kind_phys/z1 ! minimum exhange coef (?) cm = max(cm, tem1) ch = max(ch, tem1) - stress = (cm + cf)* wind * wind ! cf for tofd 10.15) or (10.19) in Arya + stress = (cm + cf)* wind * wind ustar = sqrt(stress) ! friction velocity return diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 90cc14a8d..93f8719b9 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -137,7 +137,7 @@ subroutine noahmpdrv_run & rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, rhonewsn1,& con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, & con_fvirt, con_rd, con_hfus, thsfc_loc, cpllnd, cpllnd2atm,& - nmtvr,mntvar,psl_gwd_z0m_factor, & + mntvar,gwd_z0m_factor, & ! --- in/outs: weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & @@ -158,7 +158,7 @@ subroutine noahmpdrv_run & sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc,& stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, & - ztmax, rca, errmsg, errflg, & + ztmax, errmsg, errflg, & canopy_heat_storage_ccpp, & rainfall_ccpp, & sw_absorbed_total_ccpp, & @@ -288,7 +288,6 @@ subroutine noahmpdrv_run & integer , intent(in) :: iopt_stc ! option for snow/soil temperature time scheme (only layer 1) integer , intent(in) :: iopt_trs ! option for thermal roughness scheme integer , intent(in) :: iopt_diag ! option for surface diagnose approach - integer , intent(in) :: nmtvr ! number of subgrid scale oroghic data real(kind=kind_phys), dimension(:) , intent(in) :: xlatin ! latitude real(kind=kind_phys), dimension(:) , intent(in) :: xcoszin ! cosine of zenith angle integer , intent(in) :: iyrlen ! year length [days] @@ -300,7 +299,7 @@ subroutine noahmpdrv_run & 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) :: mntvar ! subgrid orographic statistics data - real(kind=kind_phys) , intent(in) :: psl_gwd_z0m_factor ! psl tofd zom factor + real(kind=kind_phys) , intent(in) :: gwd_z0m_factor ! turbulent orographic form drag roughness length factor 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] @@ -404,8 +403,6 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: q2mp ! combined q2m from tiles real(kind=kind_phys), dimension(:) , intent(out) :: zvfun ! real(kind=kind_phys), dimension(:) , intent(out) :: ztmax ! thermal roughness length - real(kind=kind_phys), dimension(:) , intent(out) :: rca ! total canopy/stomatal resistance (s/m) - character(len=*) , intent(out) :: errmsg integer , intent(out) :: errflg @@ -639,7 +636,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: cq2 real (kind=kind_phys) :: qfx real (kind=kind_phys) :: wspd1 ! wind speed with all components - real (kind=kind_phys) :: varf_grid ! std deviation orography + real (kind=kind_phys) :: varf_grid ! sub-grid orography standard deviation real (kind=kind_phys) :: pblhx ! height of pbl integer :: mnice @@ -956,10 +953,6 @@ subroutine noahmpdrv_run & ch_vegetated = 0.0 ch_bare_ground = ch_noahmp canopy_heat_storage = 0.0 - lai_sunlit = 0.0 - lai_shaded = 0.0 - rs_sunlit = 0.0 - rs_shaded = 0.0 else ! not glacier @@ -977,7 +970,7 @@ subroutine noahmpdrv_run & spec_humidity_forcing ,area_grid ,cloud_water_forcing , & sw_radiation_forcing ,radiation_lw_forcing ,thsfc_loc , & prslkix ,prsik1x ,prslk1x , & - varf_grid,psl_gwd_z0m_factor , & + varf_grid,gwd_z0m_factor , & pblhx ,iz0tlnd ,itime , & psi_opt , & precip_convective , & @@ -1070,16 +1063,6 @@ subroutine noahmpdrv_run & zorl (i) = z0_total * 100.0 ! convert to cm ztmax (i) = z0h_total - !LAI-scale canopy resistance based on weighted sunlit shaded fraction - if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. & - lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then - rca(i) = parameters%rsmax - else !calculate LAI-scale canopy conductance (1/Rs) - rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit) + & - ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded)) - rca(i) = max((1.0/rca(i)),parameters%rsmin) !resistance - end if - smc (i,:) = soil_moisture_vol slc (i,:) = soil_liquid_vol snowxy (i) = float(snow_levels) @@ -1222,7 +1205,7 @@ subroutine noahmpdrv_run & call gfs_stability & (zf(i), zvfun(i), gdx, virtual_temperature, vptemp,wind(i), z0_total, z0h_total, & tvs1, con_g, thsfc_loc, & - varf_grid, psl_gwd_z0m_factor, & + varf_grid, gwd_z0m_factor, & rb1(i), fm1(i), fh1(i), fm101(i), fh21(i), cm(i), ch(i), stress1(i), ustar1(i)) rmol1(i) = undefined !not used in GFS sfcdif -> to satsify output diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 3e24624fa..f6b57f406 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -649,13 +649,6 @@ dimensions = () type = logical intent = in -[nmtvr] - standard_name = number_of_statistical_measures_of_subgrid_orography - long_name = number of statistical measures of subgrid height_above_mean_sea_level - units = count - dimensions = () - type = integer - intent = in [mntvar] standard_name = statistical_measures_of_subgrid_orography_collection_array long_name = array of statistical measures of subgrid height_above_mean_sea_level @@ -664,9 +657,9 @@ type = real kind = kind_phys intent = in -[psl_gwd_z0m_factor] +[gwd_z0m_factor] standard_name = momentum_roughness_factor_in_turbulent_form_drag - long_name = multiplication of Z0m in PSL turbulent form drag + long_name = multiplication of orograhic standard deviation units = count dimensions = () type = real @@ -1383,14 +1376,6 @@ type = real kind = kind_phys intent = out -[rca] - standard_name = aerodynamic_resistance_in_canopy - long_name = canopy resistance - units = s m-1 - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out [errmsg] standard_name = ccpp_error_message long_name = error message for error handling in CCPP From 31bca4e8fc5c41c01597a6d91d3718d72b581116 Mon Sep 17 00:00:00 2001 From: "helin.wei" Date: Wed, 22 May 2024 17:45:46 +0000 Subject: [PATCH 233/249] test 6-9 --- .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 | 18 +++++++++++++++++- .../Land/Noahmp/module_sf_noahmplsm.F90 | 11 ++++++----- 2 files changed, 23 insertions(+), 6 deletions(-) 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 f53ab3928..6c810c622 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 @@ -593,8 +593,24 @@ subroutine GFS_phys_time_vary_init ( isnow = nint(snowxy(ix))+1 ! snowxy <=0.0, dzsno >= 0.0 +! using stc and tgxy to linearly interpolate the snow temp for each layer +!Calculate the total thickness +! total_thickness = sum(dzsno) +! Calculate the temperature difference +! temp_diff=tgxy(ix)-stc(ix,1) +! Calculate the mid-points and interpolate temperatures for each layer +! accumulated_thickness = 0.0 +! do is = isnow, 0 +! accumulated_thickness = accumulated_thickness + dzsno(is) +! mid_points(is) = accumulated_thickness - dzsno(is) / 2.0 +! layer_temp = tgxy(ix) + (mid_points(is) / total_thickness) * temp_diff +! tsnoxy(ix,is) = layer_temp +! end do + do is = isnow,0 - tsnoxy(ix,is) = tgxy(ix) +! tsnoxy(ix,is) = tgxy(ix) +! tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(tgxy(ix)-stc(ix,1)) + tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(stc(ix,1)-tgxy(ix)) snliqxy(ix,is) = zero snicexy(ix,is) = one * dzsno(is) * weasd(ix)/snd enddo diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index e519e472c..3451f807e 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -1989,7 +1989,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys), parameter :: mpe = 1.e-6 real (kind=kind_phys), parameter :: psiwlt = -150. !metric potential for wilting point (m) - real (kind=kind_phys), parameter :: z0 = 0.002 ! bare-soil roughness length (m) (i.e., under the canopy) + real (kind=kind_phys), parameter :: z0 = 0.015 ! bare-soil roughness length (m) (i.e., under the canopy) ! --------------------------------------------------------------------------------------------------- ! initialize fluxes from veg. fraction @@ -2626,10 +2626,10 @@ subroutine csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso ! thermal conductivity of snow do iz = isnow+1, 0 -! tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) + tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) ! tksno(iz) = 2e-2+2.5e-6*bdsnoi(iz)*bdsnoi(iz) ! anderson, 1976 ! tksno(iz) = 0.35 ! constant - tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074 ! verseghy (1991) +! tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074 ! verseghy (1991) ! tksno(iz) = 2.22*(bdsnoi(iz)/1000.)**1.88 ! douvill(yen, 1981) enddo @@ -5817,7 +5817,8 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, if (opt_trs == z0heqz0m) then - z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg)) +! z0m_out = exp(fveg * log(z0m) + (1.0 - fveg) * log(z0mg)) + z0m_out = fveg * z0m + (1.0 - fveg) * z0mg z0h_out = z0m_out elseif (opt_trs == chen09) then @@ -5834,7 +5835,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, endif z0h_out = exp( fveg * log(z0m * exp(-czil*0.4*258.2*sqrt(ustarx*z0m))) + & - (1.0 - fveg) * log(max(z0m/exp(kb_sigma_f0),1.0e-6)) ) + (1.0 - fveg) * log(max(z0mg/exp(kb_sigma_f0),1.0e-6)) ) elseif (opt_trs == tessel) then From 1eb7f7c5dcb9ef0c7a8c9f68fb7be5bfb0e61ff5 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Thu, 23 May 2024 08:58:55 -0400 Subject: [PATCH 234/249] update files module_sf_noahmplsm.F90 noahmpdrv.F90 noahmpdrv.meta module_sf_noahmp_glacier.F90 --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 142 +++++++++--------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 9e9dfed91..8ac3b21d7 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -90,7 +90,7 @@ module module_sf_noahmplsm integer :: opt_crs !< options for canopy stomatal resistance ! **1 -> ball-berry - ! 2 -> jarvis + ! 2 -> jarvis integer :: opt_btr !< options for soil moisture factor for stomatal resistance ! **1 -> noah (soil moisture) @@ -103,16 +103,16 @@ module module_sf_noahmplsm ! 3 -> original surface and subsurface runoff (free drainage) ! 4 -> bats surface and subsurface runoff (free drainage) ! 5 -> miguez-macho&fan groundwater scheme (miguez-macho et al. 2007 jgr; fan et al. 2007 jgr) - ! (needs further testing for public use) + ! (needs further testing for public use) integer :: opt_sfc !< options for surface layer drag coeff (ch & cm) ! **1 -> m-o - ! **2 -> original noah (chen97) - ! **3 -> myj consistent; 4->ysu consistent. mb: removed in v3.7 for further testing + ! **2 -> original noah (chen97) + ! **3 -> myj consistent; 4->ysu consistent. mb: removed in v3.7 for further testing integer :: opt_frz !< options for supercooled liquid water (or ice fraction) ! **1 -> no iteration (niu and yang, 2006 jhm) - ! 2 -> koren's iteration + ! 2 -> koren's iteration integer :: opt_inf !< options for frozen soil permeability ! **1 -> linear effects, more permeable (niu and yang, 2006, jhm) @@ -125,13 +125,13 @@ module module_sf_noahmplsm integer :: opt_alb !< options for ground snow surface albedo ! 1 -> bats - ! **2 -> class + ! **2 -> class integer :: opt_snf !< options for partitioning precipitation into rainfall & snowfall ! **1 -> jordan (1991) - ! 2 -> bats: when sfctmp sfctmp < tfrz - ! 4 -> use wrf microphysics output + ! 2 -> bats: when sfctmp sfctmp < tfrz + ! 4 -> use wrf microphysics output integer :: opt_tbot !< options for lower boundary condition of soil temperature ! 1 -> zero heat flux from bottom (zbot and tbot not used) @@ -139,20 +139,20 @@ module module_sf_noahmplsm integer :: opt_stc !< options for snow/soil temperature time scheme (only layer 1) ! **1 -> semi-implicit; flux top boundary condition - ! 2 -> full implicit (original noah); temperature top boundary condition + ! 2 -> full implicit (original noah); temperature top boundary condition ! 3 -> same as 1, but fsno for ts calculation (generally improves snow; v3.7) integer :: opt_rsf !< options for surface resistent to evaporation/sublimation ! **1 -> sakaguchi and zeng, 2009 - ! 2 -> sellers (1992) + ! 2 -> sellers (1992) ! 3 -> adjusted sellers to decrease rsurf for wet soil - ! 4 -> option 1 for non-snow; rsurf = rsurf_snow for snow (set in mptable); ad v3.8 + ! 4 -> option 1 for non-snow; rsurf = rsurf_snow for snow (set in mptable); ad v3.8 integer :: opt_soil !< options for defining soil properties ! **1 -> use input dominant soil texture - ! 2 -> use input soil texture that varies with depth + ! 2 -> use input soil texture that varies with depth ! 3 -> use soil composition (sand, clay, orgm) and pedotransfer functions (opt_pedo) - ! 4 -> use input soil properties (bexp_3d, smcmax_3d, etc.) + ! 4 -> use input soil properties (bexp_3d, smcmax_3d, etc.) integer :: opt_pedo !< options for pedotransfer functions (used when opt_soil = 3) ! **1 -> saxton and rawls (2006) @@ -425,7 +425,7 @@ subroutine noahmp_sflx (parameters, & qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing varf , gwd_z0m_factor, & ! in : turbulent orographic form drag pblhx , iz0tlnd , itime ,psi_opt ,& - prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing + prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing ep_1 , ep_2 , epsm1 , cp , & ! in : constants albold , sneqvo , & ! in/out : @@ -437,7 +437,7 @@ subroutine noahmp_sflx (parameters, & cm , ch , tauss , & ! in/out : grain , gdd , pgs , & ! in/out smcwtd ,deeprech , rech , ustarx , & ! in/out : - z0wrf , z0hwrf , ts , & ! out : + z0wrf , z0hwrf , ts , & ! out : fsa , fsr , fira , fsh , ssoil , fcev , & ! out : fgev , fctr , ecan , etran , edir , trad , & ! out : tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out : @@ -446,9 +446,9 @@ subroutine noahmp_sflx (parameters, & qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out : albd , albi , albsnd , albsni , & ! out : bgap , wgap , chv , chb , emissi , & ! out : - shg , shc , shb , evg , evb , ghv , & ! out : - ghb , irg , irc , irb , tr , evc , & ! out : - chleaf , chuc , chv2 , chb2 , fpice , pahv , & + shg , shc , shb , evg , evb , ghv , & ! out : + ghb , irg , irc , irb , tr , evc , & ! out : + chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & laisha , rb , qsfcveg , qsfcbare & #ifdef CCPP @@ -822,7 +822,7 @@ subroutine noahmp_sflx (parameters, & canliq ,canice ,tv ,sfctmp ,tg , & !in qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , & !out pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out - fwet ,cmc ) !out + fwet ,cmc ) !out ! compute energy budget (momentum & energy fluxes and phase changes) @@ -837,7 +837,7 @@ subroutine noahmp_sflx (parameters, & thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in varf ,gwd_z0m_factor , & !in pblhx ,iz0tlnd, itime ,psi_opt, ep_1, ep_2, epsm1,cp, & - z0wrf ,z0hwrf , & !out + z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out @@ -858,7 +858,7 @@ subroutine noahmp_sflx (parameters, & fsrg ,rssun ,rssha ,albd ,albi ,albsnd,albsni, bgap ,wgap, tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb , & !out emissi ,pah ,canhs, & - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out qsfcveg = eah*ep_2/(sfcprs + epsm1*eah) qsfcbare = qsfc @@ -881,7 +881,7 @@ subroutine noahmp_sflx (parameters, & esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in ficeold,ponding,tg ,ist ,fveg ,iloc,jloc , smceq , & !in bdfall ,fp ,rain ,snow , & !in mb/an: v3.7 - qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb + qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout @@ -915,9 +915,9 @@ subroutine noahmp_sflx (parameters, & if (opt_crop == 1 .and. crop_active) then call carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , & !in dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in - soldn ,t2m , & !in + soldn ,t2m , & !in lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout - lai ,sai ,gdd , & !inout + lai ,sai ,gdd , & !inout gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs ) !out end if @@ -968,7 +968,7 @@ subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , & prcpconv,prcpnonc ,prcpshcv,prcpsnow,prcpgrpl,prcphail , & soldn ,cosz ,thair ,qair , & eair ,rhoair ,qprecc ,qprecl ,solad , solai , & - swdown ,bdfall ,rain ,snow ,fp , fpice ,prcp ) + swdown ,bdfall ,rain ,snow ,fp , fpice ,prcp ) ! -------------------------------------------------------------------------------------------------- ! re-process atmospheric forcing ! ---------------------------------------------------------------------- @@ -1041,7 +1041,7 @@ subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , & if(opt_snf == 4) then qprecc = prcpconv + prcpshcv - qprecl = prcpnonc + qprecl = prcpnonc else qprecc = 0.10 * prcp ! should be from the atmospheric model qprecl = 0.90 * prcp ! should be from the atmospheric model @@ -1094,15 +1094,15 @@ subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , & if(opt_snf == 4 .or. opt_snf == 5) then prcp_frozen = prcpsnow + prcpgrpl + prcphail if(prcpnonc > 0. .and. prcp_frozen > 0.) then - fpice = min(1.0,prcp_frozen/prcpnonc) - fpice = max(0.0,fpice) + fpice = min(1.0,prcp_frozen/prcpnonc) + fpice = max(0.0,fpice) if(opt_snf==4) bdfall = bdfall*(prcpsnow/prcp_frozen) + rho_grpl*(prcpgrpl/prcp_frozen) + & rho_hail*(prcphail/prcp_frozen) if(opt_snf==5) bdfall = parameters%prcpiceden - else - fpice = 0.0 + else + fpice = 0.0 endif - + endif rain = prcp * (1.-fpice) @@ -1237,8 +1237,8 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv bdfall ,rain ,snow ,fp , & !in canliq ,canice ,tv ,sfctmp ,tg , & !in qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , & !out - pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out - fwet ,cmc ) !out + pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out + fwet ,cmc ) !out ! ------------------------ code history ------------------------------ ! michael barlage: oct 2013 - split canwater to calculate precip movement for @@ -1340,10 +1340,10 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv qintr = 0. qdripr = 0. qthror = rain - if(canliq > 0.) then ! for case of canopy getting buried - qdripr = qdripr + canliq/dt - canliq = 0.0 - end if + if(canliq > 0.) then ! for case of canopy getting buried + qdripr = qdripr + canliq/dt + canliq = 0.0 + end if end if ! heat transported by liquid water @@ -1366,8 +1366,8 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv qints = max(qints, 0.) ft = max(0.0,(tv - 270.15) / 1.87e5) fv = sqrt(uu*uu + vv*vv) / 1.56e5 - ! mb: changed below to reflect the rain assumption that all precip gets intercepted - icedrip = max(0.,canice) * (fv+ft) !mb: removed /dt +! mb: changed below to reflect the rain assumption that all precip gets intercepted + icedrip = max(0.,canice) * (fv+ft) !mb: removed /dt qdrips = (fveg * snow - qints) + icedrip qthros = (1.0-fveg) * snow canice= max(0.,canice + (qints - icedrip)*dt) @@ -1375,10 +1375,10 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv qints = 0. qdrips = 0. qthros = snow - if(canice > 0.) then ! for case of canopy getting buried - qdrips = qdrips + canice/dt - canice = 0.0 - end if + if(canice > 0.) then ! for case of canopy getting buried + qdrips = qdrips + canice/dt + canice = 0.0 + end if endif ! print*, "precip_heat canopy through:",3600.0*(fveg * snow - qints) ! print*, "precip_heat canopy drip:",3600.0*max(0.,canice) * (fv+ft) @@ -1408,13 +1408,13 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv if (fveg > 0.0 .and. fveg < 1.0) then pahg = pahg / fveg ! these will be multiplied by fraction later - pahb = pahb / (1.0-fveg) + pahb = pahb / (1.0-fveg) elseif (fveg <= 0.0) then pahb = pahg + pahb ! for case of canopy getting buried pahg = 0.0 - pahv = 0.0 + pahv = 0.0 elseif (fveg >= 1.0) then - pahb = 0.0 + pahb = 0.0 end if pahv = max(pahv,-20.0) ! put some artificial limits here for stability @@ -1680,9 +1680,9 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in fveg ,shdfac, pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in - varf,gwd_z0m_factor , & !in + varf ,gwd_z0m_factor , & !in pblhx , iz0tlnd, itime,psi_opt,ep_1, ep_2, epsm1, cp, & - z0wrf ,z0hwrf , & !out + z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out @@ -1702,7 +1702,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in t2mv ,t2mb ,fsrv , & fsrg ,rssun ,rssha ,albd ,albi,albsnd ,albsni,bgap ,wgap,tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb, emissi,pah,canhs,& - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out !jref:end ! -------------------------------------------------------------------------------------------------- @@ -2216,19 +2216,19 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in if (tv .gt. tfrz) then ! barlage: add distinction between ground and latheav = hvap ! vegetation in v3.6 - frozen_canopy = .false. + frozen_canopy = .false. else latheav = hsub - frozen_canopy = .true. + frozen_canopy = .true. end if gammav = cpair*sfcprs/(ep_2*latheav) if (tg .gt. tfrz) then latheag = hvap - frozen_ground = .false. + frozen_ground = .false. else latheag = hsub - frozen_ground = .true. + frozen_ground = .true. end if gammag = cpair*sfcprs/(ep_2*latheag) @@ -2340,7 +2340,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in ssoil = fveg * ghv + (1.0 - fveg) * ghb fcev = evc fctr = tr - pah = fveg * pahg + (1.0 - fveg) * pahb + pahv + pah = fveg * pahg + (1.0 - fveg) * pahb + pahv tg = fveg * tgv + (1.0 - fveg) * tgb t2m = fveg * t2mv + (1.0 - fveg) * t2mb ts = fveg * tah + (1.0 - fveg) * tgb @@ -2370,7 +2370,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in t2m = t2mb fcev = 0. fctr = 0. - pah = pahb + pah = pahb ts = tg cm = cmb ch = chb @@ -3541,7 +3541,7 @@ subroutine twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , & ! kopen = 1.0 else if(opt_rad == 1) then - denfveg = -log(max(1.0-fveg,0.01))/(pai*parameters%rc**2) + denfveg = -log(max(1.0-fveg,0.01))/(pai*parameters%rc**2) hd = parameters%hvt - parameters%hvb bb = 0.5 * hd thetap = atan(bb/parameters%rc * tan(acos(max(0.01,cosz))) ) @@ -4256,11 +4256,11 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & shc = fveg*rhoair*cpair*cvh * ( tv-tah) evc = fveg*rhoair*cpair*cew * (estv-eah) / gammav ! barlage: change to v in v3.6 tr = fveg*rhoair*cpair*ctw * (estv-eah) / gammav - if (tv > tfrz) then + if (tv > tfrz) then evc = min(canliq*latheav/dt,evc) ! barlage: add if block for canice in v3.6 - else + else evc = min(canice*latheav/dt,evc) - end if + end if ! canopy heat capacity hcv = fveg*(parameters%cbiom*vaie*cwat + canliq*cwat/denh2o + canice*cice/denice) !j/m2/k @@ -5450,7 +5450,7 @@ end subroutine sfcdif2 subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h,zpd ,snowh ,fveg ,garea1 , & !in - varf,gwd_z0m_factor, & !in + varf ,gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -7056,7 +7056,7 @@ subroutine water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , & esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in ficeold,ponding,tg ,ist ,fveg ,iloc ,jloc ,smceq , & !in bdfall ,fp ,rain ,snow, & !in mb/an: v3.7 - qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb + qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout @@ -7685,19 +7685,19 @@ subroutine combine (parameters,nsnow ,nsoil ,iloc ,jloc , & !in snice(j-1) = snice(j-1) + snice(j) dzsnso(j-1) = dzsnso(j-1) + dzsnso(j) else - if(snice(j) >= 0.) then + if(snice(j) >= 0.) then ponding1 = snliq(j) ! isnow will get set to zero below; ponding1 will get sneqv = snice(j) ! added to ponding from phasechange ponding should be snowh = dzsnso(j) ! zero here because it was calculated for thin snow - else ! snice over-sublimated earlier - ponding1 = snliq(j) + snice(j) - if(ponding1 < 0.) then ! if snice and snliq sublimates remove from soil - sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.)) + else ! snice over-sublimated earlier + ponding1 = snliq(j) + snice(j) + if(ponding1 < 0.) then ! if snice and snliq sublimates remove from soil + sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.)) ponding1 = 0.0 - end if + end if sneqv = 0.0 snowh = 0.0 - end if + end if snliq(j) = 0.0 snice(j) = 0.0 dzsnso(j) = 0.0 @@ -9786,7 +9786,7 @@ subroutine carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julia dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in soldn ,t2m , & !in lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout - xlai ,xsai ,gdd , & !inout + xlai ,xsai ,gdd , & !inout gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs ) !out ! ------------------------------------------------------------------------------------------ ! initial crop version created by xing liu @@ -10465,7 +10465,7 @@ end subroutine psn_crop !! subroutine noahmp_options(idveg , iopt_crs , iopt_btr , iopt_run , iopt_sfc , iopt_frz , & iopt_inf, iopt_rad , iopt_alb , iopt_snf , iopt_tbot, iopt_stc , & - iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs , iopt_diag, & + iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs , iopt_diag, & iopt_z0m ) implicit none From 2259ee9b7244ba740ba35ac9c52b28238ba89fc7 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Sun, 26 May 2024 11:45:49 -0400 Subject: [PATCH 235/249] fix the compile problem for HR4-GWD-update --- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index e4623b83a..ca2a0db42 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -158,7 +158,7 @@ subroutine noahmpdrv_run & sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc,& stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, & - ztmax, errmsg, errflg, & + ztmax, rca, errmsg, errflg, & canopy_heat_storage_ccpp, & rainfall_ccpp, & sw_absorbed_total_ccpp, & @@ -1064,6 +1064,16 @@ subroutine noahmpdrv_run & zorl (i) = z0_total * 100.0 ! convert to cm ztmax (i) = z0h_total + !LAI-scale canopy resistance based on weighted sunlit shaded fraction + if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. & + lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then + rca(i) = parameters%rsmax + else !calculate LAI-scale canopy conductance (1/Rs) + rca(i) = ((1.0/(rs_sunlit+leaf_air_resistance)*lai_sunlit) + & + ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded)) + rca(i) = max((1.0/rca(i)),parameters%rsmin) !resistance + end if + smc (i,:) = soil_moisture_vol slc (i,:) = soil_liquid_vol snowxy (i) = float(snow_levels) From 622aa411642175b13c330599e62580e7ac5307b1 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Fri, 31 May 2024 13:45:31 -0400 Subject: [PATCH 236/249] update Noahmp code for HR4 --- physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 | 8 +++++--- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 8ac3b21d7..a3b466f46 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -2271,7 +2271,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in csigmaf1, & !out !jref:start qc ,qsfc ,psfc , & !in - q2v ,chv2, chleaf, chuc) !inout + q2v ,chv2 ,chleaf ,chuc , & + rb) !out ! new coupling code @@ -3722,7 +3723,8 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & t2mv ,psnsun ,psnsha ,canhs , & !out csigmaf1, & !out qc ,qsfc ,psfc , & !in - q2v ,cah2 ,chleaf ,chuc ) !inout + q2v ,cah2 ,chleaf ,chuc , & !inout + rb) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve for vegetation (tv) and @@ -3848,6 +3850,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(out) :: chuc !< under canopy exchange coefficient real (kind=kind_phys), intent(out) :: canhs !< canopy heat storage change (w/m2) real (kind=kind_phys), intent(out) :: q2v !< + real (kind=kind_phys), intent(out) :: rb !< bulk leaf boundary layer resistance (s/m) real (kind=kind_phys) :: cah !< sensible heat conductance, canopy air to zlvl air (m/s) real (kind=kind_phys) :: u10v !< 10 m wind speed in eastward dir (m/s) real (kind=kind_phys) :: v10v !< 10 m wind speed in eastward dir (m/s) @@ -3864,7 +3867,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys) :: z0mo !roughness length for intermediate output only (m) real (kind=kind_phys) :: z0h !roughness length, sensible heat (m) real (kind=kind_phys) :: z0hg !roughness length, sensible heat (m) - real (kind=kind_phys) :: rb !bulk leaf boundary layer resistance (s/m) real (kind=kind_phys) :: ramc !aerodynamic resistance for momentum (s/m) real (kind=kind_phys) :: rahc !aerodynamic resistance for sensible heat (s/m) real (kind=kind_phys) :: rawc !aerodynamic resistance for water vapor (s/m) diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index ca2a0db42..4af3b93b6 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -954,6 +954,10 @@ subroutine noahmpdrv_run & ch_vegetated = 0.0 ch_bare_ground = ch_noahmp canopy_heat_storage = 0.0 + lai_sunlit = 0.0 + lai_shaded = 0.0 + rs_sunlit = 0.0 + rs_shaded = 0.0 else ! not glacier From 6b783323e2dd8553cc46ef0ffff1adbae3e095ff Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Fri, 31 May 2024 13:46:14 -0400 Subject: [PATCH 237/249] update GWD code for HR4 --- physics/GWD/drag_suite.F90 | 61 +++++++++++++++++++-------------- physics/GWD/drag_suite.meta | 10 +++++- physics/GWD/ugwpv1_gsldrag.F90 | 13 +++---- physics/GWD/ugwpv1_gsldrag.meta | 10 +++++- physics/GWD/unified_ugwp.F90 | 16 +++++---- physics/GWD/unified_ugwp.meta | 10 +++++- 6 files changed, 78 insertions(+), 42 deletions(-) diff --git a/physics/GWD/drag_suite.F90 b/physics/GWD/drag_suite.F90 index 0445cbeb5..91edfbec8 100644 --- a/physics/GWD/drag_suite.F90 +++ b/physics/GWD/drag_suite.F90 @@ -219,8 +219,8 @@ subroutine drag_suite_run( & & dusfc_ms,dvsfc_ms,dusfc_bl,dvsfc_bl, & & dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, & & slmsk,br1,hpbl, & - & g, cp, rd, rv, fv, pi, imx, cdmbgwd, me, master, & - & lprnt, ipr, rdxzb, dx, gwd_opt, & + & g, cp, rd, rv, fv, pi, imx, cdmbgwd, alpha_fd, & + & me, master, lprnt, ipr, rdxzb, dx, gwd_opt, & & do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & & dtend, dtidx, index_of_process_orographic_gwd, & & index_of_temperature, index_of_x_wind, & @@ -327,18 +327,18 @@ subroutine drag_suite_run( & integer, intent(in) :: gwd_opt 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(in) :: deltim, G, CP, RD, RV, & + & cdmbgwd(:), alpha_fd real(kind=kind_phys), intent(inout), optional :: dtend(:,:,:) logical, intent(in) :: ldiag3d - integer, intent(in) :: dtidx(:,:) - integer, intent(in) :: index_of_temperature, & + integer, intent(in) :: dtidx(:,:), index_of_temperature, & & index_of_process_orographic_gwd, index_of_x_wind, index_of_y_wind integer :: kpblmax integer, parameter :: ims=1, kms=1, its=1, kts=1 real(kind=kind_phys), intent(in) :: fv, pi real(kind=kind_phys) :: rcl, cdmb - real(kind=kind_phys) :: g_inv + real(kind=kind_phys) :: g_inv, rd_inv real(kind=kind_phys), intent(inout) :: & & dudt(:,:),dvdt(:,:), & @@ -444,6 +444,7 @@ subroutine drag_suite_run( & real(kind=kind_phys), dimension(im,km) :: utendform,vtendform real(kind=kind_phys) :: a1,a2,wsp real(kind=kind_phys) :: H_efold + real(kind=kind_phys), parameter :: coeff_fd = 6.325e-3 ! critical richardson number for wave breaking : ! larger drag with larger value real(kind=kind_phys), parameter :: ric = 0.25 @@ -708,11 +709,12 @@ subroutine drag_suite_run( & taufb(1:im,1:km+1) = 0.0 komax(1:im) = 0 ! + rd_inv = 1./rd do k = kts,km do i = its,im vtj(i,k) = t1(i,k) * (1.+fv*q1(i,k)) vtk(i,k) = vtj(i,k) / prslk(i,k) - ro(i,k) = 1./rd * prsl(i,k) / vtj(i,k) ! density kg/m**3 + ro(i,k) = rd_inv * prsl(i,k) / vtj(i,k) ! density kg/m**3 enddo enddo ! @@ -1363,8 +1365,10 @@ subroutine drag_suite_run( & H_efold = 1500. DO k=kts,km wsp=SQRT(uwnd1(i,k)**2 + vwnd1(i,k)**2) - ! alpha*beta*Cmd*Ccorr*2.109 = 12.*1.*0.005*0.6*2.109 = 0.0759 - var_temp = 0.0759*EXP(-(zl(i,k)/H_efold)**1.5)*a2* & + ! Note: In Beljaars et al. (2004): + ! alpha_fd*beta*Cmd*Ccorr*2.109 = 12.*1.*0.005*0.6*2.109 = 0.0759 + ! lump beta*Cmd*Ccorr*2.109 into 1.*0.005*0.6*2.109 = coeff_fd ~ 6.325e-3_kind_phys + var_temp = alpha_fd*coeff_fd*EXP(-(zl(i,k)/H_efold)**1.5)*a2* & zl(i,k)**(-1.2)*ss_taper(i) ! this is greater than zero ! Note: This is a semi-implicit treatment of the time differencing ! per Beljaars et al. (2004, QJRMS) @@ -1427,8 +1431,8 @@ subroutine drag_suite_psl( & & dusfc_ls,dvsfc_ls,dusfc_bl,dvsfc_bl, & & dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, & & slmsk,br1,hpbl,vtype, & - & g, cp, rd, rv, fv, pi, imx, cdmbgwd, me, master, & - & lprnt, ipr, rdxzb, dx, gwd_opt, & + & g, cp, rd, rv, fv, pi, imx, cdmbgwd, alpha_fd, & + & me, master, lprnt, ipr, rdxzb, dx, gwd_opt, & & do_gsl_drag_ls_bl, do_gsl_drag_ss, do_gsl_drag_tofd, & & psl_gwd_dx_factor, & & dtend, dtidx, index_of_process_orographic_gwd, & @@ -1537,7 +1541,8 @@ subroutine drag_suite_psl( & integer, intent(in) :: gwd_opt 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(in) :: deltim, G, CP, RD, RV, & + & cdmbgwd(:), alpha_fd real(kind=kind_phys), intent(inout) :: dtend(:,:,:) logical, intent(in) :: ldiag3d integer, intent(in) :: dtidx(:,:), index_of_temperature, & @@ -1547,7 +1552,7 @@ subroutine drag_suite_psl( & integer, parameter :: ims=1, kms=1, its=1, kts=1 real(kind=kind_phys), intent(in) :: fv, pi real(kind=kind_phys) :: rcl, cdmb - real(kind=kind_phys) :: g_inv + real(kind=kind_phys) :: g_inv, g_cp real(kind=kind_phys), intent(inout) :: & & dudt(:,:),dvdt(:,:), & @@ -1649,6 +1654,7 @@ subroutine drag_suite_psl( & real(kind=kind_phys), dimension(im,km) :: utendform,vtendform real(kind=kind_phys) :: a1,a2,wsp real(kind=kind_phys) :: H_efold + real(kind=kind_phys), parameter :: coeff_fd = 6.325e-3 ! multification factor of standard deviation : ! larger drag with larger value !!! real(kind=kind_phys), parameter :: psl_gwd_dx_factor = 6.0 @@ -1789,18 +1795,18 @@ subroutine drag_suite_psl( & enddo !--- calculate scale-aware tapering factors -do i=1,im - if ( dx(i) .ge. dxmax_ls ) then - ls_taper(i) = 1. - else - if ( dx(i) .le. dxmin_ls) then - ls_taper(i) = 0. + do i=1,im + if ( dx(i) .ge. dxmax_ls ) then + ls_taper(i) = 1. else - ls_taper(i) = 0.5 * ( SIN(pi*(dx(i)-0.5*(dxmax_ls+dxmin_ls))/ & + if ( dx(i) .le. dxmin_ls) then + ls_taper(i) = 0. + else + ls_taper(i) = 0.5 * ( SIN(pi*(dx(i)-0.5*(dxmax_ls+dxmin_ls))/ & (dxmax_ls-dxmin_ls)) + 1. ) + endif endif - endif -enddo + enddo ! Remove ss_tapering ss_taper(:) = 1. @@ -2072,6 +2078,7 @@ subroutine drag_suite_psl( & IF ( (do_gsl_drag_ls_bl).and. & ((gwd_opt_ls .EQ. 1).or.(gwd_opt_bl .EQ. 1)) ) then + g_cp = g/cp do i=its,im if ( ls_taper(i).GT.1.E-02 ) then @@ -2086,7 +2093,7 @@ subroutine drag_suite_psl( & tem2 = v1(i,k) - v1(i,k+1) dw2 = rcl*(tem1*tem1 + tem2*tem2) shr2 = max(dw2,dw2min) * rdz * rdz - bvf2 = g*(g/cp+rdz*(vtj(i,k+1)-vtj(i,k))) * ti + bvf2 = g*(g_cp+rdz*(vtj(i,k+1)-vtj(i,k))) * ti usqj(i,k) = max(bvf2/shr2,rimin) bnv2(i,k) = 2.0*g*rdz*(vtk(i,k+1)-vtk(i,k))/(vtk(i,k+1)+vtk(i,k)) bnv2(i,k) = max( bnv2(i,k), bnv2min ) @@ -2341,8 +2348,10 @@ subroutine drag_suite_psl( & H_efold = 1500. DO k=kts,km wsp=SQRT(u1(i,k)**2 + v1(i,k)**2) - ! alpha*beta*Cmd*Ccorr*2.109 = 12.*1.*0.005*0.6*2.109 = 0.0759 - var_temp = 0.0759*EXP(-(zl(i,k)/H_efold)**1.5)*a2* & + ! Note: In Beljaars et al. (2004): + ! alpha_fd*beta*Cmd*Ccorr*2.109 = 12.*1.*0.005*0.6*2.109 = 0.0759 + ! lump beta*Cmd*Ccorr*2.109 into 1.*0.005*0.6*2.109 = coeff_fd ~ 6.325e-3_kind_phys + var_temp = alpha_fd*coeff_fd*EXP(-(zl(i,k)/H_efold)**1.5)*a2* & zl(i,k)**(-1.2)*ss_taper(i) ! this is greater than zero ! Note: This is a semi-implicit treatment of the time differencing ! per Beljaars et al. (2004, QJRMS) @@ -2465,7 +2474,7 @@ subroutine drag_suite_psl( & do k = km, kpblmin, -1 if(flag(i).and. k.le.kbmax(i)) then pe = pe + bnv2(i,k)*(zl(i,kbmax(i))-zl(i,k))* & - del(i,k)/g/ro(i,k) + del(i,k)*g_inv/ro(i,k) ke = 0.5*((rcs*u1(i,k))**2.+(rcs*v1(i,k))**2.) ! !---------- apply flow-blocking drag when pe >= ke diff --git a/physics/GWD/drag_suite.meta b/physics/GWD/drag_suite.meta index 323d89d36..088387cfd 100644 --- a/physics/GWD/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -528,6 +528,14 @@ type = real kind = kind_phys intent = in +[alpha_fd] + standard_name = alpha_coefficient_for_turbulent_orographic_form_drag + long_name = alpha coefficient for Beljaars et al turbulent orographic form drag + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [me] standard_name = mpi_rank long_name = rank of the current MPI task @@ -603,7 +611,7 @@ [psl_gwd_dx_factor] standard_name = effective_grid_spacing_of_psl_gwd_suite long_name = multiplication of grid spacing - units = count + units = 1 dimensions = () type = real kind = kind_phys diff --git a/physics/GWD/ugwpv1_gsldrag.F90 b/physics/GWD/ugwpv1_gsldrag.F90 index d0eba4ae1..fc90955bd 100644 --- a/physics/GWD/ugwpv1_gsldrag.F90 +++ b/physics/GWD/ugwpv1_gsldrag.F90 @@ -309,7 +309,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, do_gwd_opt_psl, psl_gwd_dx_factor, & do_ugwp_v1, do_ugwp_v1_orog_only, & do_ugwp_v1_w_gsldrag, gwd_opt, do_tofd, ldiag_ugwp, ugwp_seq_update, & - cdmbgwd, jdat, nmtvr, hprime, oc, theta, sigma, gamma, & + cdmbgwd, alpha_fd, jdat, nmtvr, hprime, oc, theta, sigma, gamma, & elvmax, clx, oa4, varss,oc1ss,oa4ss,ol4ss, dx, xlat, xlat_d, sinlat, coslat, & area, rain, br1, hpbl,vtype, kpbl, slmsk, & ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, del, tau_amf, & @@ -375,7 +375,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, ! SSO parameters and variables integer, intent(in) :: gwd_opt !gwd_opt and nmtvr are "redundant" controls integer, intent(in) :: nmtvr - real(kind=kind_phys), intent(in) :: cdmbgwd(:) ! for gsl_drag + real(kind=kind_phys), intent(in) :: cdmbgwd(:), alpha_fd ! for gsl_drag real(kind=kind_phys), intent(in), dimension(:) :: hprime, oc, theta, sigma, gamma @@ -404,8 +404,7 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, integer, intent(in), dimension(:) :: vtype real(kind=kind_phys), intent(in), dimension(:) :: rain - real(kind=kind_phys), intent(in), dimension(:) :: br1, slmsk - real(kind=kind_phys), intent(in), dimension(:) :: hpbl + real(kind=kind_phys), intent(in), dimension(:) :: br1, hpbl, slmsk ! ! moved to GFS_phys_time_vary ! real(kind=kind_phys), intent(in), dimension(:) :: ddy_j1tau, ddy_j2tau @@ -563,7 +562,8 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, & slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, & con_fv, con_pi, lonr, & - cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & + cdmbgwd(1:2),alpha_fd,me,master, & + lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & psl_gwd_dx_factor, & dtend, dtidx, index_of_process_orographic_gwd, & @@ -583,7 +583,8 @@ subroutine ugwpv1_gsldrag_run(me, master, im, levs, ak, bk, ntrac, lonr, dtp, du_osscol, dv_osscol, du_ofdcol, dv_ofdcol, & slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, & con_fv, con_pi, lonr, & - cdmbgwd(1:2),me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & + cdmbgwd(1:2),alpha_fd,me,master, & + lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & dtend, dtidx, index_of_process_orographic_gwd, & index_of_temperature, index_of_x_wind, & diff --git a/physics/GWD/ugwpv1_gsldrag.meta b/physics/GWD/ugwpv1_gsldrag.meta index 8ed38a222..e1a201d57 100644 --- a/physics/GWD/ugwpv1_gsldrag.meta +++ b/physics/GWD/ugwpv1_gsldrag.meta @@ -412,7 +412,7 @@ [psl_gwd_dx_factor] standard_name = effective_grid_spacing_of_psl_gwd_suite long_name = multiplication of grid spacing - units = count + units = 1 dimensions = () type = real kind = kind_phys @@ -474,6 +474,14 @@ type = real kind = kind_phys intent = in +[alpha_fd] + standard_name = alpha_coefficient_for_turbulent_orographic_form_drag + long_name = alpha coefficient for Beljaars et al turbulent orographic form drag + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [jdat] standard_name = date_and_time_of_forecast_in_united_states_order long_name = current forecast date and time diff --git a/physics/GWD/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 index 832f34e47..5e47f2001 100644 --- a/physics/GWD/unified_ugwp.F90 +++ b/physics/GWD/unified_ugwp.F90 @@ -250,7 +250,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt dvsfc_ss,dusfc_fd,dvsfc_fd,dtaux2d_ms,dtauy2d_ms,dtaux2d_bl,dtauy2d_bl, & dtaux2d_ss,dtauy2d_ss,dtaux2d_fd,dtauy2d_fd,dudt_ngw,dvdt_ngw,dtdt_ngw, & br1,hpbl,vtype,slmsk, do_tofd, ldiag_ugwp, ugwp_seq_update, & - cdmbgwd, jdat, xlat, xlat_d, sinlat, coslat, area, & + cdmbgwd, alpha_fd, jdat, xlat, xlat_d, sinlat, coslat, area, & ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, & del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & @@ -290,7 +290,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt real(kind=kind_phys), intent(in), dimension(:,:) :: del, ugrs, vgrs, tgrs, prsl, prslk, phil real(kind=kind_phys), intent(in), dimension(:,:) :: prsi, phii real(kind=kind_phys), intent(in), dimension(:,:) :: q1 - real(kind=kind_phys), intent(in) :: dtp, fhzero, cdmbgwd(:) + real(kind=kind_phys), intent(in) :: dtp, fhzero, cdmbgwd(:), alpha_fd integer, intent(in) :: jdat(:) logical, intent(in) :: do_tofd, ldiag_ugwp, ugwp_seq_update @@ -495,7 +495,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt if ( do_gsl_drag_ls_bl.or.do_gsl_drag_ss.or.do_gsl_drag_tofd ) then ! -if (do_gwd_opt_psl) then + if (do_gwd_opt_psl) then call drag_suite_psl(im,levs,dvdt,dudt,dtdt,uwnd1,vwnd1, & tgrs,q1,kpbl,prsi,del,prsl,prslk,phii,phil,dtp, & kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, & @@ -506,14 +506,15 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, & slmsk,br1,hpbl,vtype,con_g,con_cp,con_rd,con_rv, & con_fvirt,con_pi,lonr, & - cdmbgwd,me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & + cdmbgwd,alpha_fd,me,master, & + lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & psl_gwd_dx_factor, & dtend, dtidx, index_of_process_orographic_gwd, & index_of_temperature, index_of_x_wind, & index_of_y_wind, ldiag3d, ldiag_ugwp, & ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg) -else + else call drag_suite_run(im,levs,dvdt,dudt,dtdt,uwnd1,vwnd1, & tgrs,q1,kpbl,prsi,del,prsl,prslk,phii,phil,dtp, & kdt,hprime,oc,oa4,clx,varss,oc1ss,oa4ss, & @@ -524,13 +525,14 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt dusfc_ss,dvsfc_ss,dusfc_fd,dvsfc_fd, & slmsk,br1,hpbl,con_g,con_cp,con_rd,con_rv, & con_fvirt,con_pi,lonr, & - cdmbgwd,me,master,lprnt,ipr,rdxzb,dx,gwd_opt, & + cdmbgwd,alpha_fd,me,master, & + lprnt,ipr,rdxzb,dx,gwd_opt, & do_gsl_drag_ls_bl,do_gsl_drag_ss,do_gsl_drag_tofd, & dtend, dtidx, index_of_process_orographic_gwd, & index_of_temperature, index_of_x_wind, & index_of_y_wind, ldiag3d, ldiag_ugwp, & ugwp_seq_update, spp_wts_gwd, spp_gwd, errmsg, errflg) -endif + endif ! ! put zeros due to xy GSL-drag style: dtaux2d_bl,dtauy2d_bl,dtaux2d_ss.......dusfc_ms,dvsfc_ms ! diff --git a/physics/GWD/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta index c885aa8d8..5dc347650 100644 --- a/physics/GWD/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -715,6 +715,14 @@ type = real kind = kind_phys intent = in +[alpha_fd] + standard_name = alpha_coefficient_for_turbulent_orographic_form_drag + long_name = alpha coefficient for Beljaars et al turbulent orographic form drag + units = none + dimensions = () + type = real + kind = kind_phys + intent = in [jdat] standard_name = date_and_time_of_forecast_in_united_states_order long_name = current forecast date and time @@ -1262,7 +1270,7 @@ [psl_gwd_dx_factor] standard_name = effective_grid_spacing_of_psl_gwd_suite long_name = multiplication of grid spacing - units = count + units = 1 dimensions = () type = real kind = kind_phys From f94b43df1d4481d88632d80ddce272f967996d23 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 31 May 2024 16:58:35 -0400 Subject: [PATCH 238/249] remove spurious metadata changes in drag_suite.meta --- physics/GWD/drag_suite.meta | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/physics/GWD/drag_suite.meta b/physics/GWD/drag_suite.meta index 088387cfd..29239bdd3 100644 --- a/physics/GWD/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -458,13 +458,6 @@ type = real kind = kind_phys intent = in -[vtype] - standard_name = vegetation_type_classification - long_name = vegetation type for lsm - units = index - dimensions = (horizontal_loop_extent) - type = integer - intent = in [g] standard_name = gravitational_acceleration long_name = gravitational acceleration @@ -608,14 +601,6 @@ dimensions = () type = logical intent = in -[psl_gwd_dx_factor] - standard_name = effective_grid_spacing_of_psl_gwd_suite - long_name = multiplication of grid spacing - units = 1 - dimensions = () - type = real - kind = kind_phys - intent = in [dtend] standard_name = cumulative_change_of_state_variables long_name = diagnostic tendencies for state variables From e59157849677fdaf66aa42b6c84ba6626becb70a Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 31 May 2024 19:59:50 -0400 Subject: [PATCH 239/249] remove some unnecessary variables and add some initialization of outputs --- physics/GWD/drag_suite.F90 | 77 +++++++++---------- physics/GWD/unified_ugwp.F90 | 16 +++- physics/GWD/unified_ugwp.meta | 24 ------ .../Land/Noahmp/module_sf_noahmplsm.F90 | 2 + physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 2 +- 5 files changed, 55 insertions(+), 66 deletions(-) diff --git a/physics/GWD/drag_suite.F90 b/physics/GWD/drag_suite.F90 index 91edfbec8..707cef597 100644 --- a/physics/GWD/drag_suite.F90 +++ b/physics/GWD/drag_suite.F90 @@ -513,7 +513,6 @@ subroutine drag_suite_run( & real(kind=kind_phys),parameter :: olmin = 1.0e-5 real(kind=kind_phys),parameter :: odmin = 0.1 real(kind=kind_phys),parameter :: odmax = 10. - real(kind=kind_phys),parameter :: erad = 6371.315e+3 integer :: komax(im) integer :: kblk real(kind=kind_phys) :: cd @@ -1552,7 +1551,7 @@ subroutine drag_suite_psl( & integer, parameter :: ims=1, kms=1, its=1, kts=1 real(kind=kind_phys), intent(in) :: fv, pi real(kind=kind_phys) :: rcl, cdmb - real(kind=kind_phys) :: g_inv, g_cp + real(kind=kind_phys) :: g_inv, g_cp, rd_inv real(kind=kind_phys), intent(inout) :: & & dudt(:,:),dvdt(:,:), & @@ -1736,7 +1735,6 @@ subroutine drag_suite_psl( & real(kind=kind_phys),parameter :: odmin = 0.1 real(kind=kind_phys),parameter :: odmax = 10. real(kind=kind_phys),parameter :: cdmin = 0.0 - real(kind=kind_phys),parameter :: erad = 6371.315e+3 integer :: komax(im),kbmax(im),kblk(im) real(kind=kind_phys) :: hmax(im) real(kind=kind_phys) :: cd @@ -1808,43 +1806,43 @@ subroutine drag_suite_psl( & endif enddo -! Remove ss_tapering -ss_taper(:) = 1. + ! Remove ss_tapering + ss_taper(:) = 1. -! SPP, if spp_gwd is 0, no perturbations are applied. -if ( spp_gwd==1 ) then - do i = its,im - var_stoch(i) = var(i) + var(i)*0.75*spp_wts_gwd(i,1) - varss_stoch(i) = varss(i) + varss(i)*0.75*spp_wts_gwd(i,1) - varmax_ss_stoch(i) = varmax_ss + varmax_ss*0.75*spp_wts_gwd(i,1) - varmax_fd_stoch(i) = varmax_fd + varmax_fd*0.75*spp_wts_gwd(i,1) - enddo -else - do i = its,im - var_stoch(i) = var(i) - varss_stoch(i) = varss(i) - varmax_ss_stoch(i) = varmax_ss - varmax_fd_stoch(i) = varmax_fd - enddo -endif + ! SPP, if spp_gwd is 0, no perturbations are applied. + if ( spp_gwd==1 ) then + do i = its,im + var_stoch(i) = var(i) + var(i)*0.75*spp_wts_gwd(i,1) + varss_stoch(i) = varss(i) + varss(i)*0.75*spp_wts_gwd(i,1) + varmax_ss_stoch(i) = varmax_ss + varmax_ss*0.75*spp_wts_gwd(i,1) + varmax_fd_stoch(i) = varmax_fd + varmax_fd*0.75*spp_wts_gwd(i,1) + enddo + else + do i = its,im + var_stoch(i) = var(i) + varss_stoch(i) = varss(i) + varmax_ss_stoch(i) = varmax_ss + varmax_fd_stoch(i) = varmax_fd + enddo + endif -!--- calculate length of grid for flow-blocking drag -! -do i=1,im - delx = dx(i) - dely = dx(i) - dxy4(i,1) = delx - dxy4(i,2) = dely - dxy4(i,3) = sqrt(delx*delx + dely*dely) - dxy4(i,4) = dxy4(i,3) - dxy4p(i,1) = dxy4(i,2) - dxy4p(i,2) = dxy4(i,1) - dxy4p(i,3) = dxy4(i,4) - dxy4p(i,4) = dxy4(i,3) - cleff(i) = psl_gwd_dx_factor*(delx+dely)*0.5 - cleff_ss(i) = 0.1 * max(dxmax_ss,dxy4(i,3)) -! cleff_ss(i) = cleff(i) ! consider ..... -enddo + !--- calculate length of grid for flow-blocking drag + ! + do i=1,im + delx = dx(i) + dely = dx(i) + dxy4(i,1) = delx + dxy4(i,2) = dely + dxy4(i,3) = sqrt(delx*delx + dely*dely) + dxy4(i,4) = dxy4(i,3) + dxy4p(i,1) = dxy4(i,2) + dxy4p(i,2) = dxy4(i,1) + dxy4p(i,3) = dxy4(i,4) + dxy4p(i,4) = dxy4(i,3) + cleff(i) = psl_gwd_dx_factor*(delx+dely)*0.5 + cleff_ss(i) = 0.1 * max(dxmax_ss,dxy4(i,3)) + ! cleff_ss(i) = cleff(i) ! consider ..... + enddo ! !-----initialize arrays ! @@ -1928,11 +1926,12 @@ subroutine drag_suite_psl( & kbmax(1:im) = 0 kblk(1:im) = 0 ! + rd_inv = 1./rd do k = kts,km do i = its,im vtj(i,k) = t1(i,k) * (1.+fv*q1(i,k)) vtk(i,k) = vtj(i,k) / prslk(i,k) - ro(i,k) = 1./rd * prsl(i,k) / vtj(i,k) ! density kg/m**3 + ro(i,k) = rd_inv * prsl(i,k) / vtj(i,k) ! density kg/m**3 enddo enddo ! diff --git a/physics/GWD/unified_ugwp.F90 b/physics/GWD/unified_ugwp.F90 index 5e47f2001..adedeeb15 100644 --- a/physics/GWD/unified_ugwp.F90 +++ b/physics/GWD/unified_ugwp.F90 @@ -253,7 +253,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt cdmbgwd, alpha_fd, jdat, xlat, xlat_d, sinlat, coslat, area, & ugrs, vgrs, tgrs, q1, prsi, prsl, prslk, phii, phil, & del, kpbl, dusfcg, dvsfcg, gw_dudt, gw_dvdt, gw_dtdt, gw_kdis, & - tau_tofd, tau_mtb, tau_ogw, tau_ngw, zmtb, zlwb, zogw, & + tau_tofd, tau_mtb, tau_ogw, tau_ngw, & dudt_mtb, dudt_tms, du3dt_mtb, du3dt_ogw, du3dt_tms, & dudt, dvdt, dtdt, rdxzb, con_g, con_omega, con_pi, con_cp, con_rd, con_rv, & con_rerth, con_fvirt, rain, ntke, q_tke, dqdt_tke, lprnt, ipr, & @@ -311,7 +311,7 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt & slmsk(:) real(kind=kind_phys), intent(out), dimension(:) :: dusfcg, dvsfcg - real(kind=kind_phys), intent(out), dimension(:) :: zmtb, zlwb, zogw, rdxzb + real(kind=kind_phys), intent(out), dimension(:) :: rdxzb real(kind=kind_phys), intent(out), dimension(:) :: tau_mtb, tau_ogw, tau_tofd, tau_ngw 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 @@ -385,6 +385,18 @@ subroutine unified_ugwp_run(me, master, im, levs, ak,bk, ntrac, dtp, fhzero, kdt errflg = 0 + ! Initialize intent(out) variables in case they are not set below + dusfcg(:) = 0.0 + dvsfcg(:) = 0.0 + rdxzb(:) = 0.0 + tau_ngw(:) = 0.0 + gw_dudt(:,:) = 0.0 + gw_dvdt(:,:) = 0.0 + gw_dtdt(:,:) = 0.0 + gw_kdis(:,:) = 0.0 + dudt_mtb(:,:) = 0.0 + dudt_tms(:,:) = 0.0 + ! 1) ORO stationary GWs ! ------------------ diff --git a/physics/GWD/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta index 5dc347650..814699375 100644 --- a/physics/GWD/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -938,30 +938,6 @@ type = real kind = kind_phys intent = out -[zmtb] - standard_name = height_of_mountain_blocking - long_name = height of mountain blocking drag - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out -[zlwb] - standard_name = height_of_low_level_wave_breaking - long_name = height of low level wave breaking - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out -[zogw] - standard_name = height_of_launch_level_of_orographic_gravity_wave - long_name = height of launch level of orographic gravity wave - units = m - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys - intent = out [dudt_mtb] standard_name = instantaneous_change_in_x_wind_due_to_mountain_blocking_drag long_name = instantaneous change in x wind due to mountain blocking drag diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index a3b466f46..97f11a1ba 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -2020,6 +2020,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in chuc = 0. chv2 = 0. rb = 0. + laisun = 0. + laisha = 0. cdmnv = 0.0 ezpdv = 0.0 diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 4af3b93b6..0f62fb68e 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -158,7 +158,7 @@ subroutine noahmpdrv_run & sncovr1, qsurf, gflux, drain, evap, hflx, ep, runoff, & cmm, chh, evbs, evcw, sbsno, pah, ecan, etran, edir, snowc,& stm, snohf,smcwlt2, smcref2, wet1, t2mmp, q2mp,zvfun, & - ztmax, rca, errmsg, errflg, & + ztmax, rca, errmsg, errflg, & canopy_heat_storage_ccpp, & rainfall_ccpp, & sw_absorbed_total_ccpp, & From 1108aab4fa2284663f48c1552024526919787675 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 31 May 2024 20:16:51 -0400 Subject: [PATCH 240/249] fix some units in metadata files --- physics/GWD/drag_suite.meta | 2 +- physics/GWD/ugwpv1_gsldrag.meta | 2 +- physics/GWD/unified_ugwp.meta | 2 +- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/physics/GWD/drag_suite.meta b/physics/GWD/drag_suite.meta index 29239bdd3..5413a5482 100644 --- a/physics/GWD/drag_suite.meta +++ b/physics/GWD/drag_suite.meta @@ -524,7 +524,7 @@ [alpha_fd] standard_name = alpha_coefficient_for_turbulent_orographic_form_drag long_name = alpha coefficient for Beljaars et al turbulent orographic form drag - units = none + units = 1 dimensions = () type = real kind = kind_phys diff --git a/physics/GWD/ugwpv1_gsldrag.meta b/physics/GWD/ugwpv1_gsldrag.meta index e1a201d57..6d9f5426b 100644 --- a/physics/GWD/ugwpv1_gsldrag.meta +++ b/physics/GWD/ugwpv1_gsldrag.meta @@ -477,7 +477,7 @@ [alpha_fd] standard_name = alpha_coefficient_for_turbulent_orographic_form_drag long_name = alpha coefficient for Beljaars et al turbulent orographic form drag - units = none + units = 1 dimensions = () type = real kind = kind_phys diff --git a/physics/GWD/unified_ugwp.meta b/physics/GWD/unified_ugwp.meta index 814699375..91f63f03e 100644 --- a/physics/GWD/unified_ugwp.meta +++ b/physics/GWD/unified_ugwp.meta @@ -718,7 +718,7 @@ [alpha_fd] standard_name = alpha_coefficient_for_turbulent_orographic_form_drag long_name = alpha coefficient for Beljaars et al turbulent orographic form drag - units = none + units = 1 dimensions = () type = real kind = kind_phys diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 594903122..7376ba4a2 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -665,7 +665,7 @@ [gwd_z0m_factor] standard_name = momentum_roughness_factor_in_turbulent_form_drag long_name = multiplication of orograhic standard deviation - units = count + units = 1 dimensions = () type = real kind = kind_phys From 1816f724b64aae130beb531e9d2106ad11c3c863 Mon Sep 17 00:00:00 2001 From: helin wei Date: Thu, 20 Jun 2024 00:56:06 +0000 Subject: [PATCH 241/249] all changes from test6 to test11 --- physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 3451f807e..67426a319 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -2626,9 +2626,9 @@ subroutine csnow (parameters,isnow ,nsnow ,nsoil ,snice ,snliq ,dzsnso ! thermal conductivity of snow do iz = isnow+1, 0 - tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) +! tksno(iz) = 3.2217e-6*bdsnoi(iz)**2. ! stieglitz(yen,1965) ! tksno(iz) = 2e-2+2.5e-6*bdsnoi(iz)*bdsnoi(iz) ! anderson, 1976 -! tksno(iz) = 0.35 ! constant + tksno(iz) = 0.35 ! constant ! tksno(iz) = 2.576e-6*bdsnoi(iz)**2. + 0.074 ! verseghy (1991) ! tksno(iz) = 2.22*(bdsnoi(iz)/1000.)**1.88 ! douvill(yen, 1981) enddo From 04074884c04139ecc86d02f0123a0aa2f5a8ccb1 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Thu, 20 Jun 2024 19:52:56 +0000 Subject: [PATCH 242/249] Output updraft value of convective cloud condensate --- physics/CONV/SAMF/samfdeepcnv.f | 5 ++++- physics/CONV/SAMF/samfshalcnv.f | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index 7c2d9acf8..90ff4dfd4 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -3430,7 +3430,10 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & do i = 1, im if (cnvflg(i) .and. rn(i) > 0.) then if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 endif endif enddo diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index f720c4701..41f0124c6 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -2405,7 +2405,10 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & if (cnvflg(i)) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - endif + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + endif endif enddo enddo From 00dc921754a699d361ee0f98b4f321ca021563a1 Mon Sep 17 00:00:00 2001 From: Qingfu Liu Date: Sat, 22 Jun 2024 13:11:48 -0400 Subject: [PATCH 243/249] retract the changes of the Noahmp model --- .../Land/Noahmp/module_sf_noahmplsm.F90 | 188 +++++++----------- physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 | 14 +- physics/SFC_Models/Land/Noahmp/noahmpdrv.meta | 16 -- 3 files changed, 78 insertions(+), 140 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 index 97f11a1ba..2472f11ba 100644 --- a/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 +++ b/physics/SFC_Models/Land/Noahmp/module_sf_noahmplsm.F90 @@ -90,7 +90,7 @@ module module_sf_noahmplsm integer :: opt_crs !< options for canopy stomatal resistance ! **1 -> ball-berry - ! 2 -> jarvis + ! 2 -> jarvis integer :: opt_btr !< options for soil moisture factor for stomatal resistance ! **1 -> noah (soil moisture) @@ -103,16 +103,16 @@ module module_sf_noahmplsm ! 3 -> original surface and subsurface runoff (free drainage) ! 4 -> bats surface and subsurface runoff (free drainage) ! 5 -> miguez-macho&fan groundwater scheme (miguez-macho et al. 2007 jgr; fan et al. 2007 jgr) - ! (needs further testing for public use) + ! (needs further testing for public use) integer :: opt_sfc !< options for surface layer drag coeff (ch & cm) ! **1 -> m-o - ! **2 -> original noah (chen97) - ! **3 -> myj consistent; 4->ysu consistent. mb: removed in v3.7 for further testing + ! **2 -> original noah (chen97) + ! **3 -> myj consistent; 4->ysu consistent. mb: removed in v3.7 for further testing integer :: opt_frz !< options for supercooled liquid water (or ice fraction) ! **1 -> no iteration (niu and yang, 2006 jhm) - ! 2 -> koren's iteration + ! 2 -> koren's iteration integer :: opt_inf !< options for frozen soil permeability ! **1 -> linear effects, more permeable (niu and yang, 2006, jhm) @@ -125,13 +125,13 @@ module module_sf_noahmplsm integer :: opt_alb !< options for ground snow surface albedo ! 1 -> bats - ! **2 -> class + ! **2 -> class integer :: opt_snf !< options for partitioning precipitation into rainfall & snowfall ! **1 -> jordan (1991) - ! 2 -> bats: when sfctmp sfctmp < tfrz - ! 4 -> use wrf microphysics output + ! 2 -> bats: when sfctmp sfctmp < tfrz + ! 4 -> use wrf microphysics output integer :: opt_tbot !< options for lower boundary condition of soil temperature ! 1 -> zero heat flux from bottom (zbot and tbot not used) @@ -139,20 +139,20 @@ module module_sf_noahmplsm integer :: opt_stc !< options for snow/soil temperature time scheme (only layer 1) ! **1 -> semi-implicit; flux top boundary condition - ! 2 -> full implicit (original noah); temperature top boundary condition + ! 2 -> full implicit (original noah); temperature top boundary condition ! 3 -> same as 1, but fsno for ts calculation (generally improves snow; v3.7) integer :: opt_rsf !< options for surface resistent to evaporation/sublimation ! **1 -> sakaguchi and zeng, 2009 - ! 2 -> sellers (1992) + ! 2 -> sellers (1992) ! 3 -> adjusted sellers to decrease rsurf for wet soil - ! 4 -> option 1 for non-snow; rsurf = rsurf_snow for snow (set in mptable); ad v3.8 + ! 4 -> option 1 for non-snow; rsurf = rsurf_snow for snow (set in mptable); ad v3.8 integer :: opt_soil !< options for defining soil properties ! **1 -> use input dominant soil texture - ! 2 -> use input soil texture that varies with depth + ! 2 -> use input soil texture that varies with depth ! 3 -> use soil composition (sand, clay, orgm) and pedotransfer functions (opt_pedo) - ! 4 -> use input soil properties (bexp_3d, smcmax_3d, etc.) + ! 4 -> use input soil properties (bexp_3d, smcmax_3d, etc.) integer :: opt_pedo !< options for pedotransfer functions (used when opt_soil = 3) ! **1 -> saxton and rawls (2006) @@ -423,9 +423,8 @@ subroutine noahmp_sflx (parameters, & smceq , & ! in : vegetation/soil characteristics sfctmp , sfcprs , psfc , uu , vv , q2, garea1 , & ! in : forcing qc , soldn , lwdn,thsfc_loc, prslkix,prsik1x,prslk1x,& ! in : forcing - varf , gwd_z0m_factor, & ! in : turbulent orographic form drag pblhx , iz0tlnd , itime ,psi_opt ,& - prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing + prcpconv, prcpnonc, prcpshcv, prcpsnow, prcpgrpl, prcphail, & ! in : forcing tbot , co2air , o2air , foln , ficeold , zlvl , & ! in : forcing ep_1 , ep_2 , epsm1 , cp , & ! in : constants albold , sneqvo , & ! in/out : @@ -437,7 +436,7 @@ subroutine noahmp_sflx (parameters, & cm , ch , tauss , & ! in/out : grain , gdd , pgs , & ! in/out smcwtd ,deeprech , rech , ustarx , & ! in/out : - z0wrf , z0hwrf , ts , & ! out : + z0wrf , z0hwrf , ts , & ! out : fsa , fsr , fira , fsh , ssoil , fcev , & ! out : fgev , fctr , ecan , etran , edir , trad , & ! out : tgb , tgv , t2mv , t2mb , q2v , q2b , & ! out : @@ -446,9 +445,9 @@ subroutine noahmp_sflx (parameters, & qsnbot , ponding , ponding1, ponding2, rssun , rssha , & ! out : albd , albi , albsnd , albsni , & ! out : bgap , wgap , chv , chb , emissi , & ! out : - shg , shc , shb , evg , evb , ghv , & ! out : - ghb , irg , irc , irb , tr , evc , & ! out : - chleaf , chuc , chv2 , chb2 , fpice , pahv , & + shg , shc , shb , evg , evb , ghv , & ! out : + ghb , irg , irc , irb , tr , evc , & ! out : + chleaf , chuc , chv2 , chb2 , fpice , pahv , & pahg , pahb , pah , esnow , canhs , laisun , & laisha , rb , qsfcveg , qsfcbare & #ifdef CCPP @@ -494,8 +493,6 @@ subroutine noahmp_sflx (parameters, & real (kind=kind_phys) , intent(in) :: prslk1x !< in exner function real (kind=kind_phys) , intent(in) :: garea1 !< in exner function - real (kind=kind_phys) , intent(in) :: varf !< sub-grid orography standard deviation [m] - real (kind=kind_phys) , intent(in) :: gwd_z0m_factor ! turbulent orographic form drag roughness length factor real (kind=kind_phys) , intent(in) :: pblhx !< pbl height integer , intent(in) :: iz0tlnd !< z0t option integer , intent(in) :: itime !< @@ -822,7 +819,7 @@ subroutine noahmp_sflx (parameters, & canliq ,canice ,tv ,sfctmp ,tg , & !in qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , & !out pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out - fwet ,cmc ) !out + fwet ,cmc ) !out ! compute energy budget (momentum & energy fluxes and phase changes) @@ -835,9 +832,8 @@ subroutine noahmp_sflx (parameters, & fveg ,shdfac, pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc, jloc , & !in thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in - varf ,gwd_z0m_factor , & !in pblhx ,iz0tlnd, itime ,psi_opt, ep_1, ep_2, epsm1,cp, & - z0wrf ,z0hwrf , & !out + z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out @@ -858,7 +854,7 @@ subroutine noahmp_sflx (parameters, & fsrg ,rssun ,rssha ,albd ,albi ,albsnd,albsni, bgap ,wgap, tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb , & !out emissi ,pah ,canhs, & - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out qsfcveg = eah*ep_2/(sfcprs + epsm1*eah) qsfcbare = qsfc @@ -881,7 +877,7 @@ subroutine noahmp_sflx (parameters, & esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in ficeold,ponding,tg ,ist ,fveg ,iloc,jloc , smceq , & !in bdfall ,fp ,rain ,snow , & !in mb/an: v3.7 - qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb + qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout @@ -915,9 +911,9 @@ subroutine noahmp_sflx (parameters, & if (opt_crop == 1 .and. crop_active) then call carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julian , & !in dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in - soldn ,t2m , & !in + soldn ,t2m , & !in lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout - lai ,sai ,gdd , & !inout + lai ,sai ,gdd , & !inout gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs ) !out end if @@ -968,7 +964,7 @@ subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , & prcpconv,prcpnonc ,prcpshcv,prcpsnow,prcpgrpl,prcphail , & soldn ,cosz ,thair ,qair , & eair ,rhoair ,qprecc ,qprecl ,solad , solai , & - swdown ,bdfall ,rain ,snow ,fp , fpice ,prcp ) + swdown ,bdfall ,rain ,snow ,fp , fpice ,prcp ) ! -------------------------------------------------------------------------------------------------- ! re-process atmospheric forcing ! ---------------------------------------------------------------------- @@ -1041,7 +1037,7 @@ subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , & if(opt_snf == 4) then qprecc = prcpconv + prcpshcv - qprecl = prcpnonc + qprecl = prcpnonc else qprecc = 0.10 * prcp ! should be from the atmospheric model qprecl = 0.90 * prcp ! should be from the atmospheric model @@ -1094,15 +1090,15 @@ subroutine atm (parameters,ep_2,epsm1,sfcprs ,sfctmp ,q2 , & if(opt_snf == 4 .or. opt_snf == 5) then prcp_frozen = prcpsnow + prcpgrpl + prcphail if(prcpnonc > 0. .and. prcp_frozen > 0.) then - fpice = min(1.0,prcp_frozen/prcpnonc) - fpice = max(0.0,fpice) + fpice = min(1.0,prcp_frozen/prcpnonc) + fpice = max(0.0,fpice) if(opt_snf==4) bdfall = bdfall*(prcpsnow/prcp_frozen) + rho_grpl*(prcpgrpl/prcp_frozen) + & rho_hail*(prcphail/prcp_frozen) if(opt_snf==5) bdfall = parameters%prcpiceden - else - fpice = 0.0 + else + fpice = 0.0 endif - + endif rain = prcp * (1.-fpice) @@ -1237,8 +1233,8 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv bdfall ,rain ,snow ,fp , & !in canliq ,canice ,tv ,sfctmp ,tg , & !in qintr ,qdripr ,qthror ,qints ,qdrips ,qthros , & !out - pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out - fwet ,cmc ) !out + pahv ,pahg ,pahb ,qrain ,qsnow ,snowhin, & !out + fwet ,cmc ) !out ! ------------------------ code history ------------------------------ ! michael barlage: oct 2013 - split canwater to calculate precip movement for @@ -1340,10 +1336,10 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv qintr = 0. qdripr = 0. qthror = rain - if(canliq > 0.) then ! for case of canopy getting buried - qdripr = qdripr + canliq/dt - canliq = 0.0 - end if + if(canliq > 0.) then ! for case of canopy getting buried + qdripr = qdripr + canliq/dt + canliq = 0.0 + end if end if ! heat transported by liquid water @@ -1366,8 +1362,8 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv qints = max(qints, 0.) ft = max(0.0,(tv - 270.15) / 1.87e5) fv = sqrt(uu*uu + vv*vv) / 1.56e5 -! mb: changed below to reflect the rain assumption that all precip gets intercepted - icedrip = max(0.,canice) * (fv+ft) !mb: removed /dt + ! mb: changed below to reflect the rain assumption that all precip gets intercepted + icedrip = max(0.,canice) * (fv+ft) !mb: removed /dt qdrips = (fveg * snow - qints) + icedrip qthros = (1.0-fveg) * snow canice= max(0.,canice + (qints - icedrip)*dt) @@ -1375,10 +1371,10 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv qints = 0. qdrips = 0. qthros = snow - if(canice > 0.) then ! for case of canopy getting buried - qdrips = qdrips + canice/dt - canice = 0.0 - end if + if(canice > 0.) then ! for case of canopy getting buried + qdrips = qdrips + canice/dt + canice = 0.0 + end if endif ! print*, "precip_heat canopy through:",3600.0*(fveg * snow - qints) ! print*, "precip_heat canopy drip:",3600.0*max(0.,canice) * (fv+ft) @@ -1408,13 +1404,13 @@ subroutine precip_heat (parameters,iloc ,jloc ,vegtyp ,dt ,uu ,vv if (fveg > 0.0 .and. fveg < 1.0) then pahg = pahg / fveg ! these will be multiplied by fraction later - pahb = pahb / (1.0-fveg) + pahb = pahb / (1.0-fveg) elseif (fveg <= 0.0) then pahb = pahg + pahb ! for case of canopy getting buried pahg = 0.0 - pahv = 0.0 + pahv = 0.0 elseif (fveg >= 1.0) then - pahb = 0.0 + pahb = 0.0 end if pahv = max(pahv,-20.0) ! put some artificial limits here for stability @@ -1680,9 +1676,8 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in fveg ,shdfac, pahv ,pahg ,pahb , & !in qsnow ,dzsnso ,lat ,canliq ,canice ,iloc , jloc, & !in thsfc_loc, prslkix,prsik1x,prslk1x,garea1, & !in - varf ,gwd_z0m_factor , & !in pblhx , iz0tlnd, itime,psi_opt,ep_1, ep_2, epsm1, cp, & - z0wrf ,z0hwrf , & !out + z0wrf ,z0hwrf , & !out imelt ,snicev ,snliqv ,epore ,t2m ,fsno , & !out sav ,sag ,qmelt ,fsa ,fsr ,taux , & !out tauy ,fira ,fsh ,fcev ,fgev ,fctr , & !out @@ -1702,7 +1697,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in t2mv ,t2mb ,fsrv , & fsrg ,rssun ,rssha ,albd ,albi,albsnd ,albsni,bgap ,wgap,tgv,tgb,& q1 ,q2v ,q2b ,q2e ,chv ,chb, emissi,pah,canhs,& - shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out + shg,shc,shb,evg,evb,ghv,ghb,irg,irc,irb,tr,evc,chleaf,chuc,chv2,chb2 ) !out !jref:end ! -------------------------------------------------------------------------------------------------- @@ -1762,8 +1757,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in real (kind=kind_phys) , intent(in) :: prslk1x !< in exner function real (kind=kind_phys) , intent(in) :: garea1 !< - real (kind=kind_phys) , intent(in) :: varf !< sub-grid orography standard deviation [m] - real (kind=kind_phys) , intent(in) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys) , intent(in) :: pblhx !< pbl height real (kind=kind_phys) , intent(in) :: ep_1 !< real (kind=kind_phys) , intent(in) :: ep_2 !< @@ -2218,19 +2211,19 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in if (tv .gt. tfrz) then ! barlage: add distinction between ground and latheav = hvap ! vegetation in v3.6 - frozen_canopy = .false. + frozen_canopy = .false. else latheav = hsub - frozen_canopy = .true. + frozen_canopy = .true. end if gammav = cpair*sfcprs/(ep_2*latheav) if (tg .gt. tfrz) then latheag = hvap - frozen_ground = .false. + frozen_ground = .false. else latheag = hsub - frozen_ground = .true. + frozen_ground = .true. end if gammag = cpair*sfcprs/(ep_2*latheag) @@ -2259,7 +2252,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in - varf , gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & eah ,tah ,tv ,tgv ,cmv, ustarx , & !inout #ifdef CCPP @@ -2274,7 +2266,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in !jref:start qc ,qsfc ,psfc , & !in q2v ,chv2 ,chleaf ,chuc , & - rb) !out + rb) !out ! new coupling code @@ -2298,7 +2290,6 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in emg ,stc ,df ,rsurf ,latheag , & !in gammag ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in - varf ,gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & #ifdef CCPP tgb ,cmb ,chb, ustarx,errmsg ,errflg , & !inout @@ -2343,7 +2334,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in ssoil = fveg * ghv + (1.0 - fveg) * ghb fcev = evc fctr = tr - pah = fveg * pahg + (1.0 - fveg) * pahb + pahv + pah = fveg * pahg + (1.0 - fveg) * pahb + pahv tg = fveg * tgv + (1.0 - fveg) * tgb t2m = fveg * t2mv + (1.0 - fveg) * t2mb ts = fveg * tah + (1.0 - fveg) * tgb @@ -2373,7 +2364,7 @@ subroutine energy (parameters,ice ,vegtyp ,ist ,nsnow ,nsoil , & !in t2m = t2mb fcev = 0. fctr = 0. - pah = pahb + pah = pahb ts = tg cm = cmb ch = chb @@ -3544,7 +3535,7 @@ subroutine twostream (parameters,ib ,ic ,vegtyp ,cosz ,vai , & ! kopen = 1.0 else if(opt_rad == 1) then - denfveg = -log(max(1.0-fveg,0.01))/(pai*parameters%rc**2) + denfveg = -log(max(1.0-fveg,0.01))/(pai*parameters%rc**2) hd = parameters%hvt - parameters%hvb bb = 0.5 * hd thetap = atan(bb/parameters%rc * tan(acos(max(0.01,cosz))) ) @@ -3712,7 +3703,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & foln ,co2air ,o2air ,btran ,sfcprs , & !in rhsur ,iloc ,jloc ,q2 ,pahv ,pahg , & !in thsfc_loc, prslkix,prsik1x,prslk1x, garea1, & !in - varf ,gwd_z0m_factor, & !in pblhx ,iz0tlnd ,itime ,psi_opt ,ep_1, ep_2, epsm1, cp, & eah ,tah ,tv ,tg ,cm,ustarx,& !inout #ifdef CCPP @@ -3726,7 +3716,7 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & csigmaf1, & !out qc ,qsfc ,psfc , & !in q2v ,cah2 ,chleaf ,chuc , & !inout - rb) !out + rb) !out ! -------------------------------------------------------------------------------------------------- ! use newton-raphson iteration to solve for vegetation (tv) and @@ -3763,8 +3753,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & real (kind=kind_phys), intent(in) :: dt !< time step (s) real (kind=kind_phys), intent(in) :: fsno !< snow fraction - real (kind=kind_phys) , intent(in) :: varf !< sub-grid orography standard deviation [m] - real (kind=kind_phys) , intent(in) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys) , intent(in) :: pblhx !< pbl height real (kind=kind_phys) , intent(in) :: ep_1 !< real (kind=kind_phys) , intent(in) :: ep_2 !< @@ -4137,7 +4125,6 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tah ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h, zpd ,snowh ,shdfac ,garea1 , & !in - varf,gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -4260,11 +4247,11 @@ subroutine vege_flux(parameters,nsnow ,nsoil ,isnow ,vegtyp ,veg , & shc = fveg*rhoair*cpair*cvh * ( tv-tah) evc = fveg*rhoair*cpair*cew * (estv-eah) / gammav ! barlage: change to v in v3.6 tr = fveg*rhoair*cpair*ctw * (estv-eah) / gammav - if (tv > tfrz) then + if (tv > tfrz) then evc = min(canliq*latheav/dt,evc) ! barlage: add if block for canice in v3.6 - else + else evc = min(canice*latheav/dt,evc) - end if + end if ! canopy heat capacity hcv = fveg*(parameters%cbiom*vaie*cwat + canliq*cwat/denh2o + canice*cice/denice) !j/m2/k @@ -4447,7 +4434,6 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & emg ,stc ,df ,rsurf ,lathea , & !in gamma ,rhsur ,iloc ,jloc ,q2 ,pahb , & !in thsfc_loc, prslkix,prsik1x,prslk1x,vegtyp,fveg,shdfac,garea1, & !in - varf,gwd_z0m_factor, & !in pblhx , iz0tlnd , itime ,psi_opt,ep_1,ep_2,epsm1,cp ,& #ifdef CCPP tgb ,cm ,ch,ustarx,errmsg ,errflg , & !inout @@ -4502,8 +4488,6 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & real (kind=kind_phys), intent(in) :: rhsur !< raltive humidity in surface soil/snow air space (-) real (kind=kind_phys), intent(in) :: fsno !< snow fraction - real (kind=kind_phys), intent(in) :: varf !< sub-grid orography standard deviation [m] - real (kind=kind_phys), intent(in) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys), intent(in) :: pblhx !< pbl height (m) real (kind=kind_phys), intent(in) :: ep_1 !< real (kind=kind_phys), intent(in) :: ep_2 !< @@ -4747,7 +4731,6 @@ subroutine bare_flux (parameters,nsnow ,nsoil ,isnow ,dt ,sag , & call sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h, zpd,snowh ,shdfac ,garea1 , & !in - varf,gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -5454,7 +5437,6 @@ end subroutine sfcdif2 subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur , & !in zlvl ,tgb ,thsfc_loc,prslkix,prsik1x ,prslk1x ,z0m , & !in z0h,zpd ,snowh ,fveg ,garea1 , & !in - varf ,gwd_z0m_factor, & !in ustarx ,fm ,fh ,fm2 ,fh2 , & !inout fv ,cm ,ch ) !out @@ -5484,8 +5466,6 @@ subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur real (kind=kind_phys), intent(in ) :: snowh !< snow depth [m] real (kind=kind_phys), intent(in ) :: fveg !< fractional vegetation cover real (kind=kind_phys), intent(in ) :: garea1 !< grid area [km2] - real (kind=kind_phys), intent(in ) :: varf !< sub-grid orography standard deviation [m] - real (kind=kind_phys), intent(in ) :: gwd_z0m_factor !< turbulent orographic form drag roughness length factor real (kind=kind_phys), intent(inout) :: ustarx !< friction velocity [m/s] real (kind=kind_phys), intent(inout) :: fm !< momentum stability correction, weighted by prior iters real (kind=kind_phys), intent(inout) :: fh !< sen heat stability correction, weighted by prior iters @@ -5540,7 +5520,7 @@ subroutine sfcdif3(parameters,iloc ,jloc ,iter ,sfctmp ,qair ,ur endif call gfs_stability (zlvlb, zvfun1, gdx, tv1, thv1, ur, z0m, z0h, tvs, grav, thsfc_loc, & - varf,gwd_z0m_factor,rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv) + rb1, fm,fh,fm10,fh2,cm,ch,stress1,fv) end subroutine sfcdif3 @@ -5550,7 +5530,6 @@ subroutine gfs_stability & ! --- inputs: ( z1, zvfun, gdx, tv1, thv1, wind, z0max, ztmax, tvs, grav, & thsfc_loc, & - varf,gwd_z0m_factor, & ! --- outputs: rb, fm, fh, fm10, fh2, cm, ch, stress, ustar) @@ -5570,8 +5549,6 @@ subroutine gfs_stability & real(kind=kind_phys), intent(in) :: ztmax ! thermal roughness length real(kind=kind_phys), intent(in) :: tvs ! surface virtual temperature real(kind=kind_phys), intent(in) :: grav ! local gravity -real(kind=kind_phys), intent(in) :: varf ! turbulent orographic standard deviation [m] -real(kind=kind_phys), intent(in) :: gwd_z0m_factor ! turbulent orographic form drag roughness length factor logical, intent(in) :: thsfc_loc ! use local theta reference flag real(kind=kind_phys), intent(out) :: rb ! bulk richardson number [-] @@ -5630,10 +5607,6 @@ subroutine gfs_stability & real(kind=kind_phys) :: zolmax real(kind=kind_phys) xkzo -! -real(kind=kind_phys) :: cf, zf, fri, fphim -real(kind=kind_phys), parameter :: varf_min = 50.0 -real(kind=kind_phys), parameter :: varf_max = 500.0 z1i = one / z1 ! inverse of model height @@ -5754,19 +5727,6 @@ subroutine gfs_stability & endif ! end of if (dtv >= 0 ) then loop ! -! compute the effect of orographic form drag : koo et al. (2018,jgr, eqs. 1 and 2) -! - if ( varf.gt.varf_min .and. gwd_z0m_factor.gt.0.0_kind_phys ) then - tem1 = min(varf, varf_max) - zf = tem1 * gwd_z0m_factor ! effective roughness length - zf = min(zf, z1) - fri = min( max( 1.0_kind_phys-rb,0.0_kind_phys ), 1.0_kind_phys) ! a function of ther bulk Richardson number - fphim = log( ( z1 + zf) / zf ) ! integrated profile function for momentum - cf = ca*ca / (fphim*fphim) * fri ! exchange coefficient for momentum - else - cf = 0. - endif -! ! finish the exchange coefficient computation to provide fm and fh ! fm = fm - pm ! phi_m @@ -5778,7 +5738,7 @@ subroutine gfs_stability & tem1 = 0.00001_kind_phys/z1 ! minimum exhange coef (?) cm = max(cm, tem1) ch = max(ch, tem1) - stress = (cm + cf)* wind * wind + stress = cm * wind * wind ! surface stress = Cm*U*U ustar = sqrt(stress) ! friction velocity return @@ -5927,7 +5887,7 @@ subroutine thermalz0(parameters, fveg, z0m, z0mg, zlvl, else z0h_out = z0m_out * 0.01 endif - + elseif (opt_trs == blumel99) then reyn = ustarx*z0m_out/viscosity ! Blumel99 eqn 36c @@ -7060,7 +7020,7 @@ subroutine water (parameters,vegtyp ,nsnow ,nsoil ,imelt ,dt ,uu , & esai ,sfctmp ,qvap ,qdew ,zsoil ,btrani , & !in ficeold,ponding,tg ,ist ,fveg ,iloc ,jloc ,smceq , & !in bdfall ,fp ,rain ,snow, & !in mb/an: v3.7 - qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb + qsnow ,qrain ,snowhin,latheav,latheag,frozen_canopy,frozen_ground, & !in mb isnow ,canliq ,canice ,tv ,snowh ,sneqv , & !inout snice ,snliq ,stc ,zsnso ,sh2o ,smc , & !inout sice ,zwt ,wa ,wt ,dzsnso ,wslake , & !inout @@ -7689,19 +7649,19 @@ subroutine combine (parameters,nsnow ,nsoil ,iloc ,jloc , & !in snice(j-1) = snice(j-1) + snice(j) dzsnso(j-1) = dzsnso(j-1) + dzsnso(j) else - if(snice(j) >= 0.) then + if(snice(j) >= 0.) then ponding1 = snliq(j) ! isnow will get set to zero below; ponding1 will get sneqv = snice(j) ! added to ponding from phasechange ponding should be snowh = dzsnso(j) ! zero here because it was calculated for thin snow - else ! snice over-sublimated earlier - ponding1 = snliq(j) + snice(j) - if(ponding1 < 0.) then ! if snice and snliq sublimates remove from soil - sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.)) + else ! snice over-sublimated earlier + ponding1 = snliq(j) + snice(j) + if(ponding1 < 0.) then ! if snice and snliq sublimates remove from soil + sice(1) = max(0.0,sice(1)+ponding1/(dzsnso(1)*1000.)) ponding1 = 0.0 - end if + end if sneqv = 0.0 snowh = 0.0 - end if + end if snliq(j) = 0.0 snice(j) = 0.0 dzsnso(j) = 0.0 @@ -9790,7 +9750,7 @@ subroutine carbon_crop (parameters,nsnow ,nsoil ,vegtyp ,dt ,zsoil ,julia dzsnso ,stc ,smc ,tv ,psn ,foln ,btran , & !in soldn ,t2m , & !in lfmass ,rtmass ,stmass ,wood ,stblcp ,fastcp ,grain , & !inout - xlai ,xsai ,gdd , & !inout + xlai ,xsai ,gdd , & !inout gpp ,npp ,nee ,autors ,heters ,totsc ,totlb, pgs ) !out ! ------------------------------------------------------------------------------------------ ! initial crop version created by xing liu @@ -10469,7 +10429,7 @@ end subroutine psn_crop !! subroutine noahmp_options(idveg , iopt_crs , iopt_btr , iopt_run , iopt_sfc , iopt_frz , & iopt_inf, iopt_rad , iopt_alb , iopt_snf , iopt_tbot, iopt_stc , & - iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs , iopt_diag, & + iopt_rsf, iopt_soil, iopt_pedo, iopt_crop, iopt_trs , iopt_diag, & iopt_z0m ) implicit none diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 index 0f62fb68e..6234f46d9 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.F90 @@ -137,7 +137,6 @@ subroutine noahmpdrv_run & rainn_mp, rainc_mp, snow_mp, graupel_mp, ice_mp, rhonewsn1,& con_hvap, con_cp, con_jcal, rhoh2o, con_eps, con_epsm1, & con_fvirt, con_rd, con_hfus, thsfc_loc, cpllnd, cpllnd2atm,& - mntvar,gwd_z0m_factor, & ! --- in/outs: weasd, snwdph, tskin, tprcp, srflag, smc, stc, slc, & @@ -298,8 +297,6 @@ subroutine noahmpdrv_run & 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) :: mntvar ! subgrid orographic statistics data - real(kind=kind_phys) , intent(in) :: gwd_z0m_factor ! turbulent orographic form drag roughness length factor 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] @@ -404,6 +401,7 @@ subroutine noahmpdrv_run & real(kind=kind_phys), dimension(:) , intent(out) :: zvfun ! real(kind=kind_phys), dimension(:) , intent(out) :: ztmax ! thermal roughness length real(kind=kind_phys), dimension(:) , intent(out), optional :: rca ! total canopy/stomatal resistance (s/m) + character(len=*) , intent(out) :: errmsg integer , intent(out) :: errflg @@ -627,7 +625,7 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: canopy_heat_storage ! out | within-canopy heat [W/m2] real (kind=kind_phys) :: spec_humid_sfc_veg ! out | surface specific humidty over vegetation [kg/kg] real (kind=kind_phys) :: spec_humid_sfc_bare ! out | surface specific humidty over bare soil [kg/kg] - + real (kind=kind_phys) :: ustarx ! inout |surface friction velocity real (kind=kind_phys) :: prslkix ! in exner function real (kind=kind_phys) :: prsik1x ! in exner function @@ -637,7 +635,6 @@ subroutine noahmpdrv_run & real (kind=kind_phys) :: cq2 real (kind=kind_phys) :: qfx real (kind=kind_phys) :: wspd1 ! wind speed with all components - real (kind=kind_phys) :: varf_grid ! sub-grid orography standard deviation real (kind=kind_phys) :: pblhx ! height of pbl integer :: mnice @@ -743,7 +740,6 @@ subroutine noahmpdrv_run & area_grid = garea(i) pblhx = pblh(i) - varf_grid = mntvar(i,15) prslkix = prslki(i) prsik1x = prsik1(i) @@ -975,7 +971,6 @@ subroutine noahmpdrv_run & spec_humidity_forcing ,area_grid ,cloud_water_forcing , & sw_radiation_forcing ,radiation_lw_forcing ,thsfc_loc , & prslkix ,prsik1x ,prslk1x , & - varf_grid ,gwd_z0m_factor , & pblhx ,iz0tlnd ,itime , & psi_opt , & precip_convective , & @@ -1067,7 +1062,7 @@ subroutine noahmpdrv_run & chxy (i) = ch_noahmp zorl (i) = z0_total * 100.0 ! convert to cm ztmax (i) = z0h_total - + !LAI-scale canopy resistance based on weighted sunlit shaded fraction if(rs_sunlit .le. 0.0 .or. rs_shaded .le. 0.0 .or. & lai_sunlit .eq. 0.0 .or. lai_shaded .eq. 0.0) then @@ -1077,7 +1072,7 @@ subroutine noahmpdrv_run & ((1.0/(rs_shaded+leaf_air_resistance))*lai_shaded)) rca(i) = max((1.0/rca(i)),parameters%rsmin) !resistance end if - + smc (i,:) = soil_moisture_vol slc (i,:) = soil_liquid_vol snowxy (i) = float(snow_levels) @@ -1220,7 +1215,6 @@ subroutine noahmpdrv_run & call gfs_stability & (zf(i), zvfun(i), gdx, virtual_temperature, vptemp,wind(i), z0_total, z0h_total, & tvs1, con_g, thsfc_loc, & - varf_grid, gwd_z0m_factor, & rb1(i), fm1(i), fh1(i), fm101(i), fh21(i), cm(i), ch(i), stress1(i), ustar1(i)) rmol1(i) = undefined !not used in GFS sfcdif -> to satsify output diff --git a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta index 7376ba4a2..753550016 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta +++ b/physics/SFC_Models/Land/Noahmp/noahmpdrv.meta @@ -654,22 +654,6 @@ dimensions = () type = logical intent = in -[mntvar] - standard_name = statistical_measures_of_subgrid_orography_collection_array - long_name = array of statistical measures of subgrid height_above_mean_sea_level - units = mixed - dimensions = (horizontal_loop_extent,number_of_statistical_measures_of_subgrid_orography) - type = real - kind = kind_phys - intent = in -[gwd_z0m_factor] - standard_name = momentum_roughness_factor_in_turbulent_form_drag - long_name = multiplication of orograhic standard deviation - units = 1 - dimensions = () - type = real - kind = kind_phys - intent = in [weasd] standard_name = water_equivalent_accumulated_snow_depth_over_land long_name = water equiv of acc snow depth over land From b73269fcd3660b5c69cc110f796ef4a4b4e227be Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 25 Jun 2024 18:08:51 +0000 Subject: [PATCH 244/249] update xkinv1 to 0.15 --- physics/PBL/SATMEDMF/satmedmfvdifq.F | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/PBL/SATMEDMF/satmedmfvdifq.F b/physics/PBL/SATMEDMF/satmedmfvdifq.F index 95a1e35e5..c0e43e809 100644 --- a/physics/PBL/SATMEDMF/satmedmfvdifq.F +++ b/physics/PBL/SATMEDMF/satmedmfvdifq.F @@ -275,7 +275,7 @@ subroutine satmedmfvdifq_run(im,km,ntrac,ntcw,ntrw, & parameter(elmfac=1.0,elefac=1.0,cql=100.) parameter(dw2min=1.e-4,dkmax=1000.,xkgdx=1000.) parameter(qlcr=3.5e-5,zstblmax=2500.) - parameter(xkinv1=0.4,xkinv2=0.3) + parameter(xkinv1=0.15,xkinv2=0.3) parameter(h1=0.33333333,hcrinv=250.) parameter(vegflo=0.1,vegfup=1.0,z0lo=0.1,z0up=1.0) parameter(vc0=1.0,zc0=1.0) From 891959c2680b91ba745e4edbd7a7c98e17101d12 Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 25 Jun 2024 21:03:28 +0000 Subject: [PATCH 245/249] add check if progsigma is true --- physics/CONV/SAMF/samfdeepcnv.f | 10 +++++++--- physics/CONV/SAMF/samfshalcnv.f | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index 90ff4dfd4..be43795b4 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -3431,9 +3431,13 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & if (cnvflg(i) .and. rn(i) > 0.) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 + if(progsigma)then + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + else + cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + endif endif endif enddo diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index 41f0124c6..fa9d77a53 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -2405,9 +2405,13 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & if (cnvflg(i)) then if (k >= kbcon(i) .and. k < ktcon(i)) then cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 + if(progsigma)then + tem=max(sigmaout(i,k),0.) + tem1=min(tem,1.0) + cnvw(i,k)=cnvw(i,k)*tem1 + else + cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + endif endif endif enddo From c6dec90f4cd8e9f7ac5772cf51e9df6cd5f59cdd Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Fri, 28 Jun 2024 10:09:15 -0400 Subject: [PATCH 246/249] add optional attribute as necessary to arguments in drag_suite_psl subroutine; change upper bound of loop to prevent array bound excursion --- physics/GWD/drag_suite.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/physics/GWD/drag_suite.F90 b/physics/GWD/drag_suite.F90 index 707cef597..5c2bf6c2c 100644 --- a/physics/GWD/drag_suite.F90 +++ b/physics/GWD/drag_suite.F90 @@ -1542,7 +1542,7 @@ subroutine drag_suite_psl( & integer, intent(in) :: KPBL(:) real(kind=kind_phys), intent(in) :: deltim, G, CP, RD, RV, & & cdmbgwd(:), alpha_fd - 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, & & index_of_process_orographic_gwd, index_of_x_wind, index_of_y_wind @@ -1567,7 +1567,7 @@ subroutine drag_suite_psl( & 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(:) @@ -1589,7 +1589,7 @@ subroutine drag_suite_psl( & !SPP real(kind=kind_phys), dimension(im) :: var_stoch, varss_stoch, & varmax_ss_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 @@ -1598,12 +1598,12 @@ subroutine drag_suite_psl( & real(kind=kind_phys), intent(out) :: & & dusfc(:), dvsfc(:) !Output (optional): - real(kind=kind_phys), intent(out) :: & + real(kind=kind_phys), intent(out), optional :: & & dusfc_ls(:),dvsfc_ls(:), & & 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_ls(:,:),dtauy2d_ls(:,:), & & dtaux2d_bl(:,:),dtauy2d_bl(:,:), & & dtaux2d_ss(:,:),dtauy2d_ss(:,:), & @@ -2551,7 +2551,7 @@ subroutine drag_suite_psl( & ! apply limiter to mesosphere drag, reduce the drag by density factor 10-3 ! prevent wind reversal... ! - do k = kpblmax,km + do k = kpblmax,km-1 if ((taud_ls(i,k)+taud_bl(i,k)).ne.0..and.prsl(i,k).le.pcutoff) then denfac = min(ro(i,k)/pcutoff_den,1.) dtfac(i,k) = min(dtfac(i,k),denfac*abs(velco(i,k) & From 3a361b2440e73f8c734d05a2ddcae2d69d7abc85 Mon Sep 17 00:00:00 2001 From: helin wei Date: Tue, 2 Jul 2024 16:32:04 +0000 Subject: [PATCH 247/249] update noahmp table for hr4 --- .../SFC_Models/Land/Noahmp/noahmptable.tbl | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/physics/SFC_Models/Land/Noahmp/noahmptable.tbl b/physics/SFC_Models/Land/Noahmp/noahmptable.tbl index 3ffd5b532..44531919e 100644 --- a/physics/SFC_Models/Land/Noahmp/noahmptable.tbl +++ b/physics/SFC_Models/Land/Noahmp/noahmptable.tbl @@ -217,7 +217,7 @@ !--------------------------------------------------------------------------------------------------------------------------------------------------------------------- ch2op = 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, dleaf = 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, 0.04, - z0mvt = 1.09, 1.10, 0.85, 0.80, 0.80, 0.20, 0.06, 0.60, 0.50, 0.12, 0.30, 0.15, 1.00, 0.14, 0.00, 0.00, 0.00, 0.30, 0.20, 0.03, + z0mvt = 1.00, 1.50, 0.75, 0.90, 0.85, 0.20, 0.10, 0.90, 0.60, 0.20, 0.30, 0.25, 1.00, 0.25, 0.00, 0.015, 0.00, 0.30, 0.10, 0.05, hvt = 20.0, 20.0, 18.0, 16.0, 16.0, 1.10, 1.10, 13.0, 10.0, 1.00, 5.00, 2.00, 15.0, 1.50, 0.00, 0.00, 0.00, 4.00, 2.00, 0.50, hvb = 8.50, 8.00, 7.00, 11.5, 10.0, 0.10, 0.10, 0.10, 0.10, 0.05, 0.10, 0.10, 1.00, 0.10, 0.00, 0.00, 0.00, 0.30, 0.20, 0.10, z0mhvt= 0.0545, 0.055, 0.047, 0.050, 0.050, 0.182, 0.0545, 0.046, 0.050, 0.120, 0.060, 0.075, 0.067, 0.093, 0.000, 0.000, 0.000, 0.075, 0.100, 0.060, @@ -226,32 +226,34 @@ !mfsno = 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, 2.50, ! c. he 12/17/2020: optimized mfsno values dependent on land type based on evaluation with snotel swe and modis scf, surface albedo mfsno = 1.00, 1.00, 1.00, 1.00, 1.00, 2.00, 2.00, 2.00, 2.00, 2.00, 3.00, 3.00, 4.00, 4.00, 2.50, 3.00, 3.00, 3.50, 3.50, 3.50, +!mfsno = 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, 1.97, ! c. he 12/17/2020: optimized snow cover factor (m) in scf formulation to replace original constant 2.5*z0,z0=0.002m, based on evaluation with snotel swe and modis scf, surface albedo ! scffac = 0.008, 0.008, 0.008, 0.008, 0.008, 0.016, 0.016, 0.020, 0.020, 0.020, 0.020, 0.014, 0.042, 0.026, 0.030, 0.016, 0.030, 0.030, 0.030, 0.030, - scffac = 0.005, 0.005, 0.005, 0.005, 0.005, 0.008, 0.008, 0.010, 0.010, 0.010, 0.010, 0.007, 0.021, 0.013, 0.015, 0.008, 0.015, 0.015, 0.015, 0.015, + scffac = 0.005, 0.005, 0.005, 0.005, 0.005, 0.008, 0.008, 0.010, 0.010, 0.010, 0.010, 0.007, 0.021, 0.013, 0.015, 0.008, 0.015, 0.015, 0.015, 0.015, +! scffac = 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, 0.059, cbiom = 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, 0.02, ! row 1: vis ! row 2: near ir rhol_vis=0.07, 0.10, 0.07, 0.10, 0.10, 0.07, 0.07, 0.07, 0.10, 0.11, 0.105, 0.11, 0.00, 0.11, 0.00, 0.00, 0.00, 0.10, 0.10, 0.10, - rhol_nir=0.35, 0.45, 0.35, 0.45, 0.45, 0.35, 0.35, 0.35, 0.45, 0.58, 0.515, 0.58, 0.00, 0.58, 0.00, 0.00, 0.00, 0.45, 0.45, 0.45, + rhol_nir=0.35, 0.45, 0.35, 0.45, 0.45, 0.35, 0.35, 0.35, 0.45, 0.35, 0.515, 0.35, 0.00, 0.35, 0.00, 0.00, 0.00, 0.45, 0.45, 0.45, ! row 1: vis ! row 2: near ir - rhos_vis=0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.36, 0.26, 0.36, 0.00, 0.36, 0.00, 0.00, 0.00, 0.16, 0.16, 0.16, - rhos_nir=0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.58, 0.485, 0.58, 0.00, 0.58, 0.00, 0.00, 0.00, 0.39, 0.39, 0.39, + rhos_vis=0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.16, 0.31, 0.26, 0.31, 0.00, 0.31, 0.00, 0.00, 0.00, 0.16, 0.16, 0.16, + rhos_nir=0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.39, 0.53, 0.485, 0.53, 0.00, 0.53, 0.00, 0.00, 0.00, 0.39, 0.39, 0.39, ! row 1: vis ! row 2: near ir - taul_vis=0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.07, 0.06, 0.07, 0.00, 0.07, 0.00, 0.00, 0.00, 0.05, 0.05, 0.05, - taul_nir=0.10, 0.25, 0.10, 0.25, 0.25, 0.10, 0.10, 0.10, 0.25, 0.25, 0.25, 0.25, 0.00, 0.25, 0.00, 0.00, 0.00, 0.25, 0.25, 0.25, + taul_vis=0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.05, 0.06, 0.05, 0.00, 0.05, 0.00, 0.00, 0.00, 0.05, 0.05, 0.05, + taul_nir=0.10, 0.25, 0.10, 0.25, 0.25, 0.10, 0.10, 0.10, 0.25, 0.34, 0.25, 0.34, 0.00, 0.34, 0.00, 0.00, 0.00, 0.25, 0.25, 0.25, ! row 1: vis ! row 2: near ir - taus_vis=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.220, 0.1105, 0.220, 0.000, 0.220, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, - taus_nir=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.380, 0.1905, 0.380, 0.000, 0.380, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, + taus_vis=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.120, 0.1105, 0.120, 0.000, 0.120, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, + taus_nir=0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.001, 0.250, 0.1905, 0.250, 0.000, 0.250, 0.000, 0.000, 0.000, 0.001, 0.001, 0.001, - xl = 0.010, 0.010, 0.010, 0.250, 0.250, 0.010, 0.010, 0.010, 0.010, -0.30, -0.025, -0.30, 0.000, -0.30, 0.000, 0.000, 0.000, 0.250, 0.250, 0.250, + xl = 0.010, 0.10, 0.010, 0.250, 0.250, 0.010, 0.010, 0.010, 0.010, -0.30, -0.025, -0.30, 0.000, -0.30, 0.000, 0.000, 0.000, 0.250, 0.250, 0.250, ! make cwpvt vegetation dependent according to j. goudriaan, crop micrometeorology: a simulation study (simulation monographs), 1977). c. he, 12/17/2020 ! cwpvt = 0.18, 0.67, 0.18, 0.67, 0.29, 1.0, 2.0, 1.3, 1.0, 5.0, 1.17, 1.67, 1.67, 1.67, 0.18, 0.18, 0.18, 0.67, 1.0, 0.18, cwpvt = 0.09, 0.335, 0.09, 0.335, 0.145, 0.5, 1.0, 0.65, 0.5, 2.5, 0.585, 0.835, 0.835, 0.835, 0.09, 0.09, 0.09, 0.335, 0.5, 0.09, @@ -335,10 +337,10 @@ !-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- ! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 soil color index for soil albedo !-------------------------------------------------------------------------------------------------------------------------------------------------------------------------- - albsat_vis = 0.25, 0.23, 0.21, 0.20, 0.19, 0.18, 0.17, 0.16, 0.15, 0.14, 0.13, 0.12, 0.11, 0.10, 0.09, 0.08, 0.07, 0.06, 0.05, 0.04 ! saturated soil albedos - albsat_nir = 0.50, 0.46, 0.42, 0.40, 0.38, 0.36, 0.34, 0.32, 0.30, 0.28, 0.26, 0.24, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.08 ! saturated soil albedos - albdry_vis = 0.36, 0.34, 0.32, 0.31, 0.30, 0.29, 0.28, 0.27, 0.26, 0.25, 0.24, 0.23, 0.22, 0.20, 0.18, 0.16, 0.14, 0.12, 0.10, 0.08 ! dry soil albedos - albdry_nir = 0.61, 0.57, 0.53, 0.51, 0.49, 0.48, 0.45, 0.43, 0.41, 0.39, 0.37, 0.35, 0.33, 0.31, 0.29, 0.27, 0.25, 0.23, 0.21, 0.16 ! dry soil albedos + albsat_vis = 0.21, 0.20, 0.18, 0.17, 0.16, 0.15, 0.14, 0.13, 0.13, 0.12, 0.11, 0.10, 0.10, 0.09, 0.08, 0.08, 0.08, 0.07, 0.07, 0.06 ! saturated soil albedos + albsat_nir = 0.42, 0.40, 0.36, 0.34, 0.32, 0.30, 0.28, 0.26, 0.26, 0.24, 0.22, 0.20, 0.20, 0.18, 0.16, 0.16, 0.16, 0.14, 0.14, 0.13 ! saturated soil albedos + albdry_vis = 0.31, 0.30, 0.28, 0.27, 0.26, 0.24, 0.23, 0.22, 0.22, 0.22, 0.20, 0.19, 0.20, 0.18, 0.16, 0.16, 0.16, 0.14, 0.14, 0.13 ! dry soil albedos + albdry_nir = 0.52, 0.50, 0.46, 0.44, 0.42, 0.40, 0.38, 0.37, 0.36, 0.34, 0.32, 0.30, 0.30, 0.28, 0.27, 0.27, 0.27, 0.26, 0.25, 0.25 ! dry soil albedos albice = 0.80, 0.55 ! albedo land ice: 1=vis, 2=nir alblak = 0.60, 0.40 ! albedo frozen lakes: 1=vis, 2=nir omegas = 0.8 , 0.4 ! two-stream parameter omega for snow @@ -397,7 +399,7 @@ class_sno_age = 3600.0 ! snow aging e-folding time (s) in class albedo scheme class_alb_new = 0.84 ! fresh snow albedo in class scheme psiwlt = -150.0 !metric potential for wilting point (m) - z0soil = 0.002 ! bare-soil roughness length (m) (i.e., under the canopy) + z0soil = 0.015 ! bare-soil roughness length (m) (i.e., under the canopy) z0lake = 0.01 ! lake surface roughness length (m) / From 1e9b0dd6c9c9da577349e02c1bb6fc912d29ceba Mon Sep 17 00:00:00 2001 From: Lisa Bengtsson Date: Tue, 16 Jul 2024 16:20:14 +0000 Subject: [PATCH 248/249] address seg fault if progsigma=F --- physics/CONV/SAMF/samfdeepcnv.f | 33 +++++++++++++++----------- physics/CONV/SAMF/samfshalcnv.f | 42 +++++++++++++++++---------------- 2 files changed, 41 insertions(+), 34 deletions(-) diff --git a/physics/CONV/SAMF/samfdeepcnv.f b/physics/CONV/SAMF/samfdeepcnv.f index be43795b4..3ad067657 100644 --- a/physics/CONV/SAMF/samfdeepcnv.f +++ b/physics/CONV/SAMF/samfdeepcnv.f @@ -215,7 +215,8 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & ! ! parameters for prognostic sigma closure real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), - & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km) + & omegac(im),zeta(im,km),dbyo1(im,km),sigmab(im),qadv(im,km), + & sigmaoutx(im) real(kind=kind_phys) gravinv,invdelt,sigmind,sigminm,sigmins parameter(sigmind=0.01,sigmins=0.03,sigminm=0.01) logical flag_shallow, flag_mid @@ -3423,24 +3424,28 @@ subroutine samfdeepcnv_run (im,km,first_time_step,restart, & endif enddo c -c convective cloud water +! + if(progsigma)then + do i = 1, im + sigmaoutx(i)=max(sigmaout(i,1),0.0) + sigmaoutx(i)=min(sigmaoutx(i),1.0) + enddo + endif c !> - Calculate convective cloud water. do k = 1, km - do i = 1, im - if (cnvflg(i) .and. rn(i) > 0.) then - if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - if(progsigma)then - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 - else - cnvw(i,k)=cnvw(i,k)*sigmagfm(i) + do i = 1, im + if (cnvflg(i) .and. rn(i) > 0.) then + if (k >= kbcon(i) .and. k < ktcon(i)) then + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + if(progsigma)then + cnvw(i,k) = cnvw(i,k) * sigmaoutx(i) + else + cnvw(i,k) = cnvw(i,k) * sigmagfm(i) + endif endif endif - endif - enddo + enddo enddo c c convective cloud cover diff --git a/physics/CONV/SAMF/samfshalcnv.f b/physics/CONV/SAMF/samfshalcnv.f index fa9d77a53..ce783ea15 100644 --- a/physics/CONV/SAMF/samfshalcnv.f +++ b/physics/CONV/SAMF/samfshalcnv.f @@ -162,7 +162,7 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & ! parameters for prognostic sigma closure real(kind=kind_phys) omega_u(im,km),zdqca(im,km),tmfq(im,km), & omegac(im),zeta(im,km),dbyo1(im,km), - & sigmab(im),qadv(im,km) + & sigmab(im),qadv(im,km),sigmaoutx(im) real(kind=kind_phys) gravinv,dxcrtas,invdelt,sigmind,sigmins, & sigminm logical flag_shallow,flag_mid @@ -2397,27 +2397,29 @@ subroutine samfshalcnv_run(im,km,itc,ntc,cliq,cp,cvap, & endif enddo c -c convective cloud water -c -!> - Calculate shallow convective cloud water. + if(progsigma)then + do i = 1, im + sigmaoutx(i)=max(sigmaout(i,1),0.0) + sigmaoutx(i)=min(sigmaoutx(i),1.0) + enddo + endif + +c convective cloud water do k = 1, km - do i = 1, im - if (cnvflg(i)) then - if (k >= kbcon(i) .and. k < ktcon(i)) then - cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 - if(progsigma)then - tem=max(sigmaout(i,k),0.) - tem1=min(tem,1.0) - cnvw(i,k)=cnvw(i,k)*tem1 - else - cnvw(i,k)=cnvw(i,k)*sigmagfm(i) - endif - endif - endif - enddo + do i = 1, im + if (cnvflg(i)) then + if (k >= kbcon(i) .and. k < ktcon(i)) then + cnvw(i,k) = cnvwt(i,k) * xmb(i) * dt2 + if (progsigma) then + cnvw(i,k) = cnvw(i,k) * sigmaoutx(i) + else + cnvw(i,k) = cnvw(i,k) * sigmagfm(i) + endif + endif + endif + enddo enddo - -c +c c convective cloud cover c !> - Calculate convective cloud cover, which is used when pdf-based cloud fraction is used (i.e., pdfcld=.true.). From 35b15e3c499d6fa3ca742fa3f662286b2dd94990 Mon Sep 17 00:00:00 2001 From: helin wei Date: Tue, 16 Jul 2024 17:31:40 +0000 Subject: [PATCH 249/249] remove unnecessary comments for the snow temperature initialization --- .../UFS_SCM_NEPTUNE/GFS_phys_time_vary.fv3.F90 | 14 -------------- 1 file changed, 14 deletions(-) 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 c5e9c8dd9..08d1d0b49 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 @@ -594,22 +594,8 @@ subroutine GFS_phys_time_vary_init ( isnow = nint(snowxy(ix))+1 ! snowxy <=0.0, dzsno >= 0.0 ! using stc and tgxy to linearly interpolate the snow temp for each layer -!Calculate the total thickness -! total_thickness = sum(dzsno) -! Calculate the temperature difference -! temp_diff=tgxy(ix)-stc(ix,1) -! Calculate the mid-points and interpolate temperatures for each layer -! accumulated_thickness = 0.0 -! do is = isnow, 0 -! accumulated_thickness = accumulated_thickness + dzsno(is) -! mid_points(is) = accumulated_thickness - dzsno(is) / 2.0 -! layer_temp = tgxy(ix) + (mid_points(is) / total_thickness) * temp_diff -! tsnoxy(ix,is) = layer_temp -! end do do is = isnow,0 -! tsnoxy(ix,is) = tgxy(ix) -! tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(tgxy(ix)-stc(ix,1)) tsnoxy(ix,is) = tgxy(ix) + (( sum(dzsno(isnow:is)) -0.5*dzsno(is) )/snd)*(stc(ix,1)-tgxy(ix)) snliqxy(ix,is) = zero snicexy(ix,is) = one * dzsno(is) * weasd(ix)/snd