Skip to content

Commit

Permalink
Merge pull request #9 from cacraigucar/cam_nt2_bigg
Browse files Browse the repository at this point in the history
Cam nt2 bigg
  • Loading branch information
Katetc authored May 24, 2022
2 parents 611b963 + 96c6dd3 commit 95b49dd
Show file tree
Hide file tree
Showing 2 changed files with 141 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Externals_CAM.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ required = True
local_path = src/physics/pumas
protocol = git
repo_url = https://github.com/ESCOMP/PUMAS
tag = pumas_cam-release_v1.22
tag = pumas_cam-release_v1.23
required = True

[pumas-frozen]
Expand Down
154 changes: 140 additions & 14 deletions src/physics/cam_dev/micro_pumas_cam.F90
Original file line number Diff line number Diff line change
Expand Up @@ -1005,31 +1005,52 @@ subroutine micro_pumas_cam_init(pbuf2d)
call addfld ('VAPDEPSO', (/ 'lev' /), 'A', 'kg/kg/s', 'Vapor deposition onto snow' )
call addfld ('MELTSDT', (/ 'lev' /), 'A', 'W/kg', 'Latent heating rate due to melting of snow' )
call addfld ('FRZRDT', (/ 'lev' /), 'A', 'W/kg', 'Latent heating rate due to homogeneous freezing of rain' )
call addfld ('NNUCCCO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Immersion freezing of cloud water')
call addfld ('NNUCCTO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Contact freezing of cloud water')
call addfld ('NNUCCDO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Ice nucleation')
call addfld ('NNUDEPO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Deposition Nucleation')
call addfld ('NHOMO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Homogeneous freezing of cloud water')
call addfld ('NNUCCRO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to heterogeneous freezing of rain to snow')
call addfld ('NNUCCRIO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Heterogeneous freezing of rain to ice')
call addfld ('NSACWIO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Ice Multiplication- Rime-splintering')
call addfld ('NPRAO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Accretion of cloud water by rain')
call addfld ('NPSACWSO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Accretion of cloud water by snow')
call addfld ('NPRAIO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Accretion of cloud ice to snow')
call addfld ('NPRACSO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Accretion of rain by snow')
call addfld ('NPRCO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Autoconversion of cloud water [to rain]')
call addfld ('NPRCIO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Autoconversion of cloud ice to snow')
call addfld ('NCSEDTEN', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to cloud liquid sedimentation')
call addfld ('NISEDTEN', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to cloud ice sedimentation')
call addfld ('NRSEDTEN', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to rain sedimentation')
call addfld ('NSSEDTEN', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to snow sedimentation')
call addfld ('NMELTO', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Melting of cloud ice ')
call addfld ('NMELTS', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Melting of snow')
if (micro_mg_version > 1) then
call addfld ('QRSEDTEN', (/ 'lev' /), 'A', 'kg/kg/s', 'Rain mixing ratio tendency from sedimentation' )
call addfld ('QSSEDTEN', (/ 'lev' /), 'A', 'kg/kg/s', 'Snow mixing ratio tendency from sedimentation' )
end if


if (micro_mg_version > 2) then

call addfld ('PSACRO', (/ 'lev' /), 'A', 'kg/kg/s', 'Collisions between rain & snow (Graupel collecting snow)')
call addfld ('NMELTG', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to Melting of graupel')
call addfld ('NGSEDTEN', (/ 'lev' /), 'A', '#/kg/s', 'Number Tendency due to graupel sedimentation')
call addfld ('PSACRO', (/ 'lev' /), 'A', 'kg/kg/s', 'Collisions between rain & snow (Graupel collecting snow)')
call addfld ('PRACGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Change in q collection rain by graupel' )
call addfld ('PSACWGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Change in q collection droplets by graupel' )
call addfld ('PGSACWO', (/ 'lev' /), 'A', 'kg/kg/s', 'Q conversion to graupel due to collection droplets by snow')
call addfld ('PGSACWO', (/ 'lev' /), 'A', 'kg/kg/s', 'Q conversion to graupel due to collection droplets by snow')
call addfld ('PGRACSO', (/ 'lev' /), 'A', 'kg/kg/s', 'Q conversion to graupel due to collection rain by snow')
call addfld ('PRDGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Deposition of graupel')
call addfld ('QMULTGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Q change due to ice mult droplets/graupel')
call addfld ('QMULTRGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Q change due to ice mult rain/graupel')
call addfld ('QGSEDTEN', (/ 'lev' /), 'A', 'kg/kg/s', 'Graupel/Hail mixing ratio tendency from sedimentation')
call addfld ('NPRACGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Change N collection rain by graupel')
call addfld ('NSCNGO', (/'lev'/),'A','kg/kg/s','Change N conversion to graupel due to collection droplets by snow')
call addfld ('NGRACSO',(/'lev'/),'A','kg/kg/s','Change N conversion to graupel due to collection rain by snow')
call addfld ('NMULTGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Ice mult due to acc droplets by graupel ')
call addfld ('NMULTRGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Ice mult due to acc rain by graupel')
call addfld ('NPSACWGO', (/ 'lev' /), 'A', 'kg/kg/s', 'Change N collection droplets by graupel')
call addfld ('CLDFGRAU', (/ 'lev' /), 'A', '1', 'Cloud fraction adjusted for graupel' )
call addfld ('MELTGTOT', (/ 'lev' /), 'A', 'kg/kg/s', 'Melting of graupel' )
call addfld ('NPRACGO', (/ 'lev' /), 'A', '#/kg/s', 'Change N collection rain by graupel')
call addfld ('NSCNGO', (/ 'lev' /), 'A', '#/kg/s', 'Change N conversion to graupel due to collection droplets by snow')
call addfld ('NGRACSO', (/ 'lev' /), 'A', '#/kg/s', 'Change N conversion to graupel due to collection rain by snow')
call addfld ('NMULTGO', (/ 'lev' /), 'A', '#/kg/s', 'Ice mult due to acc droplets by graupel ')
call addfld ('NMULTRGO', (/ 'lev' /), 'A', '#/kg/s', 'Ice mult due to acc rain by graupel')
call addfld ('NPSACWGO', (/ 'lev' /), 'A', '#/kg/s', 'Change N collection droplets by graupel')
call addfld ('CLDFGRAU', (/ 'lev' /), 'A', '1', 'Cloud fraction adjusted for graupel' )
call addfld ('MELTGTOT', (/ 'lev' /), 'A', 'kg/kg/s', 'Melting of graupel' )

end if

Expand Down Expand Up @@ -1250,6 +1271,27 @@ subroutine micro_pumas_cam_init(pbuf2d)
call add_default ('BERGO ', budget_histfile, ' ')
call add_default ('MELTSTOT ', budget_histfile, ' ')
call add_default ('MNUDEPO ', budget_histfile, ' ')
call add_default ('NNUCCCO ', budget_histfile, ' ')
call add_default ('NNUCCTO ', budget_histfile, ' ')
call add_default ('NNUCCDO ', budget_histfile, ' ')
call add_default ('NNUDEPO ', budget_histfile, ' ')
call add_default ('NHOMO ', budget_histfile, ' ')
call add_default ('NNUCCRO ', budget_histfile, ' ')
call add_default ('NNUCCRIO ', budget_histfile, ' ')
call add_default ('NSACWIO ', budget_histfile, ' ')
call add_default ('NPRAO ', budget_histfile, ' ')
call add_default ('NPSACWSO ', budget_histfile, ' ')
call add_default ('NPRAIO ', budget_histfile, ' ')
call add_default ('NPRACSO ', budget_histfile, ' ')
call add_default ('NPRCO ', budget_histfile, ' ')
call add_default ('NPRCIO ', budget_histfile, ' ')
call add_default ('NCSEDTEN ', budget_histfile, ' ')
call add_default ('NISEDTEN ', budget_histfile, ' ')
call add_default ('NRSEDTEN ', budget_histfile, ' ')
call add_default ('NSSEDTEN ', budget_histfile, ' ')
call add_default ('NMELTO ', budget_histfile, ' ')
call add_default ('NMELTS ', budget_histfile, ' ')
call add_default ('NCAL ', budget_histfile, ' ')
if (micro_mg_version > 2) then
call add_default ('QGSEDTEN ', budget_histfile, ' ')
call add_default ('PSACRO ', budget_histfile, ' ')
Expand All @@ -1261,6 +1303,14 @@ subroutine micro_pumas_cam_init(pbuf2d)
call add_default ('QMULTGO ', budget_histfile, ' ')
call add_default ('QMULTRGO ', budget_histfile, ' ')
call add_default ('MELTGTOT ', budget_histfile, ' ')
call add_default ('NPRACGO ', budget_histfile, ' ')
call add_default ('NSCNGO ', budget_histfile, ' ')
call add_default ('NGRACSO ', budget_histfile, ' ')
call add_default ('NMULTGO ', budget_histfile, ' ')
call add_default ('NMULTRGO ', budget_histfile, ' ')
call add_default ('NPSACWGO ', budget_histfile, ' ')
call add_default ('NGSEDTEN ', budget_histfile, ' ')
call add_default ('NMELTG ', budget_histfile, ' ')
end if
call add_default(cnst_name(ixcldliq), budget_histfile, ' ')
call add_default(cnst_name(ixcldice), budget_histfile, ' ')
Expand Down Expand Up @@ -1523,6 +1573,31 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
real(r8) :: freqr(state%psetcols,pver)
real(r8) :: nfice(state%psetcols,pver)
real(r8) :: qcrat(state%psetcols,pver) ! qc limiter ratio (1=no limit)
!Number Tendencies
real(r8) :: nnuccco(state%psetcols,pver)
real(r8) :: nnuccto(state%psetcols,pver)
real(r8) :: nnuccdo(state%psetcols,pver)
real(r8) :: nnudepo(state%psetcols,pver)
real(r8) :: nhomoo(state%psetcols,pver)
real(r8) :: nnuccro(state%psetcols,pver)
real(r8) :: nnuccrio(state%psetcols,pver)
real(r8) :: nsacwio(state%psetcols,pver)
real(r8) :: nprao(state%psetcols,pver)
real(r8) :: npsacwso(state%psetcols,pver)
real(r8) :: npraio(state%psetcols,pver)
real(r8) :: npracso(state%psetcols,pver)
real(r8) :: nprco(state%psetcols,pver)
real(r8) :: nprcio(state%psetcols,pver)
real(r8) :: ncsedten(state%psetcols,pver)
real(r8) :: nisedten(state%psetcols,pver)
real(r8) :: nrsedten(state%psetcols,pver)
real(r8) :: nssedten(state%psetcols,pver)
real(r8) :: ngsedten(state%psetcols,pver)
real(r8) :: nmelto(state%psetcols,pver)
real(r8) :: nmeltso(state%psetcols,pver)
real(r8) :: nmeltgo(state%psetcols,pver)
!-- ag

!Hail/Graupel Output
real(r8) :: freqg(state%psetcols,pver)
real(r8) :: qgout(state%psetcols,pver)
Expand Down Expand Up @@ -2275,6 +2350,28 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
frzimm(:ncol,:top_lev-1)=0._r8
frzcnt(:ncol,:top_lev-1)=0._r8
frzdep(:ncol,:top_lev-1)=0._r8
nnuccco(:ncol,:top_lev-1)=0._r8
nnuccto(:ncol,:top_lev-1)=0._r8
nnuccdo(:ncol,:top_lev-1)=0._r8
nnudepo(:ncol,:top_lev-1)=0._r8
nhomoo(:ncol,:top_lev-1)=0._r8
nnuccro(:ncol,:top_lev-1)=0._r8
nnuccrio(:ncol,:top_lev-1)=0._r8
nsacwio(:ncol,:top_lev-1)=0._r8
nprao(:ncol,:top_lev-1)=0._r8
npsacwso(:ncol,:top_lev-1)=0._r8
npraio(:ncol,:top_lev-1)=0._r8
npracso(:ncol,:top_lev-1)=0._r8
nprco(:ncol,:top_lev-1)=0._r8
nprcio(:ncol,:top_lev-1)=0._r8
ncsedten(:ncol,:top_lev-1)=0._r8
nisedten(:ncol,:top_lev-1)=0._r8
nrsedten(:ncol,:top_lev-1)=0._r8
nssedten(:ncol,:top_lev-1)=0._r8
ngsedten(:ncol,:top_lev-1)=0._r8
nmelto(:ncol,:top_lev-1)=0._r8
nmeltso(:ncol,:top_lev-1)=0._r8
nmeltgo(:ncol,:top_lev-1)=0._r8

do it = 1, num_steps

Expand Down Expand Up @@ -2376,6 +2473,14 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
qmultgo(:ncol,top_lev:), qmultrgo(:ncol,top_lev:), psacro(:ncol,top_lev:), &
npracgo(:ncol,top_lev:), nscngo(:ncol,top_lev:), ngracso(:ncol,top_lev:), &
nmultgo(:ncol,top_lev:), nmultrgo(:ncol,top_lev:), npsacwgo(:ncol,top_lev:), &
nnuccco(:ncol,top_lev:), nnuccto(:ncol,top_lev:), nnuccdo(:ncol,top_lev:), &
nnudepo(:ncol,top_lev:), nhomoo(:ncol,top_lev:), nnuccro(:ncol,top_lev:), &
nnuccrio(:ncol,top_lev:), nsacwio(:ncol,top_lev:), nprao(:ncol,top_lev:), &
npsacwso(:ncol,top_lev:), npraio(:ncol,top_lev:), npracso(:ncol,top_lev:), &
nprco(:ncol,top_lev:), nprcio(:ncol,top_lev:), ncsedten(:ncol,top_lev:), &
nisedten(:ncol,top_lev:), nrsedten(:ncol,top_lev:), nssedten(:ncol,top_lev:), &
ngsedten(:ncol,top_lev:), nmelto(:ncol,top_lev:), nmeltso(:ncol,top_lev:), &
nmeltgo(:ncol,top_lev:), &
nrout(:ncol,top_lev:), nsout(:ncol,top_lev:), &
refl(:ncol,top_lev:), arefl(:ncol,top_lev:), areflz(:ncol,top_lev:), &
frefl(:ncol,top_lev:), csrfl(:ncol,top_lev:), acsrfl(:ncol,top_lev:), &
Expand Down Expand Up @@ -3344,6 +3449,26 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
call outfld('FRZRDT', frzrdt , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('FICE', nfice, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('CLDFSNOW', cldfsnow, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NNUCCCO', nnuccco , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NNUCCTO', nnuccto , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NNUCCDO', nnuccdo , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NNUDEPO', nnudepo , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NHOMO', nhomoo , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NNUCCRO', nnuccro , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NNUCCRIO', nnuccrio , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NSACWIO', nsacwio , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NPRAO', nprao , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NPSACWSO', npsacwso , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NPRAIO', npraio , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NPRACSO', npracso , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NPRCO', nprco , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NPRCIO', nprcio , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NCSEDTEN', ncsedten , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NISEDTEN', nisedten , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NRSEDTEN', nrsedten , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NSSEDTEN', nssedten , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NMELTO', nmelto , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld ('NMELTS', nmeltso , psetcols, lchnk, avg_subcol_field=use_subcol_microp)

if (micro_mg_version > 1) then
call outfld('UMR', umr, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
Expand All @@ -3355,14 +3480,15 @@ subroutine micro_pumas_cam_tend(state, ptend, dtime, pbuf)
end if

if (micro_mg_version > 2) then
call outfld('UMG', umg, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('QGSEDTEN', qgsedten, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('UMG', umg, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('QGSEDTEN', qgsedten, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('FREQG', freqg, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('AQGRAU', qgout2, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('ANGRAU', ngout2, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('CLDFGRAU', cldfgrau, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('MELTGTOT', meltgtot, psetcols, lchnk, avg_subcol_field=use_subcol_microp)

call outfld('NMELTG', nmeltgo, psetcols, lchnk, avg_subcol_field=use_subcol_microp)
call outfld('NGSEDTEN', ngsedten , psetcols, lchnk, avg_subcol_field=use_subcol_microp)
end if

! Example subcolumn outfld call
Expand Down

0 comments on commit 95b49dd

Please sign in to comment.