/[MITgcm]/MITgcm_contrib/nesting_sannino/nest_parent/nest_parent_check.F
ViewVC logotype

Annotation of /MITgcm_contrib/nesting_sannino/nest_parent/nest_parent_check.F

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


Revision 1.3 - (hide annotations) (download)
Mon Nov 29 14:24:14 2010 UTC (14 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +60 -18 lines
check for consistent number of nesting-steps between parent & child:
 if they agree, set number of nesting-steps in driver accordingly;
 if not, stop cleanly (call MPI_FINALIZE & stop).

1 jmc 1.3 C $Header: /u/gcmpack/MITgcm_contrib/nesting_sannino/nest_parent/nest_parent_check.F,v 1.2 2009/10/23 19:42:00 sannino Exp $
2 heimbach 1.1 C $Name: $
3 jmc 1.3
4 heimbach 1.1 #include "NEST_PARENT_OPTIONS.h"
5    
6 jmc 1.3 CBOP
7     C !ROUTINE: NEST_PARENT_CHECK
8    
9     C !INTERFACE:
10 heimbach 1.1 SUBROUTINE NEST_PARENT_CHECK( myThid )
11 jmc 1.3
12     C !DESCRIPTION:
13     C *==========================================================*
14     C | SUBROUTINE NEST_PARENT_CHECK
15     C | o Validate basic package setup and inter-package
16     C | dependencies.
17     C *==========================================================*
18    
19     C !USES:
20 heimbach 1.1 IMPLICIT NONE
21    
22     C === Global variables ===
23     #include "SIZE.h"
24     #include "EEPARAMS.h"
25     #include "PARAMS.h"
26 jmc 1.3 #include "EESUPPORT.h"
27     #include "NEST_PARENT_PARAMS.h"
28 heimbach 1.1
29 jmc 1.3 C !INPUT/OUTPUT PARAMETERS:
30     C myThid :: my Thread Id number
31 heimbach 1.1 INTEGER myThid
32 jmc 1.3 CEOP
33 heimbach 1.1
34 jmc 1.3 C !LOCAL VARIABLES:
35     C msgBuf :: Informational/error message buffer
36 heimbach 1.1 CHARACTER*(MAX_LEN_MBUF) msgBuf
37 jmc 1.3 INTEGER nNestSteps, checkSteps
38     INTEGER ierr, istatus
39 heimbach 1.1
40 jmc 1.3 WRITE(msgBuf,'(A)')
41     & 'NEST_PARENT_CHECK: #define ALLOW_NEST_PARENT'
42 heimbach 1.1 CALL PRINT_MESSAGE( msgBuf, standardMessageUnit,
43 jmc 1.3 & SQUEEZE_RIGHT, myThid )
44    
45     _BEGIN_MASTER( myThid )
46    
47     C-- Check length of integration between components.
48     C- units: number of nesting-steps (since driver ignores CLD/PAR time steps)
49     nNestSteps = nTimeSteps/1
50     IF ( MOD( nNestSteps, 1 ).NE.0 ) nNestSteps = -1
51     IF ( mpiMyId.EQ.0 ) THEN
52     C- Send to driver the number of expected nesting-exchanges with driver:
53     CALL MPI_SEND( nNestSteps, 1, MPI_INTEGER,
54     & MSTR_DRV_P(NST_LEV_P), 3000,
55     & MPI_Comm_World, ierr )
56     ENDIF
57    
58     C Receive error code (-1) from World-Master if inconsistent nNestSteps.
59     C Note: This is not broadcast from MSTR_DRV_P(NST_LEV_P) since everybody
60     C in the World need to catch error, call MPI_FINALIZE & stop.
61     CALL MPI_BCAST( checkSteps, 1, MPI_INTEGER,
62     & 0, MPI_Comm_World, ierr )
63     C- Check for mismatch:
64     IF ( checkSteps .EQ. -1 ) THEN
65     WRITE(msgBuf,'(A,I8)')
66     & 'NEST_PARENT_CHECK: Nb Nesting steps =', nNestSteps
67     CALL PRINT_ERROR( msgBuf, myThid )
68     WRITE(msgBuf,'(A)')
69     & 'NEST_PARENT_CHECK: CHILD nb of steps does NOT match'
70     CALL PRINT_ERROR( msgBuf, myThid )
71     CALL MPI_FINALIZE(ierr)
72     STOP 'ABNORMAL END: S/R NEST_PARENT_CHECK:'
73     ENDIF
74 heimbach 1.1
75 jmc 1.3 _END_MASTER(myThid)
76 heimbach 1.1
77 jmc 1.3 RETURN
78     END

  ViewVC Help
Powered by ViewVC 1.1.22