1 |
C $Header: /u/gcmpack/MITgcm/pkg/autodiff/autodiff_check.F,v 1.10 2011/08/18 09:35:31 heimbach Exp $ |
2 |
C $Name: $ |
3 |
|
4 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
5 |
|
6 |
#include "AUTODIFF_OPTIONS.h" |
7 |
|
8 |
CBOP |
9 |
C !ROUTINE: AUTODIFF_CHECK |
10 |
C !INTERFACE: |
11 |
SUBROUTINE AUTODIFF_CHECK( myThid ) |
12 |
|
13 |
C !DESCRIPTION: \bv |
14 |
C \ev |
15 |
|
16 |
IMPLICIT NONE |
17 |
#include "SIZE.h" |
18 |
#include "GRID.h" |
19 |
#include "EEPARAMS.h" |
20 |
#include "PARAMS.h" |
21 |
#ifdef ALLOW_AUTODIFF |
22 |
#include "tamc.h" |
23 |
#endif |
24 |
|
25 |
C !INPUT/OUTPUT PARAMETERS: |
26 |
C myThid - Number of this instances |
27 |
INTEGER myThid |
28 |
C msgBuf :: Informational/error message buffer |
29 |
CHARACTER*(MAX_LEN_MBUF) msgBuf |
30 |
CEOP |
31 |
|
32 |
#ifdef ALLOW_AUTODIFF_TAMC |
33 |
|
34 |
#if (defined (AUTODIFF_2_LEVEL_CHECKPOINT)) |
35 |
if (nchklev_1*nchklev_2 .lt. nTimeSteps) then |
36 |
WRITE(msgBuf,'(A)') |
37 |
& 'THE_MAIN_LOOP: TAMC checkpointing parameters' |
38 |
CALL PRINT_ERROR( msgBuf , myThid ) |
39 |
WRITE(msgBuf,'(A,I10)') |
40 |
& 'nchklev_1*nchklev_2 = ', |
41 |
& nchklev_1*nchklev_2 |
42 |
CALL PRINT_ERROR( msgBuf , myThid ) |
43 |
WRITE(msgBuf,'(A,I10)') |
44 |
& 'are not consistent with nTimeSteps = ', |
45 |
& nTimeSteps |
46 |
CALL PRINT_ERROR( msgBuf , myThid ) |
47 |
STOP 'ABNORMAL END: S/R AUTODIFF_CHECK' |
48 |
endif |
49 |
#elif (defined (AUTODIFF_4_LEVEL_CHECKPOINT)) |
50 |
if (nchklev_1*nchklev_2*nchklev_3*nchklev_4 .lt. nTimeSteps) then |
51 |
WRITE(msgBuf,'(A)') |
52 |
& 'THE_MAIN_LOOP: TAMC checkpointing parameters' |
53 |
CALL PRINT_ERROR( msgBuf , myThid ) |
54 |
WRITE(msgBuf,'(A,I10)') |
55 |
& 'nchklev_1*nchklev_2*nchklev_3*nchklev_4 = ', |
56 |
& nchklev_1*nchklev_2*nchklev_3*nchklev_4 |
57 |
CALL PRINT_ERROR( msgBuf , myThid ) |
58 |
WRITE(msgBuf,'(A,I10)') |
59 |
& 'are not consistent with nTimeSteps = ', |
60 |
& nTimeSteps |
61 |
CALL PRINT_ERROR( msgBuf , myThid ) |
62 |
STOP 'ABNORMAL END: S/R AUTODIFF_CHECK' |
63 |
endif |
64 |
#else |
65 |
c-- Check the choice of the checkpointing parameters in relation |
66 |
c-- to nTimeSteps: (nchklev_1*nchklev_2*nchklev_3 .ge. nTimeSteps) |
67 |
if (nchklev_1*nchklev_2*nchklev_3 .lt. nTimeSteps) then |
68 |
WRITE(msgBuf,'(A)') |
69 |
& 'THE_MAIN_LOOP: TAMC checkpointing parameters' |
70 |
CALL PRINT_ERROR( msgBuf , myThid ) |
71 |
WRITE(msgBuf,'(A,I10)') |
72 |
& 'nchklev_1*nchklev_2*nchklev_3 = ', |
73 |
& nchklev_1*nchklev_2*nchklev_3 |
74 |
CALL PRINT_ERROR( msgBuf , myThid ) |
75 |
WRITE(msgBuf,'(A,I10)') |
76 |
& 'are not consistent with nTimeSteps = ', |
77 |
& nTimeSteps |
78 |
CALL PRINT_ERROR( msgBuf , myThid ) |
79 |
STOP 'ABNORMAL END: S/R AUTODIFF_CHECK' |
80 |
endif |
81 |
#endif |
82 |
|
83 |
#ifndef ALLOW_AUTODIFF_MONITOR |
84 |
IF ( adjDumpFreq .NE. 0. ) THEN |
85 |
WRITE(msgBuf,'(A)') |
86 |
& 'adjDumpFreq <> 0, but undef ALLOW_AUTODIFF_MONITOR' |
87 |
CALL PRINT_ERROR( msgBuf , myThid ) |
88 |
STOP 'ABNORMAL END: S/R AUTODIFF_CHECK' |
89 |
ENDIF |
90 |
IF ( adjMonitorFreq .NE. 0. ) THEN |
91 |
WRITE(msgBuf,'(A)') |
92 |
& 'adjMonitorFreq <> 0, but undef ALLOW_AUTODIFF_MONITOR' |
93 |
CALL PRINT_ERROR( msgBuf , myThid ) |
94 |
STOP 'ABNORMAL END: S/R AUTODIFF_CHECK' |
95 |
ENDIF |
96 |
#endif |
97 |
|
98 |
#ifdef ALLOW_GRDCHK |
99 |
IF ( useSingleCpuIO .AND. useGrdchk ) THEN |
100 |
WRITE(msgBuf,'(A)') |
101 |
& 'Need to have useSingleCpuIO=.FALSE. with useGrdchk' |
102 |
CALL PRINT_ERROR( msgBuf , myThid ) |
103 |
STOP 'ABNORMAL END: S/R AUTODIFF_CHECK' |
104 |
ENDIF |
105 |
#endif |
106 |
|
107 |
#endif |
108 |
|
109 |
C---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----| |
110 |
|
111 |
RETURN |
112 |
END |