/[MITgcm]/MITgcm/pkg/atm_ocn_coupler/cpl_check_cplconfig.F
ViewVC logotype

Contents of /MITgcm/pkg/atm_ocn_coupler/cpl_check_cplconfig.F

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


Revision 1.1 - (show annotations) (download)
Mon Dec 2 23:25:38 2013 UTC (10 years, 6 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint65p, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint65
- Send to coupler the number of coupler time-steps to do for this run:
  this allows to check for consistency and don't need anymore to be
  specified in parameter file "data"
- change the config check to test the agreement of Ocean Depth
  with ATM land/sea mask (instead of ATM orography)
   rename: atmDepthName --> atmLandName and Hatm --> landMask
- check consistency of RunOff map versus Ocean Depth and ATM land/sea mask.

1 C $Header: /u/gcmpack/MITgcm/pkg/atm_ocn_coupler/cpl_send_ocn_atmconfig.F,v 1.3 2006/06/15 23:29:17 jmc Exp $
2 C $Name: $
3
4 #include "CPP_OPTIONS.h"
5
6 CBOP 0
7 C !ROUTINE: CPL_CHECK_CPLCONFIG
8
9 C !INTERFACE:
10 SUBROUTINE CPL_CHECK_CPLCONFIG(
11 I msgUnit,
12 U errFlag, errMsg )
13
14 C !DESCRIPTION:
15 C *==========================================================*
16 C | SUBROUTINE CPL_CHECK_CPLCONFIG
17 C | o Routine to check Coupler config
18 C *==========================================================*
19 C | This routine also set the number of coupler time-step
20 C | to run
21 C *==========================================================*
22
23 C !USES:
24 IMPLICIT NONE
25 C == Global variables ==
26 #include "ATMSIZE.h"
27 #include "OCNSIZE.h"
28 #include "ATMVARS.h"
29 #include "OCNVARS.h"
30 #include "CPL_PARAMS.h"
31 #include "CPL_MAP2GRIDS.h"
32
33 C !INPUT/OUTPUT PARAMETERS:
34 C msgUnit :: log-file I/O unit
35 C errFlag :: logical flag to report an error
36 C errMsg :: error message to print
37 INTEGER msgUnit
38 LOGICAL errFlag
39 CHARACTER*(*) errMsg
40
41 C !LOCAL VARIABLES:
42 INTEGER i, j, n
43 INTEGER ijo, ija
44 LOGICAL tmpVar(Nx_atm,Ny_atm)
45 CEOP
46
47 C-- Define length of the run (number of coupler time-step)
48 WRITE(msgUnit,'(2A,I9)') ' CPL_CHECK_CPLCONFIG: ',
49 & 'Nb of time-steps to run (ATM) =', nSteps_atm
50 WRITE(msgUnit,'(2A,I9)') ' CPL_CHECK_CPLCONFIG: ',
51 & 'Nb of time-steps to run (OCN) =', nSteps_ocn
52 IF ( nSteps_atm .EQ. nSteps_ocn ) THEN
53 nCouplingSteps = nSteps_ocn
54 WRITE(msgUnit,'(2A,I9)') ' CPL_CHECK_CPLCONFIG: ',
55 & 'Nb of time-steps to run (CPL) =', nCouplingSteps
56 ELSE
57 errFlag = .TRUE.
58 nCouplingSteps = 0
59 WRITE(msgUnit,'(2A)') ' *** ERROR *** CPL_CHECK_CPLCONFIG: ',
60 & ' wrong Nb of time-steps to run'
61 ENDIF
62
63 C-- Check for consistent RunOff mapping regarding Land/Sea mask:
64 DO j=1,Ny_atm
65 DO i=1,Nx_atm
66 tmpVar(i,j) = landMask_atm(i,j) .EQ. 1. _d 0
67 ENDDO
68 ENDDO
69 DO n=1,nROmap
70 C a) check that RunOff drain a land point
71 ija = ijROatm(n) - 1
72 i = 1 + MOD(ija,Nx_atm)
73 j = 1 + ija/Nx_atm
74 IF ( landMask_atm(i,j).EQ.0. ) THEN
75 errFlag = .TRUE.
76 WRITE(msgUnit,'(A,2I8,A)')
77 & ' *** ERROR *** RunOff Mapp: i,j=', i, j, ' not Land point'
78 ENDIF
79 tmpVar(i,j) = .FALSE.
80 C b) and supply an ocean point
81 ijo = ijROocn(n) - 1
82 i = 1 + MOD(ijo,Nx_ocn)
83 j = 1 + ijo/Nx_ocn
84 IF ( OcMxlD_ocn(i,j).EQ.0. ) THEN
85 errFlag = .TRUE.
86 WRITE(msgUnit,'(A,2I8,A)')
87 & ' *** ERROR *** RunOff Mapp: i,j=', i, j, ' not Oce point'
88 ENDIF
89 ENDDO
90 C c) check that all land-points are drained,
91 C note: would need to know ATM grid-cell area to check that
92 C RunOff Mapping conserve water.
93 DO j=1,Ny_atm
94 DO i=1,Nx_atm
95 IF ( tmpVar(i,j) ) THEN
96 WRITE(msgUnit,'(A,2I8,A)')
97 & ' ** WARNING ** Land point: i,j=', i, j, ' not drained'
98 ENDIF
99 ENDDO
100 ENDDO
101
102 IF ( errFlag ) THEN
103 errMsg = 'in CPL_CHECK_CPLCONFIG'
104 ELSE
105 WRITE(msgUnit,'(2A)') ' CPL_CHECK_CPLCONFIG: ','done'
106 ENDIF
107
108 RETURN
109 END

  ViewVC Help
Powered by ViewVC 1.1.22