/[MITgcm]/MITgcm/pkg/dic/dic_read_co2_pickup.F
ViewVC logotype

Contents of /MITgcm/pkg/dic/dic_read_co2_pickup.F

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


Revision 1.2 - (show annotations) (download)
Mon Mar 14 01:38:04 2011 UTC (13 years, 3 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint63, checkpoint65r, checkpoint65p, checkpoint65q, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62z, checkpoint62y, checkpoint62x
Changes since 1.1: +8 -3 lines
change argument list of S/R MDS_CHECK4FILE ; fix the use of mdsioLocalDir.

1 C $Header: /u/gcmpack/MITgcm/pkg/dic/dic_read_co2_pickup.F,v 1.1 2010/04/11 20:59:27 jmc Exp $
2 C $Name: $
3
4 #include "DIC_OPTIONS.h"
5
6 SUBROUTINE DIC_READ_CO2_PICKUP(
7 I myIter, myThid )
8
9 IMPLICIT NONE
10 C === Global variables ===
11 #include "SIZE.h"
12 #include "EEPARAMS.h"
13 #include "PARAMS.h"
14 #include "DIC_VARS.h"
15 #include "DIC_ATMOS.h"
16
17 C == Routine arguments ==
18 C myThid :: my Thread Id number
19 INTEGER myIter
20 INTEGER myThid
21
22 #ifdef ALLOW_DIC
23
24 #ifdef USE_ATMOSCO2
25 C if coupled to atmsopheric model, use the
26 C CO2 value passed from the coupler
27
28 #else /* USE_ATMOSCO2 */
29
30 C !FUNCTIONS
31 INTEGER MDS_RECLEN
32 EXTERNAL MDS_RECLEN
33
34 C !LOCAL VARIABLES:
35 C == Local variables ==
36 INTEGER fp, ioUnit
37 CHARACTER*(MAX_LEN_FNAM) fn, filNam
38 CHARACTER*(MAX_LEN_MBUF) msgBuf
39 LOGICAL useCurrentDir, fileExist
40 REAL*8 tmpFld(2)
41 INTEGER length_of_rec
42 CEOP
43
44 IF ( dic_int1.EQ.3 ) THEN
45
46 IF (pickupSuff.EQ.' ') THEN
47 WRITE(fn,'(A,I10.10)') 'pickup_dic_co2atm.', myIter
48 ELSE
49 WRITE(fn,'(A,A10)') 'pickup_dic_co2atm.', pickupSuff
50 ENDIF
51 fp = precFloat64
52
53 C-- First check if pickup file exist
54 #ifdef ALLOW_MDSIO
55 useCurrentDir = .FALSE.
56 CALL MDS_CHECK4FILE(
57 I fn, '.data', 'DIC_READ_CO2_PICKUP',
58 O filNam, fileExist,
59 I useCurrentDir, myThid )
60 #else
61 STOP 'ABNORMAL END: S/R DIC_READ_CO2_PICKUP: Needs MDSIO pkg'
62 #endif
63 IF ( .NOT.fileExist ) THEN
64 WRITE(msgBuf,'(4A)') 'DIC_READ_CO2_PICKUP: ',
65 & 'with dic_int1=3, needs CO2-atmos pickup to restart'
66 CALL PRINT_ERROR( msgBuf, myThid )
67 STOP 'ABNORMAL END: S/R DIC_READ_CO2_PICKUP'
68 ENDIF
69 _BEGIN_MASTER(myThid)
70 CALL MDSFINDUNIT( ioUnit, myThid )
71 length_of_rec = MDS_RECLEN( fp, 2, myThid )
72 OPEN( ioUnit, file=filNam, status='old',
73 & access='direct', recl=length_of_rec )
74 READ(ioUnit,rec=1) tmpFld
75 #ifdef _BYTESWAPIO
76 CALL MDS_BYTESWAPR8( 2, tmpFld )
77 #endif
78 total_atmos_carbon = tmpFld(1)
79 atpco2 = tmpFld(2)
80
81 _END_MASTER(myThid)
82 c _BARRIER
83 ENDIF
84
85 #endif /* ndef USE_ATMOSCO2 */
86
87 #endif /* ALLOW_DIC */
88
89 RETURN
90 END

  ViewVC Help
Powered by ViewVC 1.1.22