1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669 |
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- ! CVS m_mall.F90,v 1.5 2004-04-21 22:54:47 jacob Exp
- ! CVS MCT_2_8_0
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !MODULE: m_mall - A bookkeeper of user allocated memories
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- module m_mall
- implicit none
- private ! except
- public :: mall_ci
- public :: mall_co
- public :: mall_mci
- public :: mall_mco
- public :: mall_flush
- public :: mall_reset
- ! mall_ activity controls
- public :: mall_ison
- public :: mall_set
- interface mall_ci; module procedure ci_; end interface
- interface mall_co; module procedure co_; end interface
- interface mall_mci; module procedure &
- ciI0_, &
- ciI1_, &
- ciI2_, &
- ciI3_, &
- ciR0_, &
- ciR1_, &
- ciR2_, &
- ciR3_, &
- ciD0_, &
- ciD1_, &
- ciD2_, &
- ciD3_, &
- ciL0_, &
- ciL1_, &
- ciL2_, &
- ciL3_, &
- ciC0_, &
- ciC1_, &
- ciC2_, &
- ciC3_
- end interface
- interface mall_mco; module procedure &
- coI0_, &
- coI1_, &
- coI2_, &
- coI3_, &
- coR0_, &
- coR1_, &
- coR2_, &
- coR3_, &
- coD0_, &
- coD1_, &
- coD2_, &
- coD3_, &
- coL0_, &
- coL1_, &
- coL2_, &
- coL3_, &
- coC0_, &
- coC1_, &
- coC2_, &
- coC3_
- end interface
- interface mall_flush; module procedure flush_; end interface
- interface mall_reset; module procedure reset_; end interface
- interface mall_ison; module procedure ison_; end interface
- interface mall_set; module procedure set_; end interface
- ! !REVISION HISTORY:
- ! 13Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname='MCT(MPEU)::m_mall'
- #if SYSUNICOS || SYSIRIX64 || _R8_
- integer,parameter :: NBYTE_PER_WORD = 8
- #else
- integer,parameter :: NBYTE_PER_WORD = 4
- #endif
- integer,parameter :: NSZ= 32
- integer,parameter :: MXL=250
- integer, save :: nreset = 0 ! number of reset_() calls
- logical, save :: started = .false. ! the module is in use
- integer, save :: n_ =0 ! number of accouting bins.
- character(len=NSZ),dimension(MXL),save :: name_
- ! integer, dimension(1) :: mall
- ! names of the accouting bins
- logical,save :: mall_on=.false. ! mall activity switch
- integer,save :: mci
- integer,dimension(MXL),save :: mci_ ! maximum ci_() calls
- integer,save :: nci
- integer,dimension(MXL),save :: nci_ ! net ci_() calls
- integer,save :: hwm
- integer,dimension(MXL),save :: hwm_ ! high-water-mark of allocate()
- integer,save :: nwm
- integer,dimension(MXL),save :: nwm_ ! net-water-mark of allocate()
- contains
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ison_ -
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- function ison_()
- implicit none
- logical :: ison_
- ! !REVISION HISTORY:
- ! 25Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ison_'
- ison_=mall_on
- end function ison_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: set_ - set the switch on
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine set_(on)
- implicit none
- logical,optional,intent(in) :: on
- ! !REVISION HISTORY:
- ! 25Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::set_'
- mall_on=.true.
- if(present(on)) mall_on=on
- end subroutine set_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciI0_ - check in as an integer scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciI0_(marg,thread)
- implicit none
- integer,intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciI0_'
- if(mall_on) call ci_(1,thread)
- end subroutine ciI0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciI1_ - check in as an integer rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciI1_(marg,thread)
- implicit none
- integer,dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciI1_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciI1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciI2_ - check in as an integer rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciI2_(marg,thread)
- implicit none
- integer,dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciI2_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciI2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciI3_ - check in as an integer rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciI3_(marg,thread)
- implicit none
- integer,dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciI3_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciI3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciR0_ - check in as a real(SP) scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciR0_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciR0_'
- if(mall_on) call ci_(1,thread)
- end subroutine ciR0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciR1_ - check in as a real(SP) rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciR1_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciR1_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciR1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciR2_ - check in as a real(SP) rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciR2_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciR2_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciR2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciR3_ - check in as a real(SP) rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciR3_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciR3_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciR3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciD0_ - check in as a real(DP) scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciD0_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciD0_'
- if(mall_on) call ci_(2,thread)
- end subroutine ciD0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciD1_ - check in as a real(DP) rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciD1_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciD1_'
- if(mall_on) call ci_(2*size(marg),thread)
- end subroutine ciD1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciD2_ - check in as a real(DP) rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciD2_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciD2_'
- if(mall_on) call ci_(2*size(marg),thread)
- end subroutine ciD2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciD3_ - check in as a real(DP) rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciD3_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciD3_'
- if(mall_on) call ci_(2*size(marg),thread)
- end subroutine ciD3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciL0_ - check in as a logical scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciL0_(marg,thread)
- implicit none
- logical,intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciL0_'
- if(mall_on) call ci_(1,thread)
- end subroutine ciL0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciL1_ - check in as a logical rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciL1_(marg,thread)
- implicit none
- logical,dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciL1_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciL1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciL2_ - check in as a logical rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciL2_(marg,thread)
- implicit none
- logical,dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciL2_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciL2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciL3_ - check in as a logical rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciL3_(marg,thread)
- implicit none
- logical,dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciL3_'
- if(mall_on) call ci_(size(marg),thread)
- end subroutine ciL3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciC0_ - check in as a character scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciC0_(marg,thread)
- implicit none
- character(len=*),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciC0_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg)+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call ci_(nw,thread)
- end subroutine ciC0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciC1_ - check in as a character rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciC1_(marg,thread)
- implicit none
- character(len=*),dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciC1_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg(1))+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call ci_(size(marg)*nw,thread)
- end subroutine ciC1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciC2_ - check in as a character rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciC2_(marg,thread)
- implicit none
- character(len=*),dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciC2_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg(1,1))+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call ci_(size(marg)*nw,thread)
- end subroutine ciC2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: ciC3_ - check in as a character rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ciC3_(marg,thread)
- implicit none
- character(len=*),dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ciC3_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg(1,1,1))+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call ci_(size(marg)*nw,thread)
- end subroutine ciC3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: ci_ - check-in allocate activity
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine ci_(nword,thread)
- use m_stdio, only : stderr
- use m_die, only : die
- implicit none
- integer,intent(in) :: nword
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 13Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::ci_'
- integer :: ith
- if(.not.mall_on) return
- if(nword < 0) then
- write(stderr,'(2a,i4)') myname_, &
- ': invalide argument, nword = ',nword
- call die(myname_)
- endif
- ith=lookup_(thread)
- ! update the account
- nci_(ith)=nci_(ith)+1
- mci_(ith)=mci_(ith)+1
- nwm_(ith)=nwm_(ith)+nword
- if(hwm_(ith).lt.nwm_(ith)) hwm_(ith)=nwm_(ith)
- ! update the total budget
- nci=nci+1
- mci=mci+1
- nwm=nwm+nword
- if(hwm.lt.nwm) hwm=nwm
- end subroutine ci_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coI0_ - check in as an integer scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coI0_(marg,thread)
- implicit none
- integer,intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coI0_'
- if(mall_on) call co_(1,thread)
- end subroutine coI0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coI1_ - check in as an integer rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coI1_(marg,thread)
- implicit none
- integer,dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coI1_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coI1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coI2_ - check in as an integer rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coI2_(marg,thread)
- implicit none
- integer,dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coI2_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coI2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coI3_ - check in as an integer rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coI3_(marg,thread)
- implicit none
- integer,dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coI3_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coI3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coR0_ - check in as a real(SP) scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coR0_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coR0_'
- if(mall_on) call co_(1,thread)
- end subroutine coR0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coR1_ - check in as a real(SP) rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coR1_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coR1_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coR1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coR2_ - check in as a real(SP) rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coR2_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coR2_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coR2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coR3_ - check in as a real(SP) rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coR3_(marg,thread)
- use m_realkinds, only : SP
- implicit none
- real(SP),dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coR3_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coR3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coD0_ - check in as a real(DP) scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coD0_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coD0_'
- if(mall_on) call co_(2,thread)
- end subroutine coD0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coD1_ - check in as a real(DP) rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coD1_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coD1_'
- if(mall_on) call co_(2*size(marg),thread)
- end subroutine coD1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coD2_ - check in as a real(DP) rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coD2_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coD2_'
- if(mall_on) call co_(2*size(marg),thread)
- end subroutine coD2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coD3_ - check in as a real(DP) rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coD3_(marg,thread)
- use m_realkinds, only : DP
- implicit none
- real(DP),dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coD3_'
- if(mall_on) call co_(2*size(marg),thread)
- end subroutine coD3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coL0_ - check in as a logical scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coL0_(marg,thread)
- implicit none
- logical,intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coL0_'
- if(mall_on) call co_(1,thread)
- end subroutine coL0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coL1_ - check in as a logical rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coL1_(marg,thread)
- implicit none
- logical,dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coL1_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coL1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coL2_ - check in as a logical rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coL2_(marg,thread)
- implicit none
- logical,dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coL2_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coL2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coL3_ - check in as a logical rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coL3_(marg,thread)
- implicit none
- logical,dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coL3_'
- if(mall_on) call co_(size(marg),thread)
- end subroutine coL3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coC0_ - check in as a character scalar
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coC0_(marg,thread)
- implicit none
- character(len=*),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coC0_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg)+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call co_(nw,thread)
- end subroutine coC0_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coC1_ - check in as a character rank 1 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coC1_(marg,thread)
- implicit none
- character(len=*),dimension(:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coC1_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg(1))+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call co_(size(marg)*nw,thread)
- end subroutine coC1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coC2_ - check in as a character rank 2 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coC2_(marg,thread)
- implicit none
- character(len=*),dimension(:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coC2_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg(1,1))+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call co_(size(marg)*nw,thread)
- end subroutine coC2_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: coC3_ - check in as a character rank 3 array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine coC3_(marg,thread)
- implicit none
- character(len=*),dimension(:,:,:),intent(in) :: marg
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 21Oct99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::coC3_'
- integer :: nw
- if(.not.mall_on) return
- nw=(len(marg(1,1,1))+NBYTE_PER_WORD-1)/NBYTE_PER_WORD
- call co_(size(marg)*nw,thread)
- end subroutine coC3_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: co_ - check-out allocate activity
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine co_(nword,thread)
- use m_stdio, only : stderr
- use m_die, only : die
- implicit none
- integer,intent(in) :: nword
- character(len=*),intent(in) :: thread
- ! !REVISION HISTORY:
- ! 13Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::co_'
- integer :: ith
- if(.not.mall_on) return
- if(nword < 0) then
- write(stderr,'(2a,i4)') myname_, &
- ': invalide argument, nword = ',nword
- call die(myname_)
- endif
- ! if the thread is "unknown", it would be treated as a
- ! new thread with net negative memory activity.
- ith=lookup_(thread)
- ! update the account
- nci_(ith)=nci_(ith)-1
- nwm_(ith)=nwm_(ith)-nword
- ! update the total budget
- nci=nci-1
- nwm=nwm-nword
- end subroutine co_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: cix_ - handling macro ALLOC_() error
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine cix_(thread,stat,fnam,line)
- use m_stdio, only : stderr
- use m_die, only : die
- implicit none
- character(len=*),intent(in) :: thread
- integer,intent(in) :: stat
- character(len=*),intent(in) :: fnam
- integer,intent(in) :: line
- ! !REVISION HISTORY:
- ! 13Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::cix_'
- write(stderr,'(2a,i4)') trim(thread), &
- ': ALLOC_() error, stat =',stat
- call die('ALLOC_',fnam,line)
- end subroutine cix_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: cox_ - handling macro DEALLOC_() error
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine cox_(thread,stat,fnam,line)
- use m_stdio, only : stderr
- use m_die, only : die
- implicit none
- character(len=*),intent(in) :: thread
- integer,intent(in) :: stat
- character(len=*),intent(in) :: fnam
- integer,intent(in) :: line
- ! !REVISION HISTORY:
- ! 13Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::cox_'
- write(stderr,'(2a,i4)') trim(thread), &
- ': DEALLOC_() error, stat =',stat
- call die('DEALLOC_',fnam,line)
- end subroutine cox_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: flush_ - balancing the up-to-date ci/co calls
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine flush_(lu)
- use m_stdio, only : stderr
- use m_ioutil, only : luflush
- use m_die, only : die
- implicit none
- integer,intent(in) :: lu
- ! !REVISION HISTORY:
- ! 17Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::flush_'
- integer,parameter :: lnmax=38
- character(len=max(lnmax,NSZ)) :: name
- character(len=6) :: hwm_wd,nwm_wd
- character(len=1) :: flag_ci,flag_wm
- integer :: i,ier,ln
- if(.not.mall_on) return
- if(.not.started) call reset_()
- write(lu,'(72a/)',iostat=ier) ('_',i=1,72)
- if(ier /= 0) then
- write(stderr,'(2a,i3)') myname_,': can not write(), unit =',lu
- call die(myname_)
- endif
- write(lu,'(a,t39,4(2x,a))',iostat=ier) '[MALL]', &
- 'max-ci','net-ci ','max-wm','net-wm'
- if(ier /= 0) then
- write(stderr,'(2a,i4)') myname_,': can not write(), unit =',lu
- call die(myname_)
- endif
- call luflush(lu)
- !23.|....1....|....2....|....3....|....4....|....5....|....6....|....7..
- !_______________________________________________________________________
- !
- ![MALL] max_ci net-ci max-wm net-wm
- !-----------------------------------------------------------------------
- !total. ...333 ...333* ..333M ..333i*
- !_______________________________________________________________________
- write(lu,'(72a)') ('-',i=1,72)
- do i=1,min(n_,MXL)
- call wcount_(hwm_(i),hwm_wd)
- call wcount_(nwm_(i),nwm_wd)
-
- flag_ci=' '
- if(nci_(i) /= 0) flag_ci='*'
- flag_wm=' '
- if(nwm_(i) /= 0) flag_wm='*'
- name=name_(i)
- ln=max(len_trim(name),lnmax)
- write(lu,'(a,2(2x,i6),a,2(2x,a6),a)') name(1:ln), &
- mci_(i),nci_(i),flag_ci,hwm_wd,nwm_wd,flag_wm
- end do
- call wcount_(hwm,hwm_wd)
- call wcount_(nwm,nwm_wd)
-
- flag_ci=' '
- if(nci /= 0) flag_ci='*'
- flag_wm=' '
- if(nwm /= 0) flag_wm='*'
- name='.total.'
- ln=max(len_trim(name),lnmax)
- write(lu,'(a,2(2x,i6),a,2(2x,a6),a)') name(1:ln), &
- mci,nci,flag_ci,hwm_wd,nwm_wd,flag_wm
- write(lu,'(72a/)') ('_',i=1,72)
- if(nreset /= 1) write(lu,'(2a,i3,a)') myname_, &
- ': reset_ ',nreset,' times'
- call luflush(lu)
- end subroutine flush_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: wcount_ - generate word count output with unit
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine wcount_(wknt,cknt)
- implicit none
- integer, intent(in) :: wknt ! given an integer value
- character(len=6),intent(out) :: cknt ! return a string value
- ! !REVISION HISTORY:
- ! 17Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::wcount_'
- character(len=1) :: cwd
- integer,parameter :: KWD=1024
- integer,parameter :: MWD=1024*1024
- integer,parameter :: GWD=1024*1024*1024
- integer :: iwd
- if(wknt < 0) then
- cknt='------'
- else
- cwd='i'
- iwd=wknt
- if(iwd > 9999) then
- cwd='K'
- iwd=(wknt+KWD-1)/KWD
- endif
- if(iwd > 9999) then
- cwd='M'
- iwd=(wknt+MWD-1)/MWD
- endif
- if(iwd > 9999) then
- cwd='G'
- iwd=(wknt+GWD-1)/GWD
- endif
- write(cknt,'(i5,a)') iwd,cwd
- endif
- end subroutine wcount_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: lookup_ - search/insert a name in a list
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- function lookup_(thread)
- use m_chars, only : uppercase
- implicit none
- character(len=*),intent(in) :: thread
- integer :: lookup_
- ! !REVISION HISTORY:
- ! 17Feb98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::lookup_'
- logical :: found
- integer :: ith
- if(.not.started) call reset_()
- !----------------------------------------
- ith=0
- found=.false.
- do while(.not.found .and. ith < min(n_,MXL))
- ith=ith+1
- found= uppercase(thread) == uppercase(name_(ith))
- end do
- if(.not.found) then
- if(n_==0) then
- nci=0
- mci=0
- nwm=0
- hwm=0
- endif
- n_=n_+1
- if(n_ == MXL) then
- ith=MXL
- name_(ith)='.overflow.'
- else
- ith=n_
- name_(ith)=thread
- endif
- nci_(ith)=0
- mci_(ith)=0
- nwm_(ith)=0
- hwm_(ith)=0
- endif
- lookup_=ith
- end function lookup_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- !BOP
- !
- ! !IROUTINE: reset_ - initialize the module data structure
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine reset_()
- implicit none
- ! !REVISION HISTORY:
- ! 16Mar98 - Jing Guo <guo@thunder> - initial prototype/prolog/code
- !EOP
- !_______________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::reset_'
- if(.not.mall_on) return
- nreset=nreset+1
- started=.true.
- name_(1:n_)=' '
- mci_(1:n_)=0
- nci_(1:n_)=0
- hwm_(1:n_)=0
- nwm_(1:n_)=0
- n_ =0
- mci=0
- nci=0
- hwm=0
- nwm=0
- end subroutine reset_
- !=======================================================================
- end module m_mall
|