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

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

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


Revision 1.1 - (show annotations) (download)
Thu Nov 3 16:06:57 2005 UTC (18 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint58r_post, checkpoint58l_post, checkpoint57y_post, checkpoint58k_post, checkpoint58c_post, checkpoint59d, checkpoint59a, checkpoint57x_post, checkpoint59c, checkpoint59b, checkpoint57y_pre, checkpoint59, checkpoint58, checkpoint58e_post, mitgcm_mapl_00, checkpoint58n_post, checkpoint58x_post, checkpoint58y_post, checkpoint58v_post, checkpoint58w_post, checkpoint58t_post, checkpoint58h_post, checkpoint58s_post, checkpoint58p_post, checkpoint58f_post, checkpoint58b_post, checkpoint58m_post, checkpoint58q_post, checkpoint58j_post, checkpoint58d_post, checkpoint57w_post, checkpoint58a_post, checkpoint58i_post, checkpoint58u_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post
take PASStoRL & PASStoRS out of mdsio_readfield.F, and add argument copyTo
 to do the reverse copy.

1 C $Header: $
2 C $Name: $
3
4 #include "MDSIO_OPTIONS.h"
5
6 C ==================================================================
7
8 SUBROUTINE MDS_PASStoRL(local,arr,k,nNz,copyTo,myThid)
9
10 C Arguments:
11 C
12 C local RL local 2-D array (Input/Output if copyTo=T/F)
13 C arr RL model 3-D tiled array (Output/Input if copyTo=T/F)
14 C k integer level index to fill in / to extract from 3-D array
15 C nNz integer size of third dimension of 3-D array "arr"
16 C copyTo logical if =T, copy 2-D -> 3-D ; if =F: copy 2-D <- 3-D
17 C myThid integer thread identifier
18 C
19 C MDS_PASStoRL transfert 2-D RL array to 3-D RL array,
20 C or the reverse, depending on "copyTo" value.
21
22 IMPLICIT NONE
23
24 C Global variables / common blocks
25 #include "EEPARAMS.h"
26 #include "SIZE.h"
27
28 C Routine arguments
29 INTEGER nNz
30 _RL local(1-oLx:sNx+oLx,1-oLy:sNy+oLy,nSx,nSy)
31 _RL arr (1-oLx:sNx+oLx,1-oLy:sNy+oLy,nNz,nSx,nSy)
32 INTEGER k
33 LOGICAL copyTo
34 INTEGER myThid
35
36 C Local variables
37 INTEGER i,j,bi,bj
38
39 IF ( copyTo ) THEN
40 DO bj = myByLo(myThid), myByHi(myThid)
41 DO bi = myBxLo(myThid), myBxHi(myThid)
42 DO j=1-Oly,sNy+Oly
43 DO i=1-Olx,sNx+Olx
44 arr(i,j,k,bi,bj) = local(i,j,bi,bj)
45 ENDDO
46 ENDDO
47 ENDDO
48 ENDDO
49 ELSE
50 DO bj = myByLo(myThid), myByHi(myThid)
51 DO bi = myBxLo(myThid), myBxHi(myThid)
52 DO j=1-Oly,sNy+Oly
53 DO i=1-Olx,sNx+Olx
54 local(i,j,bi,bj) = arr(i,j,k,bi,bj)
55 ENDDO
56 ENDDO
57 ENDDO
58 ENDDO
59 ENDIF
60
61 RETURN
62 END

  ViewVC Help
Powered by ViewVC 1.1.22