-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cryo terms to coupler budget #74
Changes from 4 commits
efbd115
10691dd
4e16416
8295de2
d42b9cb
6cc7a1e
947d2fb
23624db
6ca4e69
842cc37
d46f9b2
4951935
dbe3477
e68e422
5d3f8c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -144,32 +144,35 @@ module seq_diag_mct | |
integer(in),parameter :: f_wmelt =14 ! water: melting | ||
integer(in),parameter :: f_wrain =15 ! water: precip, liquid | ||
integer(in),parameter :: f_wsnow =16 ! water: precip, frozen | ||
integer(in),parameter :: f_wberg =17 ! water: data icebergs | ||
integer(in),parameter :: f_wevap =18 ! water: evaporation | ||
integer(in),parameter :: f_wroff =19 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff =20 ! water: frozen runoff | ||
integer(in),parameter :: f_wirrig =21 ! water: irrigation | ||
integer(in),parameter :: f_wfrz_16O =22 ! water: freezing | ||
integer(in),parameter :: f_wmelt_16O =23 ! water: melting | ||
integer(in),parameter :: f_wrain_16O =24 ! water: precip, liquid | ||
integer(in),parameter :: f_wsnow_16O =25 ! water: precip, frozen | ||
integer(in),parameter :: f_wevap_16O =26 ! water: evaporation | ||
integer(in),parameter :: f_wroff_16O =27 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff_16O =28 ! water: frozen runoff | ||
integer(in),parameter :: f_wfrz_18O =29 ! water: freezing | ||
integer(in),parameter :: f_wmelt_18O =30 ! water: melting | ||
integer(in),parameter :: f_wrain_18O =31 ! water: precip, liquid | ||
integer(in),parameter :: f_wsnow_18O =32 ! water: precip, frozen | ||
integer(in),parameter :: f_wevap_18O =33 ! water: evaporation | ||
integer(in),parameter :: f_wroff_18O =34 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff_18O =35 ! water: frozen runoff | ||
integer(in),parameter :: f_wfrz_HDO =36 ! water: freezing | ||
integer(in),parameter :: f_wmelt_HDO =37 ! water: melting | ||
integer(in),parameter :: f_wrain_HDO =38 ! water: precip, liquid | ||
integer(in),parameter :: f_wsnow_HDO =39 ! water: precip, frozen | ||
integer(in),parameter :: f_wevap_HDO =40 ! water: evaporation | ||
integer(in),parameter :: f_wroff_HDO =41 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff_HDO =42 ! water: frozen runoff | ||
integer(in),parameter :: f_wevap =17 ! water: evaporation | ||
integer(in),parameter :: f_wroff =18 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff =19 ! water: frozen runoff | ||
integer(in),parameter :: f_wberg =20 ! water: data icebergs | ||
integer(in),parameter :: f_wism =21 ! water: ice-shelf melt | ||
integer(in),parameter :: f_wrrof =22 ! water: removed liquid runoff | ||
integer(in),parameter :: f_wriof =23 ! water: removed ice runoff | ||
integer(in),parameter :: f_wirrig =24 ! water: irrigation | ||
integer(in),parameter :: f_wfrz_16O =25 ! water: freezing | ||
integer(in),parameter :: f_wmelt_16O =26 ! water: melting | ||
integer(in),parameter :: f_wrain_16O =27 ! water: precip, liquid | ||
integer(in),parameter :: f_wsnow_16O =28 ! water: precip, frozen | ||
integer(in),parameter :: f_wevap_16O =29 ! water: evaporation | ||
integer(in),parameter :: f_wroff_16O =30 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff_16O =31 ! water: frozen runoff | ||
integer(in),parameter :: f_wfrz_18O =32 ! water: freezing | ||
integer(in),parameter :: f_wmelt_18O =33 ! water: melting | ||
integer(in),parameter :: f_wrain_18O =34 ! water: precip, liquid | ||
integer(in),parameter :: f_wsnow_18O =35 ! water: precip, frozen | ||
integer(in),parameter :: f_wevap_18O =36 ! water: evaporation | ||
integer(in),parameter :: f_wroff_18O =37 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff_18O =38 ! water: frozen runoff | ||
integer(in),parameter :: f_wfrz_HDO =39 ! water: freezing | ||
integer(in),parameter :: f_wmelt_HDO =40 ! water: melting | ||
integer(in),parameter :: f_wrain_HDO =41 ! water: precip, liquid | ||
integer(in),parameter :: f_wsnow_HDO =42 ! water: precip, frozen | ||
integer(in),parameter :: f_wevap_HDO =43 ! water: evaporation | ||
integer(in),parameter :: f_wroff_HDO =44 ! water: runoff/flood | ||
integer(in),parameter :: f_wioff_HDO =45 ! water: frozen runoff | ||
|
||
integer(in),parameter :: f_size = f_wioff_HDO ! Total array size of all elements | ||
integer(in),parameter :: f_a = f_area ! 1st index for area | ||
|
@@ -190,7 +193,8 @@ module seq_diag_mct | |
(/' area',' hfreeze',' hmelt',' hnetsw',' hlwdn', & | ||
' hlwup',' hlatvap',' hlatfus',' hiroff',' hsen', & | ||
' hberg',' hh2otemp',' wfreeze',' wmelt',' wrain', & | ||
' wsnow',' wberg',' wevap',' wrunoff',' wfrzrof', & | ||
' wsnow',' wevap',' wrunoff',' wfrzrof', & | ||
' wberg',' wism',' wrrof',' wriof', & | ||
' wirrig', & | ||
' wfreeze_16O',' wmelt_16O',' wrain_16O',' wsnow_16O', & | ||
' wevap_16O',' wrunoff_16O',' wfrzrof_16O', & | ||
|
@@ -287,6 +291,10 @@ module seq_diag_mct | |
integer :: index_o2x_Faoo_h2otemp | ||
integer :: index_o2x_Fioo_frazil | ||
integer :: index_o2x_Fioo_q | ||
!DC - do we want P in front of these fields? | ||
integer :: index_o2x_Foxo_ismw | ||
integer :: index_o2x_Foxo_rrofl | ||
integer :: index_o2x_Foxo_rrofi | ||
|
||
integer :: index_xao_Faox_lwup | ||
integer :: index_xao_Faox_lat | ||
|
@@ -1337,7 +1345,7 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa | |
integer(in) :: kArea ! index of area field in aVect | ||
integer(in) :: ko,ki ! fraction indices | ||
integer(in) :: lSize ! size of aVect | ||
real(r8) :: ca_i,ca_o ! area of a grid cell | ||
real(r8) :: ca_i,ca_o,ca_c ! area of a grid cell | ||
logical,save :: first_time = .true. | ||
logical,save :: flds_wiso_ocn = .false. | ||
|
||
|
@@ -1373,17 +1381,26 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa | |
index_o2x_Fioo_frazil = mct_aVect_indexRA(o2x_o,'Fioo_frazil') | ||
index_o2x_Fioo_q = mct_aVect_indexRA(o2x_o,'Fioo_q') | ||
index_o2x_Faoo_h2otemp = mct_aVect_indexRA(o2x_o,'Faoo_h2otemp') | ||
index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'PFoxo_ismw') | ||
index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl') | ||
index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi') | ||
end if | ||
|
||
lSize = mct_avect_lSize(o2x_o) | ||
ic = c_ocn_or | ||
do n=1,lSize | ||
ca_o = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ko,n) | ||
ca_i = dom_o%data%rAttr(kArea,n) * frac_o%rAttr(ki,n) | ||
ca_c = dom_o%data%rAttr(kArea,n) !DC area including ice-shelf cavities | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding this as a scaling factor was a bit of guesswork, but seems to work. Without it, I was getting 0 for ice-shelf melt in the coupler table, I think because the coupler is seeing the ice-shelf cavity grid cells as land, so 0 area for ocean and ice. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @xylar here is where I got around the coupler masking out ocean cells under ice shelves. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Got it. Thanks! |
||
nf = f_area; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_o | ||
nf = f_wfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_frazil,n)) | ||
nf = f_hfrz; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*max(0.0_r8,o2x_o%rAttr(index_o2x_Fioo_q,n)) | ||
nf = f_hh2ot; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Faoo_h2otemp,n) | ||
!DC do we need only ca_o, if use P above? | ||
! nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! gives 0, different scaling? | ||
nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n) ! think this is right scaling | ||
nf = f_wrrof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n) | ||
nf = f_wriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n) | ||
end do | ||
end if | ||
|
||
|
@@ -1495,6 +1512,10 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa | |
nf = f_wrain ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_rain,n) | ||
nf = f_wsnow ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_snow,n) | ||
nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) | ||
!DC new entries should not be here, done above with o2x | ||
! nf = f_wism ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) | ||
! nf = f_wrrof ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) | ||
! nf = f_wriof ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergw,n) | ||
nf = f_wroff ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_rofl,n) | ||
nf = f_wioff ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_rofi,n) | ||
|
||
|
@@ -1652,7 +1673,8 @@ subroutine seq_diag_ice_mct( ice, frac_i, infodata, do_i2x, do_x2i) | |
nf = f_hsen ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_sen,n) | ||
nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergh,n) | ||
nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - ca_i*i2x_i%rAttr(index_i2x_Fioi_meltw,n) | ||
nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergw,n) | ||
!DC propose removing wberg from ice entry | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note I've removed the |
||
! nf = f_wberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*i2x_i%rAttr(index_i2x_Fioi_bergw,n) | ||
nf = f_wevap ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_i*i2x_i%rAttr(index_i2x_Faii_evap,n) | ||
|
||
if ( flds_wiso_ice )then | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noting I added 'P' for the ice-shelf melt term; I'm not sure if this matters with the way I did the scaling below. The removed runoff terms do not have P.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just tested without the 'P' and get the same answers, so I'm removing this.