1 |
C $Header: /u/gcmpack/MITgcm/pkg/mdsio/mdsio_readvector.F,v 1.11 2008/09/30 22:39:25 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
#include "CPP_EEOPTIONS.h" |
5 |
|
6 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
7 |
CBOP 0 |
8 |
C !ROUTINE: MDS_BUFFERtoRL |
9 |
|
10 |
C !INTERFACE: |
11 |
SUBROUTINE MDS_BUFFERtoRL( vecBuf, arr, narr, copyTo, myThid ) |
12 |
|
13 |
C !DESCRIPTION: |
14 |
C Copy from Buffer to RL array "arr", if copyTo=T ; otherwise do the reverse |
15 |
|
16 |
C !USES: |
17 |
IMPLICIT NONE |
18 |
c#include "EEPARAMS.h" |
19 |
|
20 |
C !INPUT/OUTPUT PARAMETERS: |
21 |
C vecBuf ( RL ) :: buffer vector array (Input/Output if copyTo=T/F) |
22 |
C arr ( RL ) :: model vector array (Output/Input if copyTo=T/F) |
23 |
C narr (integer) :: dimension of buffer & model vector array |
24 |
C copyTo (logical) :: if =T, copy buffer -> model ; if =F: copy buffer <- model |
25 |
C myThid (integer) :: my Thread Id number |
26 |
INTEGER narr |
27 |
_RL vecBuf(narr) |
28 |
_RL arr(narr) |
29 |
LOGICAL copyTo |
30 |
INTEGER myThid |
31 |
CEOP |
32 |
|
33 |
C !LOCAL VARIABLES: |
34 |
INTEGER L |
35 |
|
36 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
37 |
|
38 |
IF (copyTo) THEN |
39 |
DO L=1,narr |
40 |
arr(L) = vecBuf(L) |
41 |
ENDDO |
42 |
ELSE |
43 |
DO L=1,narr |
44 |
vecBuf(L) = arr(L) |
45 |
ENDDO |
46 |
ENDIF |
47 |
|
48 |
RETURN |
49 |
END |