From f0e2f0d9c76c5c6378c1a2722a4c33f5355e8cb6 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 22 Sep 2022 20:29:45 +0000 Subject: [PATCH 1/6] module_sf_ruclsm workaround needed for subnormal numbers (gfortran issue during DEBUG=ON) --- physics/module_sf_ruclsm.F90 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 6dda912c4..32231c361 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -584,6 +584,15 @@ SUBROUTINE LSMRUC(xlat,xlon, & DO i=its,ite + IF(ABS(SNOWH(I,J))<1e-20) THEN + ! Workaround needed for subnormal numbers (gfortran issue) + SNOWH(I,J)=0 + ENDIF + IF(ABS(SNOW(I,J))<1e-20) THEN + ! Workaround needed for subnormal numbers (gfortran issue) + SNOW(I,J)=0 + ENDIF + IF (debug_print ) THEN if (abs(xlat-testptlat).lt.0.2 .and. & abs(xlon-testptlon).lt.0.2)then From fe57174580d786c82d22ebbf7ffba643755119e0 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 23 Sep 2022 20:40:23 +0000 Subject: [PATCH 2/6] move snow sanity check to sanity check regions of lsm_ruc, and apply to "snow on ice" as well --- physics/lsm_ruc.F90 | 27 +++++++++++++++++++++++++++ physics/module_sf_ruclsm.F90 | 9 --------- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/physics/lsm_ruc.F90 b/physics/lsm_ruc.F90 index d206308cb..d32604d3f 100644 --- a/physics/lsm_ruc.F90 +++ b/physics/lsm_ruc.F90 @@ -1115,6 +1115,20 @@ subroutine lsm_ruc_run & ! inputs z0_lnd(i,j) = z0rl_lnd(i)/100. znt_lnd(i,j) = z0rl_lnd(i)/100. + ! Workaround needed for subnormal numbers. This should be + ! done after all other sanity checks, in case a sanity check + ! results in subnormal numbers. + ! + ! This bug was caught by the UFS gfortran debug-mode + ! regression tests, and the fix is necessary to pass those + ! tests. + if(abs(snowh_lnd(i,j))<1e-20) then + snowh_lnd(i,j)=0 + endif + if(abs(sneqv_lnd(i,j))<1e-20) then + sneqv_lnd(i,j)=0 + endif + !if (debug_print) then !-- diagnostics for a land test point with known lat/lon if (kdt < 10) then @@ -1417,6 +1431,19 @@ subroutine lsm_ruc_run & ! inputs z0_ice(i,j) = z0rl_ice(i)/100. znt_ice(i,j) = z0rl_ice(i)/100. + ! Workaround needed for subnormal numbers. This should be + ! done after all other sanity checks, in case a sanity check + ! results in subnormal numbers. + ! + ! Although this bug has not been triggered yet, it is expected + ! to be, like the _lnd variants many lines up from here. + if(abs(snowh_ice(i,j))<1e-20) then + snowh_ice(i,j)=0 + endif + if(abs(sneqv_ice(i,j))<1e-20) then + sneqv_ice(i,j)=0 + endif + !> - Call RUC LSM lsmruc() for ice. call lsmruc(xlat_d(i),xlon_d(i), & & delt, flag_init, lsm_cold_start, kdt, iter, nsoil, & diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 32231c361..6dda912c4 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -584,15 +584,6 @@ SUBROUTINE LSMRUC(xlat,xlon, & DO i=its,ite - IF(ABS(SNOWH(I,J))<1e-20) THEN - ! Workaround needed for subnormal numbers (gfortran issue) - SNOWH(I,J)=0 - ENDIF - IF(ABS(SNOW(I,J))<1e-20) THEN - ! Workaround needed for subnormal numbers (gfortran issue) - SNOW(I,J)=0 - ENDIF - IF (debug_print ) THEN if (abs(xlat-testptlat).lt.0.2 .and. & abs(xlon-testptlon).lt.0.2)then From 5ded667940f81b8cc9597a796138d50378b9d57f Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 28 Sep 2022 20:11:16 +0000 Subject: [PATCH 3/6] thread and other bug fixes --- physics/smoke/module_add_emiss_burn.F90 | 10 +++----- physics/smoke/module_plumerise1.F90 | 17 ++++++------- physics/smoke/module_smoke_plumerise.F90 | 28 +++++++++------------ physics/smoke/module_zero_plumegen_coms.F90 | 24 ++++++------------ physics/smoke/rrfs_smoke_wrapper.F90 | 19 +++++--------- physics/smoke/rrfs_smoke_wrapper.meta | 6 ++--- physics/smoke/seas_mod.F90 | 4 +-- 7 files changed, 42 insertions(+), 66 deletions(-) diff --git a/physics/smoke/module_add_emiss_burn.F90 b/physics/smoke/module_add_emiss_burn.F90 index f93e813ab..c5c650cb8 100755 --- a/physics/smoke/module_add_emiss_burn.F90 +++ b/physics/smoke/module_add_emiss_burn.F90 @@ -6,7 +6,7 @@ module module_add_emiss_burn use machine , only : kind_phys use rrfs_smoke_config CONTAINS - subroutine add_emis_burn(dtstep,ktau,dz8w,rho_phy,rel_hum, & + subroutine add_emis_burn(dtstep,dz8w,rho_phy,rel_hum, & chem,julday,gmt,xlat,xlong, & !luf_igbp,lu_fire1, & vegtype,vfrac,peak_hr, & @@ -24,7 +24,7 @@ subroutine add_emis_burn(dtstep,ktau,dz8w,rho_phy,rel_hum, & ! TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags - INTEGER, INTENT(IN ) :: ktau, julday, & + INTEGER, INTENT(IN ) :: julday, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte @@ -172,9 +172,8 @@ subroutine add_emis_burn(dtstep,ktau,dz8w,rho_phy,rel_hum, & 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 (ktau<1000 .and. dbg_opt) then ! if ( k==kts ) then - ! WRITE(6,*) 'add_emiss_burn: ktau,gmt,dtstep,time_int ',ktau,gmt,dtstep,time_int + ! 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) @@ -186,7 +185,6 @@ subroutine add_emis_burn(dtstep,ktau,dz8w,rho_phy,rel_hum, & 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 - endif enddo enddo @@ -208,7 +206,7 @@ subroutine add_emis_burn(dtstep,ktau,dz8w,rho_phy,rel_hum, & enddo enddo - IF ( ktau<2000 .and. dbg_opt ) then + 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) diff --git a/physics/smoke/module_plumerise1.F90 b/physics/smoke/module_plumerise1.F90 index e03e60bc2..3c23faa6a 100755 --- a/physics/smoke/module_plumerise1.F90 +++ b/physics/smoke/module_plumerise1.F90 @@ -37,7 +37,7 @@ module module_plumerise1 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,ktau,g,con_cp,con_rd, & ! scale_fire_emiss is part of config_flags + z_at_w,z,g,con_cp,con_rd, & ! scale_fire_emiss is part of config_flags plume_frp, k_min, k_max, & ! RAR: ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & @@ -56,8 +56,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & ! TYPE(grid_config_rec_type), INTENT(IN ) :: config_flags character(*), intent(inout) :: errmsg integer, intent(inout) :: errflg - INTEGER, INTENT(IN ) :: ktau, & - ids,ide, jds,jde, kds,kde, & + INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ! real(kind=kind_phys), DIMENSION( ims:ime, kms:kme, jms:jme, num_moist ), & @@ -112,7 +111,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & cpor =con_cp/con_rd con_rocp=con_rd/con_cp - IF ( dbg_opt .and. ktau<2000) then + 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 @@ -133,7 +132,6 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & ! For now the flammable fraction is constant, based on the namelist. The next ! step to use LU index and meteorology to parameterize it -! IF (ktau==2) THEN do j=jts,jte do i=its,ite flam_frac(i,j)= 0. @@ -142,7 +140,6 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & end if enddo enddo - ! ENDIF ! RAR: new FRP based approach @@ -172,7 +169,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & !theta_in(k)= t_phy(i,k,j)/pi_in(k)*cp enddo - IF (dbg_opt .and. ktau<2000) then + 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: ebu(i,kts,j) ',ebu(i,kts,j) @@ -188,9 +185,9 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & 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), & - k_max(i,j), ktau, dbg_opt, g, con_cp, & + k_max(i,j), dbg_opt, g, con_cp, & con_rd, cpor, errmsg, errflg ) - !k_max(i,j), ktau, config_flags%debug_chem ) + !k_max(i,j), config_flags%debug_chem ) if(errflg/=0) return kp1= k_min(i,j) @@ -202,7 +199,7 @@ subroutine ebu_driver ( flam_frac,ebb_smoke,ebu, & enddo ebu(i,kts,j)= (1.-flam_frac(i,j))* ebb_smoke(i,j) - IF ( dbg_opt .and. ktau<2000) then + 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 diff --git a/physics/smoke/module_smoke_plumerise.F90 b/physics/smoke/module_smoke_plumerise.F90 index d1f30e57e..a895b0b8e 100755 --- a/physics/smoke/module_smoke_plumerise.F90 +++ b/physics/smoke/module_smoke_plumerise.F90 @@ -28,7 +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, & - frp_inst,k1,k2, ktau, dbg_opt, g, cp, rgas, & + frp_inst,k1,k2, dbg_opt, g, cp, rgas, & cpor, errmsg, errflg ) implicit none @@ -43,7 +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 - INTEGER, INTENT (IN) :: ktau INTEGER, INTENT (OUT) :: k1,k2 character(*), intent(inout) :: errmsg integer, intent(inout) :: errflg @@ -103,9 +102,6 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & !---------------------------------------------------------------------- ! print *,' Plumerise_scalar 1',ncall coms => get_thread_coms() - if (ktau==2) then - call coms%set_to_zero() - endif IF (frp_inst=k1+1 @@ -205,7 +199,7 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & ! enddo !enddo - IF (dbg_opt .AND. ktau<2000) then + 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) @@ -217,7 +211,7 @@ subroutine plumerise(m1,m2,m3,ia,iz,ja,jz, & end subroutine plumerise !------------------------------------------------------------------------- -subroutine get_env_condition(coms,k1,k2,kmt,wind_eff,ktau,g,cp,rgas,cpor,errmsg,errflg) +subroutine get_env_condition(coms,k1,k2,kmt,wind_eff,g,cp,rgas,cpor,errmsg,errflg) !se module_zero_plumegen_coms !use rconstants @@ -229,11 +223,11 @@ subroutine get_env_condition(coms,k1,k2,kmt,wind_eff,ktau,g,cp,rgas,cpor,errmsg, real(kind=kind_phys),parameter :: p00=p1000mb real(kind=kind_phys) :: znz,themax,tlll,plll,rlll,zlll,dzdd,dzlll,tlcl,plcl,dzlcl,dummy !integer :: n_setgrid = 0 -integer :: wind_eff,ktau +integer :: wind_eff character(*), intent(inout) :: errmsg integer, intent(inout) :: errflg -if(ktau==2) then +if(.not.coms%initialized) then ! n_setgrid = 1 call set_grid(coms) ! define vertical grid of plume model ! coms%zt(k) = thermo and water levels @@ -345,6 +339,8 @@ subroutine set_grid(coms) coms%dzt(k) = 1. / (coms%zm(k) - coms%zm(k-1)) enddo coms%dzt(1) = coms%dzt(2) * coms%dzt(2) / coms%dzt(3) + +coms%initialized = .true. ! coms%dzm(1) = 0.5/coms%dz ! coms%dzm(2:mzp) = 1./coms%dz diff --git a/physics/smoke/module_zero_plumegen_coms.F90 b/physics/smoke/module_zero_plumegen_coms.F90 index 622d6a813..92b9ca2dc 100755 --- a/physics/smoke/module_zero_plumegen_coms.F90 +++ b/physics/smoke/module_zero_plumegen_coms.F90 @@ -9,6 +9,8 @@ module module_zero_plumegen_coms integer, parameter :: nkp = 200, ntime = 200 type plumegen_coms + logical :: initialized = .false. + real(kind=kind_phys),dimension(nkp) :: w,t,qv,qc,qh,qi,sc, & ! blob vth,vti,rho,txs, & est,qsat! never used: ,qpas,qtotal @@ -55,38 +57,28 @@ module module_zero_plumegen_coms procedure :: set_to_zero => plumegen_coms_zero end type plumegen_coms - interface plumegen_coms - procedure :: plumegen_coms_constructor - end interface plumegen_coms - - type(plumegen_coms), private, target :: private_thread_coms - logical, private :: mzpc_initialized = .false. + type(plumegen_coms), private, pointer :: private_thread_coms !$OMP THREADPRIVATE(private_thread_coms) -!$OMP THREADPRIVATE(mzpc_initialized) contains function get_thread_coms() result(coms) implicit none class(plumegen_coms), pointer :: coms - if(.not.mzpc_initialized) then - private_thread_coms = plumegen_coms() - mzpc_initialized = .true. + if(.not.associated(private_thread_coms)) then + allocate(private_thread_coms) + call plumegen_coms_zero(private_thread_coms) endif coms => private_thread_coms end function get_thread_coms - type(plumegen_coms) function plumegen_coms_constructor() result(this) - implicit none - call plumegen_coms_zero(this) - this%testval=3314 - end function plumegen_coms_constructor - subroutine plumegen_coms_zero(this) implicit none class(plumegen_coms) :: this + this%initialized = .false. + this%w=0.0 this%t=0.0 this%qv=0.0 diff --git a/physics/smoke/rrfs_smoke_wrapper.F90 b/physics/smoke/rrfs_smoke_wrapper.F90 index 03dedaff1..8bc7a638f 100755 --- a/physics/smoke/rrfs_smoke_wrapper.F90 +++ b/physics/smoke/rrfs_smoke_wrapper.F90 @@ -171,7 +171,6 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, wetdep_ls_opt = wetdep_ls_opt_in wetdep_ls_alpha = wetdep_ls_alpha_in - !print*,'hli ktau',ktau ! -- set domain ide=im ime=im @@ -218,7 +217,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !>- get ready for chemistry run call rrfs_smoke_prep( & - ktau, current_month, current_hour, gmt, & + current_month, current_hour, gmt, & 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, & @@ -290,7 +289,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, !>- compute sea-salt ! -- compute sea salt (opt=2) if (seas_opt == 2) then - call gocart_seasalt_driver(ktau,dt,rri,t_phy,moist, & + call gocart_seasalt_driver(dt,rri,t_phy,moist, & u_phy,v_phy,chem,rho_phy,dz8w,u10,v10,ust,p8w,tsk, & xland,xlat,xlong,dxy,g,emis_seas,pi, & seashelp,num_emis_seas,num_moist,num_chem,seas_opt, & @@ -320,12 +319,11 @@ 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 (call_fire) then -! WRITE(*,*) 'plumerise is called at ktau= ',ktau call ebu_driver ( & flam_frac,ebu_in,ebu, & t_phy,moist(:,:,:,p_qv), & rho_phy,vvel,u_phy,v_phy,p_phy, & - z_at_w,zmid,ktau,g,con_cp,con_rd, & + z_at_w,zmid,g,con_cp,con_rd, & plume_frp, min_fplume2, max_fplume2, & ! new approach ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & @@ -335,7 +333,7 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, ! -- add biomass burning emissions at every timestep if (addsmoke_flag == 1) then - call add_emis_burn(dt,ktau,dz8w,rho_phy,rel_hum,chem, & + call add_emis_burn(dt,dz8w,rho_phy,rel_hum,chem, & julday,gmt,xlat,xlong, & ivgtyp, vegfrac, peak_hr, & ! RAR curr_secs,ebu, & @@ -345,7 +343,6 @@ 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 -! WRITE(*,*) 'after add_emis_burn at ktau= ',ktau !>-- compute dry deposition if (drydep_opt == 1) then @@ -362,7 +359,6 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, else ddvel_inout(:,:)=0. endif -! WRITE(*,*) 'dry depostion is done at ktau= ',ktau !>- large-scale wet deposition if (wetdep_ls_opt == 1) then @@ -414,7 +410,6 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, enddo !------------------------------------- !-- to output for diagnostics -! WRITE(*,*) 'rrfs nwfa/nifa 1 at ktau= ',ktau do i = 1, im emseas (i) = emis_seas (i,1,1,1)*1.e+9 ! size bin 1 sea salt emission: ug/m2/s emdust (i) = emis_dust (i,1,1,1) ! size bin 1 dust emission : ug/m2/s @@ -429,7 +424,6 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, fire_in(i,10) = peak_hr(i,1) enddo -! WRITE(*,*) 'rrfs nwfa/nifa 2 at ktau= ',ktau !-- to provide real aerosol emission for Thompson MP if (imp_physics == imp_physics_thompson .and. aero_ind_fdb) then fact_wfa = 1.e-9*6.0/pi*exp(4.5*log(sigma1)**2)/mean_diameter1**3 @@ -455,12 +449,11 @@ subroutine rrfs_smoke_wrapper_run(im, kte, kme, ktau, dt, garea, land, jdate, enddo enddo endif -! WRITE(*,*) 'rrfs smoke wrapper is done at ktau= ',ktau end subroutine rrfs_smoke_wrapper_run subroutine rrfs_smoke_prep( & - ktau,current_month,current_hour,gmt, & + current_month,current_hour,gmt, & 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, & @@ -482,7 +475,7 @@ subroutine rrfs_smoke_prep( & its,ite, jts,jte, kts,kte) !Chem input configuration - integer, intent(in) :: ktau, current_month, current_hour, hour_int + integer, intent(in) :: current_month, current_hour, hour_int !FV3 input variables integer, intent(in) :: nsoil diff --git a/physics/smoke/rrfs_smoke_wrapper.meta b/physics/smoke/rrfs_smoke_wrapper.meta index d7ca92e43..1a5398178 100755 --- a/physics/smoke/rrfs_smoke_wrapper.meta +++ b/physics/smoke/rrfs_smoke_wrapper.meta @@ -614,10 +614,10 @@ kind = kind_phys intent = in [fire_in] - standard_name = smoke_fire_auxeliary_input - long_name = smoke fire auxeliary input variables + standard_name = smoke_fire_auxiliary_input + long_name = smoke fire auxiliary input variables units = various - dimensions = (horizontal_loop_extent,10) + dimensions = (horizontal_loop_extent,fire_auxiliary_data_extent) type = real kind = kind_phys intent = inout diff --git a/physics/smoke/seas_mod.F90 b/physics/smoke/seas_mod.F90 index 6d58b6507..935b64513 100755 --- a/physics/smoke/seas_mod.F90 +++ b/physics/smoke/seas_mod.F90 @@ -25,7 +25,7 @@ module seas_mod CONTAINS - subroutine gocart_seasalt_driver(ktau,dt,alt,t_phy,moist,u_phy, & + subroutine gocart_seasalt_driver(dt,alt,t_phy,moist,u_phy, & v_phy,chem,rho_phy,dz8w,u10,v10,ustar,p8w,tsk, & xland,xlat,xlong,area,g,emis_seas,pi, & seashelp,num_emis_seas,num_moist,num_chem,seas_opt, & @@ -33,7 +33,7 @@ subroutine gocart_seasalt_driver(ktau,dt,alt,t_phy,moist,u_phy, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte ) - INTEGER, INTENT(IN ) :: ktau,num_emis_seas,num_moist,num_chem, & + INTEGER, INTENT(IN ) :: num_emis_seas,num_moist,num_chem, & ids,ide, jds,jde, kds,kde, & ims,ime, jms,jme, kms,kme, & its,ite, jts,jte, kts,kte,seas_opt From b2070f2e54c33226dbfb904355c7ac9d79cc70ac Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Wed, 28 Sep 2022 21:50:27 +0000 Subject: [PATCH 4/6] module_bl_mynn was sending unallocated arrays to mynn_mix_chem when rrfs_sd=.false. --- physics/module_bl_mynn.F90 | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/physics/module_bl_mynn.F90 b/physics/module_bl_mynn.F90 index 8dce1a7b5..464890ad6 100644 --- a/physics/module_bl_mynn.F90 +++ b/physics/module_bl_mynn.F90 @@ -1350,6 +1350,7 @@ SUBROUTINE mynn_bl_driver( & IF ( mix_chem ) THEN + IF ( rrfs_sd ) THEN CALL mynn_mix_chem(kts,kte,i, & &delt, dz1, pblh(i), & &nchem, kdvel, ndvel, & @@ -1361,7 +1362,19 @@ SUBROUTINE mynn_bl_driver( & &emis_ant_no(i), & &frp(i), rrfs_sd, & &enh_mix, smoke_dbg ) - + ELSE + CALL mynn_mix_chem(kts,kte,i, & + &delt, dz1, pblh(i), & + &nchem, kdvel, ndvel, & + &chem1, vd1, & + &rho1,flt, & + &tcd, qcd, & + &dfh, & + &s_aw1,s_awchem1, & + &zero, & + &zero, rrfs_sd, & + &enh_mix, smoke_dbg ) + ENDIF DO ic = 1,nchem DO k = kts,kte chem3d(i,k,ic) = max(1.e-12, chem1(k,ic)) From 4561826cbd313e9a48dbcba71ca8881e07ce33ea Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Thu, 29 Sep 2022 16:03:00 +0000 Subject: [PATCH 5/6] put a wordy debug message behind dbg_opt --- physics/smoke/module_add_emiss_burn.F90 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physics/smoke/module_add_emiss_burn.F90 b/physics/smoke/module_add_emiss_burn.F90 index c5c650cb8..ff53f7413 100755 --- a/physics/smoke/module_add_emiss_burn.F90 +++ b/physics/smoke/module_add_emiss_burn.F90 @@ -180,7 +180,7 @@ subroutine add_emis_burn(dtstep,dz8w,rho_phy,rel_hum, & ! 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 ( k==kts .OR. k==kfire_max ) then + 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 From ac34369ab0d1e71b8b92572cc363a1ba83be6004 Mon Sep 17 00:00:00 2001 From: "samuel.trahan" Date: Fri, 30 Sep 2022 21:37:06 +0000 Subject: [PATCH 6/6] remove old precision fix from physics/module_sf_ruclsm.F90 --- physics/module_sf_ruclsm.F90 | 9 --------- 1 file changed, 9 deletions(-) diff --git a/physics/module_sf_ruclsm.F90 b/physics/module_sf_ruclsm.F90 index 32231c361..6dda912c4 100644 --- a/physics/module_sf_ruclsm.F90 +++ b/physics/module_sf_ruclsm.F90 @@ -584,15 +584,6 @@ SUBROUTINE LSMRUC(xlat,xlon, & DO i=its,ite - IF(ABS(SNOWH(I,J))<1e-20) THEN - ! Workaround needed for subnormal numbers (gfortran issue) - SNOWH(I,J)=0 - ENDIF - IF(ABS(SNOW(I,J))<1e-20) THEN - ! Workaround needed for subnormal numbers (gfortran issue) - SNOW(I,J)=0 - ENDIF - IF (debug_print ) THEN if (abs(xlat-testptlat).lt.0.2 .and. & abs(xlon-testptlon).lt.0.2)then