Skip to content

Commit

Permalink
Combining polar terms into single row entry
Browse files Browse the repository at this point in the history
  • Loading branch information
darincomeau committed Feb 15, 2024
1 parent bf92c3d commit 1996751
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 58 deletions.
10 changes: 5 additions & 5 deletions components/mpas-ocean/driver/mpaso_cpl_indices.F
Original file line number Diff line number Diff line change
Expand Up @@ -192,12 +192,12 @@ subroutine mpaso_cpl_indices_set( )
index_o2x_Faoo_fdms_ocn = mct_avect_indexra(o2x,'Faoo_fdms_ocn',perrWith='quiet')
index_o2x_So_ssh = mct_avect_indexra(o2x,'So_ssh')

index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'Foxo_ismw')
index_o2x_Foxo_rrofl = mct_avect_indexra(o2x,'Foxo_rrofl')
index_o2x_Foxo_rrofi = mct_avect_indexra(o2x,'Foxo_rrofi')
index_o2x_Foxo_ismw = mct_avect_indexra(o2x,'Foxo_ismw',perrWith='quiet')
index_o2x_Foxo_rrofl = mct_avect_indexra(o2x,'Foxo_rrofl',perrWith='quiet')
index_o2x_Foxo_rrofi = mct_avect_indexra(o2x,'Foxo_rrofi',perrWith='quiet')

index_o2x_Foxo_ismh = mct_avect_indexra(o2x,'Foxo_ismh')
index_o2x_Foxo_rrofih = mct_avect_indexra(o2x,'Foxo_rrofih')
index_o2x_Foxo_ismh = mct_avect_indexra(o2x,'Foxo_ismh',perrWith='quiet')
index_o2x_Foxo_rrofih = mct_avect_indexra(o2x,'Foxo_rrofih',perrWith='quiet')

index_o2x_So_blt = mct_avect_indexra(o2x,'So_blt')
index_o2x_So_bls = mct_avect_indexra(o2x,'So_bls')
Expand Down
104 changes: 51 additions & 53 deletions driver-mct/main/seq_diag_mct.F90
Original file line number Diff line number Diff line change
Expand Up @@ -138,43 +138,38 @@ module seq_diag_mct
integer(in),parameter :: f_hlatf = 8 ! heat : latent, fusion, snow
integer(in),parameter :: f_hioff = 9 ! heat : latent, fusion, frozen runoff
integer(in),parameter :: f_hsen =10 ! heat : sensible
integer(in),parameter :: f_hberg =11 ! heat : data icebergs
integer(in),parameter :: f_hism =12 ! heat : ice shelf melt
integer(in),parameter :: f_hriof =13 ! heat : data icebergs
integer(in),parameter :: f_hh2ot =14 ! heat : water temperature
integer(in),parameter :: f_wfrz =15 ! water: freezing
integer(in),parameter :: f_wmelt =16 ! water: melting
integer(in),parameter :: f_wrain =17 ! water: precip, liquid
integer(in),parameter :: f_wsnow =18 ! water: precip, frozen
integer(in),parameter :: f_wevap =19 ! water: evaporation
integer(in),parameter :: f_wroff =20 ! water: runoff/flood
integer(in),parameter :: f_wioff =21 ! water: frozen runoff
integer(in),parameter :: f_wberg =22 ! water: data icebergs
integer(in),parameter :: f_wism =23 ! water: ice-shelf melt
integer(in),parameter :: f_wrrof =24 ! water: removed liquid runoff
integer(in),parameter :: f_wriof =25 ! water: removed ice runoff
integer(in),parameter :: f_wirrig =26 ! water: irrigation
integer(in),parameter :: f_wfrz_16O =27 ! water: freezing
integer(in),parameter :: f_wmelt_16O =28 ! water: melting
integer(in),parameter :: f_wrain_16O =29 ! water: precip, liquid
integer(in),parameter :: f_wsnow_16O =30 ! water: precip, frozen
integer(in),parameter :: f_wevap_16O =31 ! water: evaporation
integer(in),parameter :: f_wroff_16O =32 ! water: runoff/flood
integer(in),parameter :: f_wioff_16O =33 ! water: frozen runoff
integer(in),parameter :: f_wfrz_18O =34 ! water: freezing
integer(in),parameter :: f_wmelt_18O =35 ! water: melting
integer(in),parameter :: f_wrain_18O =36 ! water: precip, liquid
integer(in),parameter :: f_wsnow_18O =37 ! water: precip, frozen
integer(in),parameter :: f_wevap_18O =38 ! water: evaporation
integer(in),parameter :: f_wroff_18O =39 ! water: runoff/flood
integer(in),parameter :: f_wioff_18O =40 ! water: frozen runoff
integer(in),parameter :: f_wfrz_HDO =41 ! water: freezing
integer(in),parameter :: f_wmelt_HDO =42 ! water: melting
integer(in),parameter :: f_wrain_HDO =43 ! water: precip, liquid
integer(in),parameter :: f_wsnow_HDO =44 ! water: precip, frozen
integer(in),parameter :: f_wevap_HDO =45 ! water: evaporation
integer(in),parameter :: f_wroff_HDO =46 ! water: runoff/flood
integer(in),parameter :: f_wioff_HDO =47 ! water: frozen runoff
integer(in),parameter :: f_hpolar =11 ! heat : AIS imbalance
integer(in),parameter :: f_hh2ot =12 ! heat : water temperature
integer(in),parameter :: f_wfrz =13 ! water: freezing
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_wpolar =17 ! water: AIS imbalance
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_size = f_wioff_HDO ! Total array size of all elements
integer(in),parameter :: f_a = f_area ! 1st index for area
Expand All @@ -194,10 +189,8 @@ module seq_diag_mct

(/' area',' hfreeze',' hmelt',' hnetsw',' hlwdn', &
' hlwup',' hlatvap',' hlatfus',' hiroff',' hsen', &
' hberg',' hism',' hriof', &
' hh2otemp',' wfreeze',' wmelt',' wrain', &
' wsnow',' wevap',' wrunoff',' wfrzrof', &
' wberg',' wism',' wrrof',' wriof', &
' hpolar',' hh2otemp',' wfreeze',' wmelt',' wrain', &
' wsnow',' wpolar',' wevap',' wrunoff',' wfrzrof', &
' wirrig', &
' wfreeze_16O',' wmelt_16O',' wrain_16O',' wsnow_16O', &
' wevap_16O',' wrunoff_16O',' wfrzrof_16O', &
Expand Down Expand Up @@ -1386,11 +1379,11 @@ 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,'Foxo_ismw')
index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl')
index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi')
index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh')
index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih')
index_o2x_Foxo_ismw = mct_aVect_indexRA(o2x_o,'Foxo_ismw',perrWith='quiet')
index_o2x_Foxo_rrofl = mct_aVect_indexRA(o2x_o,'Foxo_rrofl',perrWith='quiet')
index_o2x_Foxo_rrofi = mct_aVect_indexRA(o2x_o,'Foxo_rrofi',perrWith='quiet')
index_o2x_Foxo_ismh = mct_aVect_indexRA(o2x_o,'Foxo_ismh',perrWith='quiet')
index_o2x_Foxo_rrofih = mct_aVect_indexRA(o2x_o,'Foxo_rrofih',perrWith='quiet')
end if

lSize = mct_avect_lSize(o2x_o)
Expand All @@ -1403,11 +1396,16 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa
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)
nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n)
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)
nf = f_hism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n)
nf = f_hriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n)
nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n)
nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofl,n)
nf = f_wpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) - (ca_o+ca_i)*o2x_o%rAttr(index_o2x_Foxo_rrofi,n)
! nf = f_wism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismw,n)
! 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)
nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n)
nf = f_hpolar;budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n)
! nf = f_hism; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_ismh,n)
! nf = f_hriof; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + ca_c*o2x_o%rAttr(index_o2x_Foxo_rrofih,n)
end do
end if

Expand Down Expand Up @@ -1514,11 +1512,11 @@ subroutine seq_diag_ocn_mct( ocn, xao_o, frac_o, infodata, do_o2x, do_x2o, do_xa
nf = f_hmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_melth,n)
nf = f_hswnet; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Foxx_swnet,n)
nf = f_hlwdn ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Faxa_lwdn,n)
nf = f_hberg ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergh,n)
nf = f_hpolar; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_bergh,n)
nf = f_wmelt ; budg_dataL(nf,ic,ip) = budg_dataL(nf,ic,ip) + (ca_o+ca_i)*x2o_o%rAttr(index_x2o_Fioi_meltw,n)
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)
nf = f_wpolar; 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)

Expand Down

0 comments on commit 1996751

Please sign in to comment.