Home > climate models, uvic_escm > UVic_ESCM: Flowchart Sketch 1

UVic_ESCM: Flowchart Sketch 1

2012 February 12


Way back in the day, as a new hire, in one of my first ‘think outside of the box’ exercises, I color formatted and hyper-linked a bunch of FORTRAN code. A large and aging defense project, there was a lot of it and my pet project quickly became a preferred method within the team for browsing the code. Ah … recall the days when Slackware came on several dozen floppy disks that you downloaded yourself.

Confronted with the UVIC_ESCM code, I wasn’t sure where to start to digest it. Eventually I decided to parse out its calling structure. It’s not a pretty chart. It might not even be complete or accurate. But its a start. Don’t bother clicking ‘more’. I promise it won’t be of any interest to any of you! (Except maybe Kate or Steve 😀 )

S.B.C is “Surface Boundary Condition”

!-----------------------------------------------------------------------
!     do the introductory ocean setup once per run
!-----------------------------------------------------------------------
1:setocn.
	2:setocn:stabi
	2:setocn:getunit
		3:getunit:tolower
		3:getunit:setreclen
			4:setreclen:set2byte
			4:setreclen:set2word
			4:setreclen:i2a
		3:getunit:set2byte
		3:getunit:close_file
		3:getunit:getunitnumber
			4:getunitnumber:showunits
		3:getunit:link_unit
	2:setocn:relunit
		3:relunit:close_file
	2:setocn:getunitnumber
		3:getunitnumber:showunits
	2:setocn:grids
		3:grids:gcoord
			4:gcoord:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:gcoord:getvara
			4:gcoord:closefile
		3:grids:size_check
		3:grids:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:grids:getvara
		3:grids:closefile
	2:setocn:eqstate
		3:eqstate:unesco
		3:eqstate:potem
		3:eqstate:lsqsl2
	2:setocn:topog
		3:topog:size_check
		3:topog:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:topog:getvara
		3:topog:closefile
		3:topog:kmtbc
		3:topog:area_volume
		3:topog:min_depth
		3:topog:isleperim
			4:isleperim:qinit
			4:isleperim:qpush
			4:isleperim:expand
				5:expand:qinit
				5:expand:qpop
				5:expand:qpush
				5:expand:clear_kmt_options
				5:expand:kmt_option
					6:kmt_option:accept_option
						7:accept_option:enter_kmt_changes
				5:expand:select_option
			4:isleperim:enter_kmt_changes
		3:topog:showmap
		3:topog:iplot
	2:setocn:depth_u
	2:setocn:oput
	2:setocn:rowi
		3:rowi:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:rowi:getvara
		3:rowi:closefile
		3:rowi:getvara
		3:rowi:copy_all_rows
		3:rowi:putrow
		3:rowi:areaavg
	2:setocn:mom_rest_in
		3:mom_rest_in:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:mom_rest_in:getvars
		3:mom_rest_in:mkstmp
		3:mom_rest_in:getvara
		3:mom_rest_in:oput
		3:mom_rest_in:depth_u
		3:mom_rest_in:getrow
			4:getrow:getlat
			4:getrow:putlat
		3:mom_rest_in:putrow
		3:mom_rest_in:closefile
	2:setocn:ta_mom_tsi
		3:ta_mom_tsi:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:ta_mom_tsi:getvara
		3:ta_mom_tsi:closefile
		3:ta_mom_tsi:areaavg
		3:ta_mom_tsi:potem
	2:setocn:tmngri
		3:tmngri:inittime
		3:tmngri:initswitch
		3:tmngri:calendari
		3:tmngri:getfulltime
		3:tmngri:setfulltime
			4:setfulltime:ymd2d
				5:ymd2d:ymd2dc
			4:setfulltime:mkstmp
		3:tmngri:ckdate
		3:tmngri:gettime
		3:tmngri:settime2
		3:tmngri:addtime
		3:tmngri:expandtime2
			4:expandtime2:d2ymd
				5:d2ymd:d2ymdc
			4:expandtime2:ms2hms
			4:expandtime2:mkstmp
		3:tmngri:copyfulltime
		3:tmngri:ckdate
		3:tmngri:set_eorun
			4:set_eorun:getswitch
			4:set_eorun:getfulltime
			4:set_eorun:copyfulltime
			4:set_eorun:expandtime
				5:expandtime:ymd2d
					6:ymd2d:ymd2dc
				5:expandtime:mkstmp
			4:set_eorun:settime3
			4:set_eorun:addtime
			4:set_eorun:expandtime2
				5:expandtime2:d2ymd
					6:d2ymd:d2ymdc
				5:expandtime2:ms2hms
				5:expandtime2:mkstmp
			4:set_eorun:addtime
			4:set_eorun:subtime
	2:setocn:reg1st
		3:reg1st:wrufio
		3:reg1st:iplot
	2:setocn:isleperim
		3:isleperim:qinit
		3:isleperim:qpush
		3:isleperim:expand
			4:expand:qinit
			4:expand:qpop
			4:expand:qpush
			4:expand:clear_kmt_options
			4:expand:kmt_option
				5:kmt_option:accept_option
					6:accept_option:enter_kmt_changes
			4:expand:select_option
		3:isleperim:enter_kmt_changes
	2:setocn:print_checksum
	2:setocn:findex
	2:setocn:blmixi
		3:blmixi:getunit
			4:getunit:tolower
			4:getunit:setreclen
				5:setreclen:set2byte
				5:setreclen:set2word
				5:setreclen:i2a
			4:getunit:set2byte
			4:getunit:close_file
			4:getunit:getunitnumber
				5:getunitnumber:showunits
			4:getunit:link_unit
		3:blmixi:relunit
			4:relunit:close_file
	2:setocn:avgi
	2:setocn:isopi
		3:isopi:getunit
			4:getunit:tolower
			4:getunit:setreclen
				5:setreclen:set2byte
				5:setreclen:set2word
				5:setreclen:i2a
			4:getunit:set2byte
			4:getunit:close_file
			4:getunit:getunitnumber
				5:getunitnumber:showunits
			4:getunit:link_unit
		3:isopi:relunit
			4:relunit:close_file
		3:isopi:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:isopi:getvara
		3:isopi:closefile
	2:setocn:checks
!-----------------------------------------------------------------------
!     do the introductory atmosphere setup once per run
!-----------------------------------------------------------------------
1:setembm.
	2:setembm:getunit
		3:getunit:tolower
		3:getunit:setreclen
			4:setreclen:set2byte
			4:setreclen:set2word
			4:setreclen:i2a
		3:getunit:set2byte
		3:getunit:close_file
		3:getunit:getunitnumber
			4:getunitnumber:showunits
		3:getunit:link_unit
	2:setembm:relunit
		3:relunit:close_file
	2:setembm:orbit
	2:setembm:openfile
		3:openfile:opennew
		3:openfile:checkerror
	2:setembm:getvara
	2:setembm:closefile
	2:setembm:icedata
		3:icedata:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:icedata:
		3:icedata:closefile
		3:icedata:getdimlen
		3:icedata:getvara
		3:icedata:embmbc
	2:setembm:embm_rest_in
		3:embm_rest_in:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:embm_rest_in:getvars
		3:embm_rest_in:mkstmp
		3:embm_rest_in:getvara
		3:embm_rest_in:closefile
	2:setembm:setatm
		3:setatm:mkstmp
		3:setatm:timeinterpi
			4:timeinterpi:getfulltime
			4:timeinterpi:rdstmp
			4:timeinterpi:setfulltime
				5:setfulltime:ymd2d
					6:ymd2d:ymd2dc
				5:setfulltime:mkstmp
			4:timeinterpi:inctime
				5:inctime:settime2
				5:inctime:addtime
				5:inctime:expandtime2
					6:expandtime2:d2ymd
						7:d2ymd:d2ymdc
					6:expandtime2:ms2hms
					6:expandtime2:mkstmp
			4:timeinterpi:
		3:setatm:addtime
		3:setatm:subtime
		3:setatm:timeinterp
		3:setatm:get_sbc
			4:get_sbc:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:get_sbc:getvara
			4:get_sbc:closefile
	2:setembm:embmbc
	2:setembm:rivinit
		3:rivinit:getvara
		3:rivinit:closefile
		3:rivinit:expand_basins
	2:setembm:gvsbc
		3:gvsbc:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:gvsbc:getdimlen
		3:gvsbc:getvara
		3:gvsbc:closefile
		3:gvsbc:embmbc
	2:setembm:ta_embm_snap
	2:setembm:ta_embm_tsi
		3:ta_embm_tsi:areaavg
		3:ta_embm_tsi:areatot
!-----------------------------------------------------------------------
!     do the introductory land setup once per run
!-----------------------------------------------------------------------
1:setmtlm.
	2:setmtlm:getunit
		3:getunit:tolower
		3:getunit:setreclen
			4:setreclen:set2byte
			4:setreclen:set2word
			4:setreclen:i2a
		3:getunit:set2byte
		3:getunit:close_file
		3:getunit:getunitnumber
			4:getunitnumber:showunits
		3:getunit:link_unit
	2:setmtlm:relunit
		3:relunit:close_file
	2:setmtlm:pft_sparm
	2:setmtlm:mtlm_rest_in
		3:mtlm_rest_in:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:mtlm_rest_in:getvars
		3:mtlm_rest_in:closefile
		3:mtlm_rest_in:getvars
		3:mtlm_rest_in:mkstmp
		3:mtlm_rest_in:getvara
		3:mtlm_rest_in:unloadland
		3:mtlm_rest_in:loadland
		3:mtlm_rest_in:closefile
	2:setmtlm:ta_mtlm_snap
	2:setmtlm:ta_mtlm_tsi
		3:ta_mtlm_tsi:unloadland
		3:ta_mtlm_tsi:areatot
		3:ta_mtlm_tsi:areaavg
!-----------------------------------------------------------------------
!     check for consistency in the S.B.C. setup
!-----------------------------------------------------------------------
1:chkcpl.
!-----------------------------------------------------------------------
!     get global sums at the start of the run
!-----------------------------------------------------------------------
1:globalsum.
	2:globalsum:getrow
		3:getrow:getlat
		3:getrow:putlat
	2:globalsum:opennext
		3:opennext:opennew
		3:opennext:checkerror
	2:globalsum:redef
	2:globalsum:putatttext
	2:globalsum:defdim
	2:globalsum:defvar
		3:defvar:defdim
		3:defvar:checkerror
	2:globalsum:enddef
	2:globalsum:putvars
	2:globalsum:rdstmp
	2:globalsum:closefile
!-----------------------------------------------------------------------
!     S T A R T    S E G M E N T    L O O P
!-----------------------------------------------------------------------

!-----------------------------------------------------------------------
!       get the atmospheric S.B.C.
!-----------------------------------------------------------------------
1:gasbc.
	2:gasbc:solardata
		3:solardata:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:solardata:getdimlen
		3:solardata:getvara
		3:solardata:closefile
	2:gasbc:decl
	2:gasbc:zenith
	2:gasbc:atmos
		3:atmos:addtime
		3:atmos:subtime
		3:atmos:timeinterp
		3:atmos:get_tdsbc
			4:get_tdsbc:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:get_tdsbc:getvara
			4:get_tdsbc:closefile
	2:gasbc:co2calc_sws
		3:co2calc_sws:ta_iter_sws
	2:gasbc:setbcx
	2:gasbc:areaavg
	2:gasbc:co2forc
	2:gasbc:

!-----------------------------------------------------------------------
!       call the atmospheric model once for each time step until one
!       segment of "segtim" days is complete. hold atmos S.B.C. fixed
!       during each segment and predict average S.B.C. for ocean
!-----------------------------------------------------------------------
1:embm.
	2:embm:fluxes
	2:embm:ice
		3:ice:icelats
		3:ice:evp
			4:evp:mass_prss
			4:evp:viscevp
			4:evp:stressprep
			4:evp:stressevp
			4:evp:stepu
			4:evp:embmbc
		3:ice:filuvice
			4:filuvice:embmbc
			4:filuvice:filtr
				5:filtr:format
		3:ice:advupb
			4:advupb:embmbc
		3:ice:therm
			4:therm:embmbc
	2:embm:solve
		3:solve:embmbc
		3:solve:
		3:solve:mgrid
			4:mgrid:ptr
			4:mgrid:resid
			4:mgrid:sumcf
			4:mgrid:pgs
				5:pgs:ctdma
					6:ctdma:tdma
				5:pgs:new_ctdma
					6:new_ctdma:new_tdma
				5:pgs:ctdma
					6:ctdma:tdma
			4:mgrid:sumrsd
			4:mgrid:sumdel
	2:embm:precipitate
		3:precipitate:unloadland
		3:precipitate:embmbc
	2:embm:
	2:embm:ta_embm_snap
	2:embm:ta_embm_tsi
		3:ta_embm_tsi:areaavg
		3:ta_embm_tsi:areatot
!-----------------------------------------------------------------------
!       get land S.B.C.s
!-----------------------------------------------------------------------
1:glsbc.
	2:glsbc:decl
	2:glsbc:zenith
	2:glsbc:
!----------------------------------------------------------------------
!       call the land-surface and vegetation  model once for each time
!       step until one segment of "segtim" days is complete.
!       hold land S.B.C. fixed
!       during each segment and predict average S.B.C. for the EMBM
!-----------------------------------------------------------------------
1:mtlm.
	2:mtlm:qsat
	2:mtlm:swrad
	2:mtlm:sf_stom
		3:sf_stom:qsat
		3:sf_stom:canopy
			4:canopy:leaf
	2:mtlm:penmon
		3:penmon:qsat
	2:mtlm:leaf_lit
	2:mtlm:microbe
	2:mtlm:phenol
	2:mtlm:mtlm_state
	2:mtlm:triffid
		3:triffid:vegcarb
			4:vegcarb:growth
		3:triffid:lotka
			4:lotka:compete
		3:triffid:soilcarb
			4:soilcarb:decay
	2:mtlm:pft_sparm
	2:mtlm:ta_mtlm_snap
	2:mtlm:ta_mtlm_tsi
		3:ta_mtlm_tsi:unloadland
		3:ta_mtlm_tsi:areatot
		3:ta_mtlm_tsi:areaavg
!-----------------------------------------------------------------------
!       get ocean S.B.C.s
!-----------------------------------------------------------------------
1:gosbc.
	2:gosbc:setbcx
	2:gosbc:rivmodel
		3:rivmodel:setbcx
	2:gosbc:setbcx
!-----------------------------------------------------------------------
!       call the ocean model once for each time step until one
!       segment of "segtim" days is complete. hold ocean S.B.C. fixed
!       during each segment and predict average S.B.C. for atmos
!-----------------------------------------------------------------------
1:mom.
	2:mom:increment_time
		3:increment_time:settime2
		3:increment_time:addtime
		3:increment_time:expandtime2
			4:expandtime2:d2ymd
				5:d2ymd:d2ymdc
			4:expandtime2:ms2hms
			4:expandtime2:mkstmp
		3:increment_time:subtime
	2:mom:set_time_switches
		3:set_time_switches:getswitch
		3:set_time_switches:getfulltime
		3:set_time_switches:copyfulltime
		3:set_time_switches:expandtime
			4:expandtime:ymd2d
				5:ymd2d:ymd2dc
			4:expandtime:mkstmp
		3:set_time_switches:gettime
		3:set_time_switches:settime3
		3:set_time_switches:copytime
		3:set_time_switches:subtime
		3:set_time_switches:addtime
		3:set_time_switches:multime
	2:mom:diagi
		3:diagi:getunit
			4:getunit:tolower
			4:getunit:setreclen
				5:setreclen:set2byte
				5:setreclen:set2word
				5:setreclen:i2a
			4:getunit:set2byte
			4:getunit:close_file
			4:getunit:getunitnumber
				5:getunitnumber:showunits
			4:getunit:link_unit
		3:diagi:relunit
			4:relunit:close_file
	2:mom:loadmw
		3:loadmw:movemw
		3:loadmw:add_ext_mode
			4:add_ext_mode:setbcx
		3:loadmw:getvar
			4:getvar:getrow
				5:getrow:getlat
				5:getrow:putlat
		3:loadmw:state
	2:mom:adv_vel
		3:adv_vel:setbcx
	2:mom:isopyc
		3:isopyc:elements
			4:elements:setbcx
		3:isopyc:ai_east
			4:ai_east:setbcx
		3:isopyc:ai_north
		3:isopyc:ai_bottom
		3:isopyc:isopyc_adv
	2:mom:vmixc
	2:mom:hmixc
	2:mom:setvbc
		3:setvbc:setbcx
	2:mom:tracer
		3:tracer:adv_flux_fct
			4:adv_flux_fct:setbcx
		3:tracer:isoflux
		3:tracer:ivdift
			4:ivdift:invtri
		3:tracer:setbcx
		3:tracer:diagt1
			4:diagt1:
		3:tracer:convct2
		3:tracer:diagt2
		3:tracer:filt
			4:filt:setbcx
			4:filt:filtr
				5:filtr:format
		3:tracer:diagt2
		3:tracer:asbct
	2:mom:clinic
		3:clinic:setbcx
		3:clinic:diagc1
			4:diagc1:
		3:clinic:diagc2
			4:diagc2:ge2
			4:diagc2:utb2
		3:clinic:filuv
			4:filuv:setbcx
			4:filuv:filtr
				5:filtr:format
		3:clinic:isbcu
		3:clinic:asbcu
	2:mom:diag
		3:diag:avgvar
			4:avgvar:def_tavg_mom
				5:def_tavg_mom:opennext
					6:opennext:opennew
					6:opennext:checkerror
				5:def_tavg_mom:closefile
				5:def_tavg_mom:opennew
				5:def_tavg_mom:mom_snap_def
					6:mom_snap_def:openfile
						7:openfile:opennew
						7:openfile:checkerror
					6:mom_snap_def:redef
					6:mom_snap_def:putatttext
					6:mom_snap_def:defdim
					6:mom_snap_def:defvar
						7:defvar:defdim
						7:defvar:checkerror
					6:mom_snap_def:enddef
					6:mom_snap_def:closefile
			4:avgvar:mom_snap_out
				5:mom_snap_out:opennext
					6:opennext:opennew
					6:opennext:checkerror
				5:mom_snap_out:putvars
				5:mom_snap_out:rdstmp
				5:mom_snap_out:putvara
				5:mom_snap_out:edge_maker
				5:mom_snap_out:putvaramsk
				5:mom_snap_out:closefile
			4:avgvar:avgset
		3:diag:
		3:diag:def_snap_mom
			4:def_snap_mom:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_snap_mom:closefile
			4:def_snap_mom:opennew
			4:def_snap_mom:mom_snap_def
				5:mom_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_snap_def:redef
				5:mom_snap_def:putatttext
				5:mom_snap_def:defdim
				5:mom_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_snap_def:enddef
				5:mom_snap_def:closefile
		3:diag:mom_snap_out
			4:mom_snap_out:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:mom_snap_out:putvars
			4:mom_snap_out:rdstmp
			4:mom_snap_out:putvara
			4:mom_snap_out:edge_maker
			4:mom_snap_out:putvaramsk
			4:mom_snap_out:closefile
		3:diag:stab
			4:stab:matrix
			4:stab:getunit
				5:getunit:tolower
				5:getunit:setreclen
					6:setreclen:set2byte
					6:setreclen:set2word
					6:setreclen:i2a
				5:getunit:set2byte
				5:getunit:close_file
				5:getunit:getunitnumber
					6:getunitnumber:showunits
				5:getunit:link_unit
			4:stab:relunit
				5:relunit:close_file
			4:stab:relunit
				5:relunit:close_file
	2:mom:putmw
		3:putmw:putrow
	2:mom:tropic
		3:tropic:setbcx
		3:tropic:sfforc
		3:tropic:filz
			4:filz:filtr
				5:filtr:format
		3:tropic:oget
		3:tropic:sfc5pt
		3:tropic:congr
			4:congr:border
			4:congr:make_inv
			4:congr:op5_vec
			4:congr:op9_vec
			4:congr:inv_op
				5:inv_op:
			4:congr:zero_vec
			4:congr:avg_dist
		3:tropic:con_adjust
		3:tropic:oput
	2:mom:euler_shuffle
	2:mom:diago
		3:diago:getunit
			4:getunit:tolower
			4:getunit:setreclen
				5:setreclen:set2byte
				5:setreclen:set2word
				5:setreclen:i2a
			4:getunit:set2byte
			4:getunit:close_file
			4:getunit:getunitnumber
				5:getunitnumber:showunits
			4:getunit:link_unit
		3:diago:wrufio
		3:diago:relunit
			4:relunit:close_file
		3:diago:
		3:diago:ta_mom_tsi
			4:ta_mom_tsi:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:ta_mom_tsi:getvara
			4:ta_mom_tsi:closefile
			4:ta_mom_tsi:areaavg
			4:ta_mom_tsi:potem
		3:diago:def_tsi
			4:def_tsi:def_tsi_embm
				5:def_tsi_embm:opennext
					6:opennext:opennew
					6:opennext:checkerror
				5:def_tsi_embm:closefile
				5:def_tsi_embm:opennew
				5:def_tsi_embm:embm_tsi_def
					6:embm_tsi_def:openfile
						7:openfile:opennew
						7:openfile:checkerror
					6:embm_tsi_def:redef
					6:embm_tsi_def:putatttext
					6:embm_tsi_def:defdim
					6:embm_tsi_def:defvar
						7:defvar:defdim
						7:defvar:checkerror
					6:embm_tsi_def:enddef
					6:embm_tsi_def:closefile
			4:def_tsi:def_tsi_mtlm
				5:def_tsi_mtlm:opennext
					6:opennext:opennew
					6:opennext:checkerror
				5:def_tsi_mtlm:closefile
				5:def_tsi_mtlm:opennew
				5:def_tsi_mtlm:mtlm_tsi_def
					6:mtlm_tsi_def:openfile
						7:openfile:opennew
						7:openfile:checkerror
					6:mtlm_tsi_def:redef
					6:mtlm_tsi_def:putatttext
					6:mtlm_tsi_def:defdim
					6:mtlm_tsi_def:defvar
						7:defvar:defdim
						7:defvar:checkerror
					6:mtlm_tsi_def:closefile
			4:def_tsi:def_tsi_mom
				5:def_tsi_mom:opennext
					6:opennext:opennew
					6:opennext:checkerror
				5:def_tsi_mom:closefile
				5:def_tsi_mom:opennew
				5:def_tsi_mom:mom_tsi_def
					6:mom_tsi_def:openfile
						7:openfile:opennew
						7:openfile:checkerror
					6:mom_tsi_def:redef
					6:mom_tsi_def:putatttext
					6:mom_tsi_def:defdim
					6:mom_tsi_def:defvar
						7:defvar:defdim
						7:defvar:checkerror
					6:mom_tsi_def:enddef
					6:mom_tsi_def:closefile
		3:diago:def_tsi_mom
			4:def_tsi_mom:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tsi_mom:closefile
			4:def_tsi_mom:opennew
			4:def_tsi_mom:mom_tsi_def
				5:mom_tsi_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_tsi_def:redef
				5:mom_tsi_def:putatttext
				5:mom_tsi_def:defdim
				5:mom_tsi_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_tsi_def:enddef
				5:mom_tsi_def:closefile
		3:diago:mom_tsi_out
			4:mom_tsi_out:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:mom_tsi_out:putvars
			4:mom_tsi_out:rdstmp
			4:mom_tsi_out:closefile
		3:diago:ge3
		3:diago:utb3
			4:utb3:calc_psgrad
		3:diago:matrix
		3:diago:avgout
	2:mom:def_rest
		3:def_rest:def_rest_embm
			4:def_rest_embm:embm_rest_def
				5:embm_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_rest_def:redef
				5:embm_rest_def:putatttext
				5:embm_rest_def:defdim
				5:embm_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_rest_def:enddef
				5:embm_rest_def:closefile
		3:def_rest:def_rest_mtlm
			4:def_rest_mtlm:mtlm_rest_def
				5:mtlm_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mtlm_rest_def:redef
				5:mtlm_rest_def:putatttext
				5:mtlm_rest_def:defdim
				5:mtlm_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mtlm_rest_def:enddef
				5:mtlm_rest_def:closefile
		3:def_rest:def_rest_mom
			4:def_rest_mom:mom_rest_def
				5:mom_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_rest_def:redef
				5:mom_rest_def:putatttext
				5:mom_rest_def:defdim
				5:mom_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_rest_def:enddef
				5:mom_rest_def:closefile
	2:mom:def_rest_mom
		3:def_rest_mom:mom_rest_def
			4:mom_rest_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:mom_rest_def:redef
			4:mom_rest_def:putatttext
			4:mom_rest_def:defdim
			4:mom_rest_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:mom_rest_def:enddef
			4:mom_rest_def:closefile
	2:mom:mom_rest_out
		3:mom_rest_out:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:mom_rest_out:putvars
		3:mom_rest_out:mkstmp
		3:mom_rest_out:rdstmp
		3:mom_rest_out:putvara
		3:mom_rest_out:edge_maker
		3:mom_rest_out:oget
		3:mom_rest_out:oget
		3:mom_rest_out:setbcx
		3:mom_rest_out:getrow
			4:getrow:getlat
			4:getrow:putlat
		3:mom_rest_out:closefile

!-----------------------------------------------------------------------
! Continutation of previous loop
!-----------------------------------------------------------------------
!       call the ocean model once for each time step until one
!       segment of "segtim" days is complete. hold ocean S.B.C. fixed
!       during each segment and predict average S.B.C. for atmos
!-----------------------------------------------------------------------
1:embmout.
	2:embmout:ta_embm_tsi
		3:ta_embm_tsi:areaavg
		3:ta_embm_tsi:areatot
	2:embmout:def_tsi
		3:def_tsi:def_tsi_embm
			4:def_tsi_embm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tsi_embm:closefile
			4:def_tsi_embm:opennew
			4:def_tsi_embm:embm_tsi_def
				5:embm_tsi_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_tsi_def:redef
				5:embm_tsi_def:putatttext
				5:embm_tsi_def:defdim
				5:embm_tsi_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_tsi_def:enddef
				5:embm_tsi_def:closefile
		3:def_tsi:def_tsi_mtlm
			4:def_tsi_mtlm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tsi_mtlm:closefile
			4:def_tsi_mtlm:opennew
			4:def_tsi_mtlm:mtlm_tsi_def
				5:mtlm_tsi_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mtlm_tsi_def:redef
				5:mtlm_tsi_def:putatttext
				5:mtlm_tsi_def:defdim
				5:mtlm_tsi_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mtlm_tsi_def:closefile
		3:def_tsi:def_tsi_mom
			4:def_tsi_mom:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tsi_mom:closefile
			4:def_tsi_mom:opennew
			4:def_tsi_mom:mom_tsi_def
				5:mom_tsi_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_tsi_def:redef
				5:mom_tsi_def:putatttext
				5:mom_tsi_def:defdim
				5:mom_tsi_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_tsi_def:enddef
				5:mom_tsi_def:closefile
	2:embmout:def_tsi_embm
		3:def_tsi_embm:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:def_tsi_embm:closefile
		3:def_tsi_embm:opennew
		3:def_tsi_embm:embm_tsi_def
			4:embm_tsi_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:embm_tsi_def:redef
			4:embm_tsi_def:putatttext
			4:embm_tsi_def:defdim
			4:embm_tsi_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:embm_tsi_def:enddef
			4:embm_tsi_def:closefile
	2:embmout:embm_tsi_out
		3:embm_tsi_out:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:embm_tsi_out:putvars
		3:embm_tsi_out:rdstmp
		3:embm_tsi_out:closefile
	2:embmout:ta_embm_snap
	2:embmout:unloadland
	2:embmout:def_tavg
		3:def_tavg:def_tavg_embm
			4:def_tavg_embm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tavg_embm:closefile
			4:def_tavg_embm:opennew
			4:def_tavg_embm:embm_snap_def
				5:embm_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_snap_def:redef
				5:embm_snap_def:putatttext
				5:embm_snap_def:defdim
				5:embm_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_snap_def:enddef
				5:embm_snap_def:closefile
		3:def_tavg:def_tavg_mtlm
			4:def_tavg_mtlm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tavg_mtlm:closefile
			4:def_tavg_mtlm:opennew
			4:def_tavg_mtlm:mtlm_snap_def
				5:mtlm_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mtlm_snap_def:redef
				5:mtlm_snap_def:putatttext
				5:mtlm_snap_def:defdim
				5:mtlm_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mtlm_snap_def:enddef
				5:mtlm_snap_def:closefile
		3:def_tavg:def_tavg_mom
			4:def_tavg_mom:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tavg_mom:closefile
			4:def_tavg_mom:opennew
			4:def_tavg_mom:mom_snap_def
				5:mom_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_snap_def:redef
				5:mom_snap_def:putatttext
				5:mom_snap_def:defdim
				5:mom_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_snap_def:enddef
				5:mom_snap_def:closefile
	2:embmout:def_tavg_embm
		3:def_tavg_embm:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:def_tavg_embm:closefile
		3:def_tavg_embm:opennew
		3:def_tavg_embm:embm_snap_def
			4:embm_snap_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:embm_snap_def:redef
			4:embm_snap_def:putatttext
			4:embm_snap_def:defdim
			4:embm_snap_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:embm_snap_def:enddef
			4:embm_snap_def:closefile
	2:embmout:embm_snap_out
		3:embm_snap_out:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:embm_snap_out:putvars
		3:embm_snap_out:rdstmp
		3:embm_snap_out:putvara
		3:embm_snap_out:edge_maker
		3:embm_snap_out:putvaramsk
		3:embm_snap_out:closefile
	2:embmout:def_snap
		3:def_snap:def_snap_embm
			4:def_snap_embm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_snap_embm:closefile
			4:def_snap_embm:opennew
			4:def_snap_embm:embm_snap_def
				5:embm_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_snap_def:redef
				5:embm_snap_def:putatttext
				5:embm_snap_def:defdim
				5:embm_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_snap_def:enddef
				5:embm_snap_def:closefile
		3:def_snap:def_snap_mom
			4:def_snap_mom:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_snap_mom:closefile
			4:def_snap_mom:opennew
			4:def_snap_mom:mom_snap_def
				5:mom_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_snap_def:redef
				5:mom_snap_def:putatttext
				5:mom_snap_def:defdim
				5:mom_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_snap_def:enddef
				5:mom_snap_def:closefile
	2:embmout:def_snap_embm
		3:def_snap_embm:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:def_snap_embm:closefile
		3:def_snap_embm:opennew
		3:def_snap_embm:embm_snap_def
			4:embm_snap_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:embm_snap_def:redef
			4:embm_snap_def:putatttext
			4:embm_snap_def:defdim
			4:embm_snap_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:embm_snap_def:enddef
			4:embm_snap_def:closefile
	2:embmout:
	2:embmout:def_rest
		3:def_rest:def_rest_embm
			4:def_rest_embm:embm_rest_def
				5:embm_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_rest_def:redef
				5:embm_rest_def:putatttext
				5:embm_rest_def:defdim
				5:embm_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_rest_def:enddef
				5:embm_rest_def:closefile
		3:def_rest:def_rest_mtlm
			4:def_rest_mtlm:mtlm_rest_def
				5:mtlm_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mtlm_rest_def:redef
				5:mtlm_rest_def:putatttext
				5:mtlm_rest_def:defdim
				5:mtlm_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mtlm_rest_def:enddef
				5:mtlm_rest_def:closefile
		3:def_rest:def_rest_mom
			4:def_rest_mom:mom_rest_def
				5:mom_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_rest_def:redef
				5:mom_rest_def:putatttext
				5:mom_rest_def:defdim
				5:mom_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_rest_def:enddef
				5:mom_rest_def:closefile
	2:embmout:def_rest_embm
		3:def_rest_embm:embm_rest_def
			4:embm_rest_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:embm_rest_def:redef
			4:embm_rest_def:putatttext
			4:embm_rest_def:defdim
			4:embm_rest_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:embm_rest_def:enddef
			4:embm_rest_def:closefile
	2:embmout:embm_rest_out
		3:embm_rest_out:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:embm_rest_out:putvars
		3:embm_rest_out:mkstmp
		3:embm_rest_out:rdstmp
		3:embm_rest_out:putvara
		3:embm_rest_out:edge_maker
		3:embm_rest_out:closefile
!-----------------------------------------------------------------------
! Continutation of previous loop
!-----------------------------------------------------------------------
!       call the ocean model once for each time step until one
!       segment of "segtim" days is complete. hold ocean S.B.C. fixed
!       during each segment and predict average S.B.C. for atmos
!-----------------------------------------------------------------------
1:mtlmout.
	2:mtlmout:ta_mtlm_tsi
		3:ta_mtlm_tsi:unloadland
		3:ta_mtlm_tsi:areatot
		3:ta_mtlm_tsi:areaavg
	2:mtlmout:def_tsi
		3:def_tsi:def_tsi_embm
			4:def_tsi_embm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tsi_embm:closefile
			4:def_tsi_embm:opennew
			4:def_tsi_embm:embm_tsi_def
				5:embm_tsi_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_tsi_def:redef
				5:embm_tsi_def:putatttext
				5:embm_tsi_def:defdim
				5:embm_tsi_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_tsi_def:enddef
				5:embm_tsi_def:closefile
		3:def_tsi:def_tsi_mtlm
			4:def_tsi_mtlm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tsi_mtlm:closefile
			4:def_tsi_mtlm:opennew
			4:def_tsi_mtlm:mtlm_tsi_def
				5:mtlm_tsi_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mtlm_tsi_def:redef
				5:mtlm_tsi_def:putatttext
				5:mtlm_tsi_def:defdim
				5:mtlm_tsi_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mtlm_tsi_def:closefile
		3:def_tsi:def_tsi_mom
			4:def_tsi_mom:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tsi_mom:closefile
			4:def_tsi_mom:opennew
			4:def_tsi_mom:mom_tsi_def
				5:mom_tsi_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_tsi_def:redef
				5:mom_tsi_def:putatttext
				5:mom_tsi_def:defdim
				5:mom_tsi_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_tsi_def:enddef
				5:mom_tsi_def:closefile
	2:mtlmout:def_tsi_mtlm
		3:def_tsi_mtlm:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:def_tsi_mtlm:closefile
		3:def_tsi_mtlm:opennew
		3:def_tsi_mtlm:mtlm_tsi_def
			4:mtlm_tsi_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:mtlm_tsi_def:redef
			4:mtlm_tsi_def:putatttext
			4:mtlm_tsi_def:defdim
			4:mtlm_tsi_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:mtlm_tsi_def:closefile
	2:mtlmout:mtlm_tsi_out
		3:mtlm_tsi_out:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:mtlm_tsi_out:putvars
		3:mtlm_tsi_out:rdstmp
		3:mtlm_tsi_out:closefile
	2:mtlmout:ta_mtlm_snap
	2:mtlmout:def_tavg
		3:def_tavg:def_tavg_embm
			4:def_tavg_embm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tavg_embm:closefile
			4:def_tavg_embm:opennew
			4:def_tavg_embm:embm_snap_def
				5:embm_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_snap_def:redef
				5:embm_snap_def:putatttext
				5:embm_snap_def:defdim
				5:embm_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_snap_def:enddef
				5:embm_snap_def:closefile
		3:def_tavg:def_tavg_mtlm
			4:def_tavg_mtlm:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tavg_mtlm:closefile
			4:def_tavg_mtlm:opennew
			4:def_tavg_mtlm:mtlm_snap_def
				5:mtlm_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mtlm_snap_def:redef
				5:mtlm_snap_def:putatttext
				5:mtlm_snap_def:defdim
				5:mtlm_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mtlm_snap_def:enddef
				5:mtlm_snap_def:closefile
		3:def_tavg:def_tavg_mom
			4:def_tavg_mom:opennext
				5:opennext:opennew
				5:opennext:checkerror
			4:def_tavg_mom:closefile
			4:def_tavg_mom:opennew
			4:def_tavg_mom:mom_snap_def
				5:mom_snap_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_snap_def:redef
				5:mom_snap_def:putatttext
				5:mom_snap_def:defdim
				5:mom_snap_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_snap_def:enddef
				5:mom_snap_def:closefile
	2:mtlmout:def_tavg_mtlm
		3:def_tavg_mtlm:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:def_tavg_mtlm:closefile
		3:def_tavg_mtlm:opennew
		3:def_tavg_mtlm:mtlm_snap_def
			4:mtlm_snap_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:mtlm_snap_def:redef
			4:mtlm_snap_def:putatttext
			4:mtlm_snap_def:defdim
			4:mtlm_snap_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:mtlm_snap_def:enddef
			4:mtlm_snap_def:closefile
	2:mtlmout:mtlm_snap_out
		3:mtlm_snap_out:opennext
			4:opennext:opennew
			4:opennext:checkerror
		3:mtlm_snap_out:putvars
		3:mtlm_snap_out:rdstmp
		3:mtlm_snap_out:putvara
		3:mtlm_snap_out:edge_maker
		3:mtlm_snap_out:unloadland
		3:mtlm_snap_out:putvaramsk
		3:mtlm_snap_out:closefile
	2:mtlmout:def_rest
		3:def_rest:def_rest_embm
			4:def_rest_embm:embm_rest_def
				5:embm_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:embm_rest_def:redef
				5:embm_rest_def:putatttext
				5:embm_rest_def:defdim
				5:embm_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:embm_rest_def:enddef
				5:embm_rest_def:closefile
		3:def_rest:def_rest_mtlm
			4:def_rest_mtlm:mtlm_rest_def
				5:mtlm_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mtlm_rest_def:redef
				5:mtlm_rest_def:putatttext
				5:mtlm_rest_def:defdim
				5:mtlm_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mtlm_rest_def:enddef
				5:mtlm_rest_def:closefile
		3:def_rest:def_rest_mom
			4:def_rest_mom:mom_rest_def
				5:mom_rest_def:openfile
					6:openfile:opennew
					6:openfile:checkerror
				5:mom_rest_def:redef
				5:mom_rest_def:putatttext
				5:mom_rest_def:defdim
				5:mom_rest_def:defvar
					6:defvar:defdim
					6:defvar:checkerror
				5:mom_rest_def:enddef
				5:mom_rest_def:closefile
	2:mtlmout:def_rest_mtlm
		3:def_rest_mtlm:mtlm_rest_def
			4:mtlm_rest_def:openfile
				5:openfile:opennew
				5:openfile:checkerror
			4:mtlm_rest_def:redef
			4:mtlm_rest_def:putatttext
			4:mtlm_rest_def:defdim
			4:mtlm_rest_def:defvar
				5:defvar:defdim
				5:defvar:checkerror
			4:mtlm_rest_def:enddef
			4:mtlm_rest_def:closefile
	2:mtlmout:mtlm_rest_out
		3:mtlm_rest_out:openfile
			4:openfile:opennew
			4:openfile:checkerror
		3:mtlm_rest_out:putvars
		3:mtlm_rest_out:mkstmp
		3:mtlm_rest_out:rdstmp
		3:mtlm_rest_out:putvara
		3:mtlm_rest_out:edge_maker
		3:mtlm_rest_out:unloadland
		3:mtlm_rest_out:closefile
!-----------------------------------------------------------------------
!       write change in global sums for heat and fresh water
!-----------------------------------------------------------------------
1:globalsum.
	2:globalsum:getrow
		3:getrow:getlat
		3:getrow:putlat
	2:globalsum:opennext
		3:opennext:opennew
		3:opennext:checkerror
	2:globalsum:redef
	2:globalsum:putatttext
	2:globalsum:defdim
	2:globalsum:defvar
		3:defvar:defdim
		3:defvar:checkerror
	2:globalsum:enddef
	2:globalsum:putvars
	2:globalsum:rdstmp
	2:globalsum:closefile
!-----------------------------------------------------------------------
!     E N D    S E G M E N T    L O O P
!-----------------------------------------------------------------------

      print*, ' ==>  UVIC_ESCM integration is complete.'
Advertisements