/[MITgcm]/MITgcm/pkg/mdsio/mdsio_pass_r8tors.F
ViewVC logotype

Contents of /MITgcm/pkg/mdsio/mdsio_pass_r8tors.F

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.1 - (show annotations) (download)
Mon May 11 02:20:49 2009 UTC (15 years ago) by jmc
Branch: MAIN
CVS Tags: checkpoint61n, checkpoint61o
move mapping to global io-buffer inside gather_2d/scater_2d ; save memory
(1 less 2D global RL array) + only send/receive real*4 arr when 32.bit file

1 C $Header: /u/gcmpack/MITgcm/pkg/mdsio/mdsio_passtorl.F,v 1.2 2007/07/19 15:34:50 dimitri Exp $
2 C $Name: $
3
4 #include "MDSIO_OPTIONS.h"
5
6 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
7 C- modification: no need to edit the 4 scr files mdsio_pass_r{4,8}tor{l,s}.F :
8 C from the 1rst src file (mdsio_pass_r4torl.F), can update the 3 others
9 C using the script "derive_other_types".
10 C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
11
12 CBOP
13 C !ROUTINE: MDS_PASS_R8toRS
14 C !INTERFACE:
15 SUBROUTINE MDS_PASS_R8toRS(local,arr,k,nNz,copyTo,myThid)
16
17 C !DESCRIPTION:
18 C Transfert 2-D real*8 array to 3-D RS array,
19 C or the reverse, depending on "copyTo" value.
20
21 C !USES:
22 IMPLICIT NONE
23
24 C Global variables / common blocks
25 #include "EEPARAMS.h"
26 #include "SIZE.h"
27
28 C !INPUT/OUTPUT PARAMETERS:
29 C Routine arguments
30 C local (real*8) :: local 2-D array (Input/Output if copyTo=T/F)
31 C arr ( RS ) :: model 3-D tiled array (Output/Input if copyTo=T/F)
32 C k (integer):: level index to fill in / to extract from 3-D array
33 C nNz (integer):: size of third dimension of 3-D array "arr"
34 C copyTo (logical):: if =T, copy 2-D -> 3-D ; if =F: copy 2-D <- 3-D
35 C myThid (integer):: my Thread Id number
36 INTEGER nNz
37 Real*8 local(1:sNx,1:sNy,nSx,nSy)
38 _RS arr (1-OLx:sNx+OLx,1-OLy:sNy+OLy,nNz,nSx,nSy)
39 INTEGER k
40 LOGICAL copyTo
41 INTEGER myThid
42
43 C !LOCAL VARIABLES:
44 C i,j :: loop indices
45 C bi,bj :: tile indices
46 INTEGER i,j,bi,bj
47 CEOP
48
49 IF ( copyTo ) THEN
50 DO bj = myByLo(myThid), myByHi(myThid)
51 DO bi = myBxLo(myThid), myBxHi(myThid)
52 DO j=1,sNy
53 DO i=1,sNx
54 arr(i,j,k,bi,bj) = local(i,j,bi,bj)
55 ENDDO
56 ENDDO
57 ENDDO
58 ENDDO
59 ELSE
60 DO bj = myByLo(myThid), myByHi(myThid)
61 DO bi = myBxLo(myThid), myBxHi(myThid)
62 DO j=1,sNy
63 DO i=1,sNx
64 local(i,j,bi,bj) = arr(i,j,k,bi,bj)
65 ENDDO
66 ENDDO
67 ENDDO
68 ENDDO
69 ENDIF
70
71 RETURN
72 END

  ViewVC Help
Powered by ViewVC 1.1.22