123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284 |
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !-----------------------------------------------------------------------
- ! CVS m_Permuter.F90,v 1.4 2004-04-21 22:54:45 jacob Exp
- ! CVS MCT_2_8_0
- !BOP -------------------------------------------------------------------
- !
- ! !MODULE: m_Permuter - permute/unpermute
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- module m_Permuter
- implicit none
- private ! except
- public :: permute
- public :: unpermute
- interface permute; module procedure &
- permutei_, & ! integer in place
- permuteio_, & ! integer with an output
- permutei1_, & ! integer in place
- permuteio1_, & ! integer with an output
- permuter_, & ! real in place
- permutero_, & ! real with an output
- permuter1_, & ! real in place
- permutero1_, & ! real with an output
- permuted_, & ! dble in place
- permutedo_, & ! dble with an output
- permuted1_, & ! dble in place
- permutedo1_, & ! dble with an output
- permutel_, & ! logical in place
- permutelo_, & ! logical with an output
- permutel1_, & ! logical in place
- permutelo1_ ! logical with an output
- end interface
- interface unpermute; module procedure &
- unpermutei_, & ! integer in place
- unpermuteio_, & ! integer with an output
- unpermutei1_, & ! integer in place
- unpermuteio1_, & ! integer with an output
- unpermuter_, & ! real in place
- unpermutero_, & ! real with an output
- unpermuter1_, & ! real in place
- unpermutero1_, & ! real with an output
- unpermuted_, & ! dble in place
- unpermutedo_, & ! dble with an output
- unpermuted1_, & ! dble in place
- unpermutedo1_, & ! dble with an output
- unpermutel_, & ! logical in place
- unpermutelo_, & ! logical with an output
- unpermutel1_, & ! logical in place
- unpermutelo1_ ! logical with an output
- end interface
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname='MCT(MPEU)::m_Permuter'
- contains
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutei_ - permute an integer array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutei_(ary,indx,n)
- use m_die
- implicit none
- integer,dimension(:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutei_'
- integer,allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permuteio_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permutei_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permuteio_ - permute an integer array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permuteio_(aout,ary,indx,n)
- implicit none
- integer,dimension(:),intent(inout) :: aout
- integer,dimension(:),intent(in ) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permuteio_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(i)=ary(l)
- end do
- end subroutine permuteio_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutei_ - unpermute a _permuted_ integer array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutei_(ary,indx,n)
- use m_die
- implicit none
- integer,dimension(:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutei_'
- integer,allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermuteio_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermutei_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermuteio_ - unpermute a _permuted_ integer array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermuteio_(aout,ary,indx,n)
- implicit none
- integer,dimension(:),intent(inout) :: aout
- integer,dimension(:),intent(in) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermuteio_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(l)=ary(i)
- end do
- end subroutine unpermuteio_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permuter_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permuter_(ary,indx,n)
- use m_die
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permuter_'
- real(kind(ary)),allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permutero_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permuter_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutero_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutero_(aout,ary,indx,n)
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:),intent(inout) :: aout
- real(SP),dimension(:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutero_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(i)=ary(l)
- end do
- end subroutine permutero_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermuter_ - unpermute a _permuted_ real array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermuter_(ary,indx,n)
- use m_die
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermuter_'
- real(kind(ary)),allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermutero_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermuter_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutero_ - unpermute a _permuted_ real array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutero_(aout,ary,indx,n)
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:),intent(inout) :: aout
- real(SP),dimension(:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutero_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(l)=ary(i)
- end do
- end subroutine unpermutero_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permuted_ - permute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permuted_(ary,indx,n)
- use m_die
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permuted_'
- real(kind(ary)),allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permutedo_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permuted_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutedo_ - permute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutedo_(aout,ary,indx,n)
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:),intent(inout) :: aout
- real(DP),dimension(:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutedo_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(i)=ary(l)
- end do
- end subroutine permutedo_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermuted_ - unpermute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermuted_(ary,indx,n)
- use m_die
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermuted_'
- real(kind(ary)),allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermutedo_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermuted_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutedo_ - unpermute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutedo_(aout,ary,indx,n)
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:),intent(inout) :: aout
- real(DP),dimension(:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutedo_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(l)=ary(i)
- end do
- end subroutine unpermutedo_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutel_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutel_(ary,indx,n)
- use m_die
- implicit none
- logical,dimension(:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutel_'
- logical,allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permutelo_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permutel_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutelo_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutelo_(aout,ary,indx,n)
- implicit none
- logical,dimension(:),intent(inout) :: aout
- logical,dimension(:),intent(in) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutelo_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(i)=ary(l)
- end do
- end subroutine permutelo_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutel_ - unpermute a _permuted_ logical array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutel_(ary,indx,n)
- use m_die
- implicit none
- logical,dimension(:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutel_'
- logical,allocatable,dimension(:) :: wk
- integer :: i,ier
- allocate(wk(n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermutelo_(wk,ary,indx,n)
- do i=1,n
- ary(i)=wk(i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermutel_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutelo_ - unpermute a _permuted_ logical array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutelo_(aout,ary,indx,n)
- implicit none
- logical,dimension(:),intent(inout) :: aout
- logical,dimension(:),intent(in) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutelo_'
- integer :: i,l
- do i=1,n
- l=indx(i)
- aout(l)=ary(i)
- end do
- end subroutine unpermutelo_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutei1_ - permute an integer array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutei1_(ary,indx,n)
- use m_die
- implicit none
- integer,dimension(:,:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutei1_'
- integer,allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permuteio1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permutei1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permuteio1_ - permute an integer array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permuteio1_(aout,ary,indx,n)
- implicit none
- integer,dimension(:,:),intent(inout) :: aout
- integer,dimension(:,:),intent(in ) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permuteio1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,i)=ary(1:m,l)
- end do
- end subroutine permuteio1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutei1_ - unpermute a _permuted_ integer array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutei1_(ary,indx,n)
- use m_die
- implicit none
- integer,dimension(:,:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutei1_'
- integer,allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermuteio1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermutei1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermuteio1_ - unpermute a _permuted_ integer array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermuteio1_(aout,ary,indx,n)
- implicit none
- integer,dimension(:,:),intent(inout) :: aout
- integer,dimension(:,:),intent(in) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermuteio1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,l)=ary(1:m,i)
- end do
- end subroutine unpermuteio1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permuter1_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permuter1_(ary,indx,n)
- use m_die
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:,:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permuter1_'
- real(kind(ary)),allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permutero1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permuter1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutero1_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutero1_(aout,ary,indx,n)
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:,:),intent(inout) :: aout
- real(SP),dimension(:,:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutero1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,i)=ary(1:m,l)
- end do
- end subroutine permutero1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermuter1_ - unpermute a _permuted_ real array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermuter1_(ary,indx,n)
- use m_die
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:,:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermuter1_'
- real(kind(ary)),allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermutero1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermuter1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutero1_ - unpermute a _permuted_ real array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutero1_(aout,ary,indx,n)
- use m_realkinds,only : SP
- implicit none
- real(SP),dimension(:,:),intent(inout) :: aout
- real(SP),dimension(:,:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutero1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,l)=ary(1:m,i)
- end do
- end subroutine unpermutero1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permuted1_ - permute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permuted1_(ary,indx,n)
- use m_die
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:,:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permuted1_'
- real(kind(ary)),allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permutedo1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permuted1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutedo1_ - permute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutedo1_(aout,ary,indx,n)
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:,:),intent(inout) :: aout
- real(DP),dimension(:,:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutedo1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,i)=ary(1:m,l)
- end do
- end subroutine permutedo1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermuted1_ - unpermute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermuted1_(ary,indx,n)
- use m_die
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:,:),intent(inout) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermuted1_'
- real(kind(ary)),allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermutedo1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermuted1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutedo1_ - unpermute a double precision array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutedo1_(aout,ary,indx,n)
- use m_realkinds,only : DP
- implicit none
- real(DP),dimension(:,:),intent(inout) :: aout
- real(DP),dimension(:,:),intent(in) :: ary
- integer ,dimension(:),intent(in) :: indx
- integer , intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutedo1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,l)=ary(1:m,i)
- end do
- end subroutine unpermutedo1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutel1_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutel1_(ary,indx,n)
- use m_die
- implicit none
- logical,dimension(:,:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutel1_'
- logical,allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call permutelo1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine permutel1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: permutelo1_ - permute a real array according to indx[]
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine permutelo1_(aout,ary,indx,n)
- implicit none
- logical,dimension(:,:),intent(inout) :: aout
- logical,dimension(:,:),intent(in) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::permutelo1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,i)=ary(1:m,l)
- end do
- end subroutine permutelo1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutel1_ - unpermute a _permuted_ logical array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutel1_(ary,indx,n)
- use m_die
- implicit none
- logical,dimension(:,:),intent(inout) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutel1_'
- logical,allocatable,dimension(:,:) :: wk
- integer :: i,l,ier
- l=size(ary,1)
- allocate(wk(l,n),stat=ier)
- if(ier/=0) call perr_die(myname_,'allocate()',ier)
- call unpermutelo1_(wk,ary,indx,n)
- do i=1,n
- ary(:,i)=wk(:,i)
- end do
- deallocate(wk,stat=ier)
- if(ier/=0) call perr_die(myname_,'deallocate()',ier)
- end subroutine unpermutel1_
- !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ! NASA/GSFC, Data Assimilation Office, Code 910.3, GEOS/DAS !
- !BOP -------------------------------------------------------------------
- !
- ! !IROUTINE: unpermutelo1_ - unpermute a _permuted_ logical array
- !
- ! !DESCRIPTION:
- !
- ! !INTERFACE:
- subroutine unpermutelo1_(aout,ary,indx,n)
- implicit none
- logical,dimension(:,:),intent(inout) :: aout
- logical,dimension(:,:),intent(in) :: ary
- integer,dimension(:),intent(in) :: indx
- integer, intent(in) :: n
- ! !REVISION HISTORY:
- ! 25Aug99 - Jing Guo <guo@dao.gsfc.nasa.gov>
- ! - initial prototype/prolog/code
- !EOP ___________________________________________________________________
- character(len=*),parameter :: myname_=myname//'::unpermutelo1_'
- integer :: i,l,m
- m=min(size(aout,1),size(ary,1))
- do i=1,n
- l=indx(i)
- aout(1:m,l)=ary(1:m,i)
- end do
- end subroutine unpermutelo1_
- end module m_Permuter
|