New URL for NEMO forge!   http://forge.nemo-ocean.eu

Since March 2022 along with NEMO 4.2 release, the code development moved to a self-hosted GitLab.
This present forge is now archived and remained online for history.
in_out_manager.F90 in trunk/NEMO/OFF_SRC – NEMO

source: trunk/NEMO/OFF_SRC/in_out_manager.F90 @ 508

Last change on this file since 508 was 496, checked in by opalod, 18 years ago

nemo_v1_update_063:CE:integration of the control print option for debugging

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.2 KB
Line 
1MODULE in_out_manager   
2
3   USE lib_print         ! formated print library
4   USE par_kind
5   USE par_oce
6
7   PUBLIC
8
9   !!----------------------------------------------------------------------
10   !! namelist parameters
11   !! -------------------------------------
12   ! namrun:  parameters of the run
13   CHARACTER (len=16) ::    &   !:
14      cexper = "exp0"           !: experiment name used for output filename
15   
16   LOGICAL ::   &              !!: * namelist namrun *
17      ln_rstart = .FALSE. ,  &  !: start from (F) rest or (T) a restart file
18      ln_ctl    = .FALSE.       !: run control for debugging
19   
20   INTEGER ::                & !!: * namelist namrun *
21      no     = 0        ,    &  !: job number
22      nrstdt = 0        ,    &  !: control of the time step (0, 1 or 2)
23      nit000 = 1        ,    &  !: index of the first time step
24      nitend = 10       ,    &  !: index of the last time step
25      ndate0 = 961115   ,    &  !: initial calendar date aammjj
26      nleapy = 0        ,    &  !: Leap year calendar flag (0/1 or 30)
27      ninist = 0        ,    &  !: initial state output flag (0/1)
28      nbench = 0                !: benchmark parameter (0/1)
29   
30   !!----------------------------------------------------------------------
31   !! output monitoring
32   !! -----------------------------------
33
34   INTEGER ::                &  !:
35      nstock =   10 ,        &  !: restart file frequency
36      nprint =    0 ,        &  !: level of print (0 no print)
37      nwrite =   10 ,        &  !: restart file frequency
38      nictls =    0 ,        &  !: Start i indice for the SUM control
39      nictle =    0 ,        &  !: End   i indice for the SUM control
40      njctls =    0 ,        &  !: Start j indice for the SUM control
41      njctle =    0 ,        &  !: End   j indice for the SUM control
42      isplt  =    1 ,        &  !: number of processors following i
43      jsplt  =    1 ,        &  !: number of processors following j
44      ijsplt =    1             !: nb of local domain = nb of processors
45
46   !!----------------------------------------------------------------------
47   !! logical units
48   !! ------------------------------
49   INTEGER ::                &  !:
50      numstp     =  1 ,      &  !: logical unit for time step
51      numout     =  2 ,      &  !: logical unit for output print
52      numnam     =  3 ,      &  !: logical unit for namelist
53      numnam_ice =  4 ,      &  !: logical unit for ice namelist
54      numevo_ice = 17 ,      &  !: logical unit for ice variables (temp. evolution)
55      numice_dmp = 18 ,      &  !: logical unit for ice variables (damping)
56      numsol     = 25 ,      &  !: logical unit for solver statistics
57      numwri     = 40 ,      &  !: logical unit for output write
58      numisp     = 41 ,      &  !: logical unit for island statistics
59      numgap     = 45 ,      &  !: logical unit for differences diagnostic
60      numbol     = 67 ,      &  !: logical unit for "bol" diagnostics
61      numptr     = 68 ,      &  !: logical unit for Poleward TRansports
62      numflo     = 69           !: logical unit for drifting floats
63      !                         !: * coupled units
64
65   !!----------------------------------------------------------------------
66   !!                          Run control 
67   !!----------------------------------------------------------------------
68   
69   INTEGER ::                &  !:
70      nstop = 0 ,            &  !: e r r o r  flag (=number of reason for a
71      !                         !                   prematurely stop the run)
72      nwarn = 0                 !: w a r n i n g  flag (=number of warning
73      !                         !                       found during the run)
74
75   
76   CHARACTER(LEN=100) :: ctmp1, ctmp2, ctmp3    ! temporary character
77   CHARACTER (len=64) ::        &                                                    !:
78      cform_err="(/,' ===>>> : E R R O R',     /,'         ===========',/)"    ,   & !:
79      cform_war="(/,' ===>>> : W A R N I N G', /,'         ===============',/)"      !:
80   LOGICAL ::   &               !:
81      lwp                ,   &  !: boolean : true on the 1st processor only
82      lsp_area = .TRUE.         !: to make a control print over a specific area
83
84   !!------------------------------------------------------------------------
85   !!                         Contral/debugging
86   !! -----------------------------------------------------------------------
87
88   REAL(wp) ::               &  !:
89      u_ctl, v_ctl,          &  !: sum of ua and va trend
90      t_ctl, s_ctl              !: sum of ta and sa trend
91
92   !!----------------------------------------------------------------------
93   !!  OPA 9.0 , LOCEAN-IPSL (2005)
94   !! $Header$
95   !! This software is governed by the CeCILL licence see modipsl/doc/NEMO_CeCILL.txt
96   !!----------------------------------------------------------------------
97
98
99CONTAINS
100
101
102   SUBROUTINE ctl_stop( cd1, cd2, cd3, cd4, cd5,   &
103      &                 cd6, cd7, cd8, cd9, cd10 )
104      !!-----------------------------------------------------------------------
105      !!                  ***  ROUTINE  stop_opa  ***
106      !!
107      !! ** Purpose : ???
108      !!
109      !!-----------------------------------------------------------------------
110      CHARACTER(len=*),INTENT(in),OPTIONAL ::  cd1, cd2, cd3, cd4, cd5, cd6, cd7, cd8, cd9, cd10
111      !!-----------------------------------------------------------------------
112     
113      nstop = nstop + 1 
114      IF(lwp) THEN
115         WRITE(numout,"(/,' ===>>> : E R R O R',     /,'         ===========',/)") 
116         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
117         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
118         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
119         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
120         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
121         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
122         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
123         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
124         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
125         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
126      ENDIF
127      CALL FLUSH(numout)
128
129   END SUBROUTINE ctl_stop
130
131
132   SUBROUTINE ctl_warn( cd1, cd2, cd3, cd4, cd5,   &
133      &                 cd6, cd7, cd8, cd9, cd10 )
134      !!-----------------------------------------------------------------------
135      !!                  ***  ROUTINE  stop_opa  ***
136      !!
137      !! ** Purpose : ???
138      !!
139      !!-----------------------------------------------------------------------
140      CHARACTER(len=*),INTENT(in),OPTIONAL ::  cd1, cd2, cd3, cd4, cd5, cd6, cd7, cd8, cd9, cd10
141      !!-----------------------------------------------------------------------
142     
143      nwarn = nwarn + 1 
144      IF(lwp) THEN
145         WRITE(numout,"(/,' ===>>> : W A R N I N G', /,'         ===============',/)") 
146         IF( PRESENT(cd1 ) ) WRITE(numout,*) cd1
147         IF( PRESENT(cd2 ) ) WRITE(numout,*) cd2
148         IF( PRESENT(cd3 ) ) WRITE(numout,*) cd3
149         IF( PRESENT(cd4 ) ) WRITE(numout,*) cd4
150         IF( PRESENT(cd5 ) ) WRITE(numout,*) cd5
151         IF( PRESENT(cd6 ) ) WRITE(numout,*) cd6
152         IF( PRESENT(cd7 ) ) WRITE(numout,*) cd7
153         IF( PRESENT(cd8 ) ) WRITE(numout,*) cd8
154         IF( PRESENT(cd9 ) ) WRITE(numout,*) cd9
155         IF( PRESENT(cd10) ) WRITE(numout,*) cd10
156      ENDIF
157      CALL FLUSH(numout)
158
159   END SUBROUTINE ctl_warn
160
161END MODULE in_out_manager
Note: See TracBrowser for help on using the repository browser.