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.
nemogcm.F90 in NEMO/branches/2019/dev_ASINTER-01-05_merged/tests/STATION_ASF/MY_SRC – NEMO

source: NEMO/branches/2019/dev_ASINTER-01-05_merged/tests/STATION_ASF/MY_SRC/nemogcm.F90 @ 12063

Last change on this file since 12063 was 11831, checked in by laurent, 4 years ago

Update the branch to r11830 of the trunk!

File size: 24.3 KB
Line 
1MODULE nemogcm
2   !!======================================================================
3   !!                       ***  MODULE nemogcm   ***
4   !! StandAlone Surface module : surface fluxes
5   !!======================================================================
6   !! History :  3.6  ! 2011-11  (S. Alderson, G. Madec) original code
7   !!             -   ! 2013-06  (I. Epicoco, S. Mocavero, CMCC) nemo_northcomms: setup avoiding MPI communication
8   !!             -   ! 2014-12  (G. Madec) remove KPP scheme and cross-land advection (cla)
9   !!            4.0  ! 2016-10  (G. Madec, S. Flavoni)  domain configuration / user defined interface
10   !!----------------------------------------------------------------------
11
12   !!----------------------------------------------------------------------
13   !!   nemo_gcm      : solve ocean dynamics, tracer, biogeochemistry and/or sea-ice
14   !!   nemo_init     : initialization of the NEMO system
15   !!   nemo_ctl      : initialisation of the contol print
16   !!   nemo_closefile: close remaining open files
17   !!   nemo_alloc    : dynamical allocation
18   !!----------------------------------------------------------------------
19   USE step_oce       ! module used in the ocean time stepping module (step.F90)
20   USE sbc_oce        ! surface boundary condition: ocean
21   USE phycst         ! physical constant                  (par_cst routine)
22   USE domain         ! domain initialization   (dom_init & dom_cfg routines)
23   USE closea         ! treatment of closed seas (for ln_closea)
24   USE usrdef_nam     ! user defined configuration
25   USE daymod         ! calendar
26   USE restart        ! open  restart file
27   !LB:USE step           ! NEMO time-stepping                 (stp     routine)
28   USE c1d            ! 1D configuration
29   USE step_c1d       ! Time stepping loop for the 1D configuration
30   USE sbcssm         !
31   !
32   USE lib_mpp        ! distributed memory computing
33   USE mppini         ! shared/distributed memory setting (mpp_init routine)
34   USE lib_fortran    ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined)
35#if defined key_iomput
36   USE xios           ! xIOserver
37#endif
38
39   IMPLICIT NONE
40   PRIVATE
41
42   PUBLIC   nemo_gcm    ! called by model.F90
43   PUBLIC   nemo_init   ! needed by AGRIF
44
45   CHARACTER(lc) ::   cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
46
47   !!----------------------------------------------------------------------
48   !! NEMO/OCE 4.0 , NEMO Consortium (2018)
49   !! $Id: nemogcm.F90 11536 2019-09-11 13:54:18Z smasson $
50   !! Software governed by the CeCILL license (see ./LICENSE)
51   !!----------------------------------------------------------------------
52CONTAINS
53
54   SUBROUTINE nemo_gcm
55      !!----------------------------------------------------------------------
56      !!                     ***  ROUTINE nemo_gcm  ***
57      !!
58      !! ** Purpose :   NEMO solves the primitive equations on an orthogonal
59      !!              curvilinear mesh on the sphere.
60      !!
61      !! ** Method  : - model general initialization
62      !!              - launch the time-stepping (stp routine)
63      !!              - finalize the run by closing files and communications
64      !!
65      !! References : Madec, Delecluse, Imbard, and Levy, 1997:  internal report, IPSL.
66      !!              Madec, 2008, internal report, IPSL.
67      !!----------------------------------------------------------------------
68      INTEGER ::   istp   ! time step index
69      REAL(wp)::   zstptiming   ! elapsed time for 1 time step
70      !!----------------------------------------------------------------------
71      !
72      !                            !-----------------------!
73      CALL nemo_init               !==  Initialisations  ==!
74      !                            !-----------------------!
75      ! check that all process are still there... If some process have an error,
76      ! they will never enter in step and other processes will wait until the end of the cpu time!
77      CALL mpp_max( 'nemogcm', nstop )
78
79      IF(lwp) WRITE(numout,cform_aaa)   ! Flag AAAAAAA
80
81      !                            !-----------------------!
82      !                            !==   time stepping   ==!
83      !                            !-----------------------!
84      istp = nit000
85      !
86#if defined key_c1d
87      DO WHILE ( istp <= nitend .AND. nstop == 0 )    !==  C1D time-stepping  ==!
88         CALL stp_c1d( istp )
89         istp = istp + 1
90      END DO
91#else
92      !
93      IF( .NOT.ln_diurnal_only ) THEN                 !==  Standard time-stepping  ==!
94         !
95         DO WHILE( istp <= nitend .AND. nstop == 0 )
96
97            ncom_stp = istp
98            IF( ln_timing ) THEN
99               zstptiming = MPI_Wtime()
100               IF ( istp == ( nit000 + 1 ) ) elapsed_time = zstptiming
101               IF ( istp ==         nitend ) elapsed_time = zstptiming - elapsed_time
102            ENDIF
103
104            CALL stp        ( istp )
105            istp = istp + 1
106
107            IF( lwp .AND. ln_timing )   WRITE(numtime,*) 'timing step ', istp-1, ' : ', MPI_Wtime() - zstptiming
108
109         END DO
110         !
111      ELSE                                            !==  diurnal SST time-steeping only  ==!
112         !
113         DO WHILE( istp <= nitend .AND. nstop == 0 )
114            CALL stp_diurnal( istp )   ! time step only the diurnal SST
115            istp = istp + 1
116         END DO
117         !
118      ENDIF
119      !
120#endif
121      !
122      !                            !------------------------!
123      !                            !==  finalize the run  ==!
124      !                            !------------------------!
125      IF(lwp) WRITE(numout,cform_aaa)        ! Flag AAAAAAA
126      !
127      IF( nstop /= 0 .AND. lwp ) THEN        ! error print
128         WRITE(ctmp1,*) '   ==>>>   nemo_gcm: a total of ', nstop, ' errors have been found'
129         CALL ctl_stop( ctmp1 )
130      ENDIF
131      !
132      IF( ln_timing )   CALL timing_finalize
133      !
134      CALL nemo_closefile
135      !
136#if defined key_iomput
137      CALL xios_finalize  ! end mpp communications with xios
138#else
139      IF( lk_mpp   ) THEN   ;   CALL mppstop      ! end mpp communications
140      ENDIF
141#endif
142      !
143      IF(lwm) THEN
144         IF( nstop == 0 ) THEN   ;   STOP 0
145         ELSE                    ;   STOP 123
146         ENDIF
147      ENDIF
148      !
149   END SUBROUTINE nemo_gcm
150
151
152   SUBROUTINE nemo_init
153      !!----------------------------------------------------------------------
154      !!                     ***  ROUTINE nemo_init  ***
155      !!
156      !! ** Purpose :   initialization of the NEMO GCM
157      !!----------------------------------------------------------------------
158      INTEGER ::   ios, ilocal_comm   ! local integers
159      !!
160      NAMELIST/namctl/ ln_ctl   , sn_cfctl, nn_print, nn_ictls, nn_ictle,   &
161         &             nn_isplt , nn_jsplt, nn_jctls, nn_jctle,             &
162         &             ln_timing, ln_diacfl
163      NAMELIST/namcfg/ ln_read_cfg, cn_domcfg, ln_closea, ln_write_cfg, cn_domcfg_out, ln_use_jattr
164      !!----------------------------------------------------------------------
165      !
166      cxios_context = 'nemo'
167      !
168      !                             !-------------------------------------------------!
169      !                             !     set communicator & select the local rank    !
170      !                             !  must be done as soon as possible to get narea  !
171      !                             !-------------------------------------------------!
172      !
173#if defined key_iomput
174      IF( Agrif_Root() ) THEN
175         CALL xios_initialize( "for_xios_mpi_id", return_comm=ilocal_comm )   ! nemo local communicator given by xios
176      ENDIF
177      CALL mpp_start( ilocal_comm )
178#else
179      CALL mpp_start( )
180#endif
181      !
182      narea = mpprank + 1               ! mpprank: the rank of proc (0 --> mppsize -1 )
183      lwm = (narea == 1)                ! control of output namelists
184      !
185      !                             !---------------------------------------------------------------!
186      !                             ! Open output files, reference and configuration namelist files !
187      !                             !---------------------------------------------------------------!
188      !
189      ! open ocean.output as soon as possible to get all output prints (including errors messages)
190      IF( lwm )   CALL ctl_opn(     numout,        'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
191      ! open reference and configuration namelist files
192      CALL ctl_opn( numnam_ref,        'namelist_ref',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
193      CALL ctl_opn( numnam_cfg,        'namelist_cfg',     'OLD', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
194      IF( lwm )   CALL ctl_opn(     numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
195      ! open /dev/null file to be able to supress output write easily
196      CALL ctl_opn(     numnul,           '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
197      !
198      !                             !--------------------!
199      !                             ! Open listing units !  -> need ln_ctl from namctl to define lwp
200      !                             !--------------------!
201      !
202      REWIND( numnam_ref )              ! Namelist namctl in reference namelist
203      READ  ( numnam_ref, namctl, IOSTAT = ios, ERR = 901 )
204901   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namctl in reference namelist' )
205      REWIND( numnam_cfg )              ! Namelist namctl in confguration namelist
206      READ  ( numnam_cfg, namctl, IOSTAT = ios, ERR = 902 )
207902   IF( ios >  0 )   CALL ctl_nam ( ios , 'namctl in configuration namelist' )
208      !
209      lwp = (narea == 1) .OR. ln_ctl    ! control of all listing output print
210      !
211      IF(lwp) THEN                      ! open listing units
212         !
213         IF( .NOT. lwm )   &            ! alreay opened for narea == 1
214            &            CALL ctl_opn( numout, 'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE., narea )
215         !
216         WRITE(numout,*)
217         WRITE(numout,*) '   CNRS - NERC - Met OFFICE - MERCATOR-ocean - CMCC'
218         WRITE(numout,*) '                       NEMO team'
219         WRITE(numout,*) '            Ocean General Circulation Model'
220         WRITE(numout,*) '                NEMO version 4.0  (2019) '
221         WRITE(numout,*) '                      STATION_ASF '
222         WRITE(numout,*) "           ._      ._      ._      ._      ._    "
223         WRITE(numout,*) "       _.-._)`\_.-._)`\_.-._)`\_.-._)`\_.-._)`\_ "
224         WRITE(numout,*)
225         WRITE(numout,*) "           o         _,           _,             "
226         WRITE(numout,*) "            o      .' (        .-' /             "
227         WRITE(numout,*) "           o     _/..._'.    .'   /              "
228         WRITE(numout,*) "      (    o .-'`      ` '-./  _.'               "
229         WRITE(numout,*) "       )    ( o)           ;= <_         (       "
230         WRITE(numout,*) "      (      '-.,\\__ __.-;`\   '.        )      "
231         WRITE(numout,*) "       )  )       \) |`\ \)  '.   \      (   (   "
232         WRITE(numout,*) "      (  (           \_/       '-._\      )   )  "
233         WRITE(numout,*) "       )  ) jgs                     `    (   (   "
234         WRITE(numout,*) "     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ "
235         WRITE(numout,*)
236         !
237         WRITE(numout,cform_aaa)                                        ! Flag AAAAAAA
238         !
239      ENDIF
240      !
241      ! finalize the definition of namctl variables
242      IF( sn_cfctl%l_config ) THEN
243         ! Activate finer control of report outputs
244         ! optionally switch off output from selected areas (note this only
245         ! applies to output which does not involve global communications)
246         IF( ( narea < sn_cfctl%procmin .OR. narea > sn_cfctl%procmax  ) .OR. &
247            & ( MOD( narea - sn_cfctl%procmin, sn_cfctl%procincr ) /= 0 ) )    &
248            &   CALL nemo_set_cfctl( sn_cfctl, .FALSE., .FALSE. )
249      ELSE
250         ! Use ln_ctl to turn on or off all options.
251         CALL nemo_set_cfctl( sn_cfctl, ln_ctl, .TRUE. )
252      ENDIF
253      !
254      IF(lwm) WRITE( numond, namctl )
255      !
256      !                             !------------------------------------!
257      !                             !  Set global domain size parameters !
258      !                             !------------------------------------!
259      !
260      REWIND( numnam_ref )              ! Namelist namcfg in reference namelist
261      READ  ( numnam_ref, namcfg, IOSTAT = ios, ERR = 903 )
262903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist' )
263      REWIND( numnam_cfg )              ! Namelist namcfg in confguration namelist
264      READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 )
265904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )
266      !
267      IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
268         CALL domain_cfg ( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
269      ELSE                              ! user-defined namelist
270         CALL usr_def_nam( cn_cfg, nn_cfg, jpiglo, jpjglo, jpkglo, jperio )
271      ENDIF
272      !
273      IF(lwm)   WRITE( numond, namcfg )
274      !
275      !                             !-----------------------------------------!
276      !                             ! mpp parameters and domain decomposition !
277      !                             !-----------------------------------------!
278      CALL mpp_init
279
280      ! Now we know the dimensions of the grid and numout has been set: we can allocate arrays
281      CALL nemo_alloc()
282
283      !                             !-------------------------------!
284      !                             !  NEMO general initialization  !
285      !                             !-------------------------------!
286
287      CALL nemo_ctl                          ! Control prints
288      !
289      !                                      ! General initialization
290      IF( ln_timing    )   CALL timing_init     ! timing
291      IF( ln_timing    )   CALL timing_start( 'nemo_init')
292      !
293      CALL     phy_cst         ! Physical constants
294      CALL     eos_init        ! Equation of state
295      IF( lk_c1d       )   CALL     c1d_init        ! 1D column configuration
296      CALL     dom_init("OPA") ! Domain
297      IF( ln_ctl       )   CALL prt_ctl_init        ! Print control
298
299      CALL day_init        ! model calendar (using both namelist and restart infos)
300      IF( ln_rstart )      CALL rst_read_open
301
302      !                                      ! external forcing
303      CALL     sbc_init    ! surface boundary conditions (including sea-ice)
304
305      !
306      IF(lwp) WRITE(numout,cform_aaa)           ! Flag AAAAAAA
307      !
308      IF( ln_timing    )   CALL timing_stop( 'nemo_init')
309      !
310   END SUBROUTINE nemo_init
311
312
313   SUBROUTINE nemo_ctl
314      !!----------------------------------------------------------------------
315      !!                     ***  ROUTINE nemo_ctl  ***
316      !!
317      !! ** Purpose :   control print setting
318      !!
319      !! ** Method  : - print namctl and namcfg information and check some consistencies
320      !!----------------------------------------------------------------------
321      !
322      IF(lwp) THEN                  ! control print
323         WRITE(numout,*)
324         WRITE(numout,*) 'nemo_ctl: Control prints'
325         WRITE(numout,*) '~~~~~~~~'
326         WRITE(numout,*) '   Namelist namctl'
327         WRITE(numout,*) '      run control (for debugging)     ln_ctl     = ', ln_ctl
328         WRITE(numout,*) '       finer control over o/p sn_cfctl%l_config  = ', sn_cfctl%l_config
329         WRITE(numout,*) '                              sn_cfctl%l_runstat = ', sn_cfctl%l_runstat
330         WRITE(numout,*) '                              sn_cfctl%l_trcstat = ', sn_cfctl%l_trcstat
331         WRITE(numout,*) '                              sn_cfctl%l_oceout  = ', sn_cfctl%l_oceout
332         WRITE(numout,*) '                              sn_cfctl%l_layout  = ', sn_cfctl%l_layout
333         WRITE(numout,*) '                              sn_cfctl%l_mppout  = ', sn_cfctl%l_mppout
334         WRITE(numout,*) '                              sn_cfctl%l_mpptop  = ', sn_cfctl%l_mpptop
335         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin
336         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax
337         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr
338         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr
339         WRITE(numout,*) '      level of print                  nn_print   = ', nn_print
340         WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls
341         WRITE(numout,*) '      End i indice for SUM control    nn_ictle   = ', nn_ictle
342         WRITE(numout,*) '      Start j indice for SUM control  nn_jctls   = ', nn_jctls
343         WRITE(numout,*) '      End j indice for SUM control    nn_jctle   = ', nn_jctle
344         WRITE(numout,*) '      number of proc. following i     nn_isplt   = ', nn_isplt
345         WRITE(numout,*) '      number of proc. following j     nn_jsplt   = ', nn_jsplt
346         WRITE(numout,*) '      timing by routine               ln_timing  = ', ln_timing
347         WRITE(numout,*) '      CFL diagnostics                 ln_diacfl  = ', ln_diacfl
348      ENDIF
349      !
350      nprint    = nn_print          ! convert DOCTOR namelist names into OLD names
351      nictls    = nn_ictls
352      nictle    = nn_ictle
353      njctls    = nn_jctls
354      njctle    = nn_jctle
355      isplt     = nn_isplt
356      jsplt     = nn_jsplt
357
358      IF(lwp) THEN                  ! control print
359         WRITE(numout,*)
360         WRITE(numout,*) '   Namelist namcfg'
361         WRITE(numout,*) '      read domain configuration file                ln_read_cfg      = ', ln_read_cfg
362         WRITE(numout,*) '         filename to be read                           cn_domcfg     = ', TRIM(cn_domcfg)
363         WRITE(numout,*) '         keep closed seas in the domain (if exist)     ln_closea     = ', ln_closea
364         WRITE(numout,*) '      create a configuration definition file        ln_write_cfg     = ', ln_write_cfg
365         WRITE(numout,*) '         filename to be written                        cn_domcfg_out = ', TRIM(cn_domcfg_out)
366         WRITE(numout,*) '      use file attribute if exists as i/p j-start   ln_use_jattr     = ', ln_use_jattr
367      ENDIF
368      IF( .NOT.ln_read_cfg )   ln_closea = .false.   ! dealing possible only with a domcfg file
369      !
370      !                             ! Parameter control
371      !
372      IF( ln_ctl ) THEN                 ! sub-domain area indices for the control prints
373         IF( lk_mpp .AND. jpnij > 1 ) THEN
374            isplt = jpni   ;   jsplt = jpnj   ;   ijsplt = jpni*jpnj   ! the domain is forced to the real split domain
375         ELSE
376            IF( isplt == 1 .AND. jsplt == 1  ) THEN
377               CALL ctl_warn( ' - isplt & jsplt are equal to 1',   &
378                  &           ' - the print control will be done over the whole domain' )
379            ENDIF
380            ijsplt = isplt * jsplt            ! total number of processors ijsplt
381         ENDIF
382         IF(lwp) WRITE(numout,*)'          - The total number of processors over which the'
383         IF(lwp) WRITE(numout,*)'            print control will be done is ijsplt : ', ijsplt
384         !
385         !                              ! indices used for the SUM control
386         IF( nictls+nictle+njctls+njctle == 0 )   THEN    ! print control done over the default area
387            lsp_area = .FALSE.
388         ELSE                                             ! print control done over a specific  area
389            lsp_area = .TRUE.
390            IF( nictls < 1 .OR. nictls > jpiglo )   THEN
391               CALL ctl_warn( '          - nictls must be 1<=nictls>=jpiglo, it is forced to 1' )
392               nictls = 1
393            ENDIF
394            IF( nictle < 1 .OR. nictle > jpiglo )   THEN
395               CALL ctl_warn( '          - nictle must be 1<=nictle>=jpiglo, it is forced to jpiglo' )
396               nictle = jpiglo
397            ENDIF
398            IF( njctls < 1 .OR. njctls > jpjglo )   THEN
399               CALL ctl_warn( '          - njctls must be 1<=njctls>=jpjglo, it is forced to 1' )
400               njctls = 1
401            ENDIF
402            IF( njctle < 1 .OR. njctle > jpjglo )   THEN
403               CALL ctl_warn( '          - njctle must be 1<=njctle>=jpjglo, it is forced to jpjglo' )
404               njctle = jpjglo
405            ENDIF
406         ENDIF
407      ENDIF
408      !
409      IF( 1._wp /= SIGN(1._wp,-0._wp)  )   CALL ctl_stop( 'nemo_ctl: The intrinsec SIGN function follows f2003 standard.',  &
410         &                                                'Compile with key_nosignedzero enabled:',   &
411         &                                                '--> add -Dkey_nosignedzero to the definition of %CPP in your arch file' )
412      !
413   END SUBROUTINE nemo_ctl
414
415
416   SUBROUTINE nemo_closefile
417      !!----------------------------------------------------------------------
418      !!                     ***  ROUTINE nemo_closefile  ***
419      !!
420      !! ** Purpose :   Close the files
421      !!----------------------------------------------------------------------
422      !
423      IF( lk_mpp )   CALL mppsync
424      !
425      CALL iom_close                                 ! close all input/output files managed by iom_*
426      !
427      IF( numstp          /= -1 )   CLOSE( numstp          )   ! time-step file
428      IF( numrun          /= -1 )   CLOSE( numrun          )   ! run statistics file
429      IF( numnam_ref      /= -1 )   CLOSE( numnam_ref      )   ! oce reference namelist
430      IF( numnam_cfg      /= -1 )   CLOSE( numnam_cfg      )   ! oce configuration namelist
431      IF( lwm.AND.numond  /= -1 )   CLOSE( numond          )   ! oce output namelist
432      IF( numnam_ice_ref  /= -1 )   CLOSE( numnam_ice_ref  )   ! ice reference namelist
433      IF( numnam_ice_cfg  /= -1 )   CLOSE( numnam_ice_cfg  )   ! ice configuration namelist
434      IF( lwm.AND.numoni  /= -1 )   CLOSE( numoni          )   ! ice output namelist
435      IF( numevo_ice      /= -1 )   CLOSE( numevo_ice      )   ! ice variables (temp. evolution)
436      IF( numout          /=  6 )   CLOSE( numout          )   ! standard model output file
437      !
438      numout = 6                                     ! redefine numout in case it is used after this point...
439      !
440   END SUBROUTINE nemo_closefile
441
442
443   SUBROUTINE nemo_alloc
444      !!----------------------------------------------------------------------
445      !!                     ***  ROUTINE nemo_alloc  ***
446      !!
447      !! ** Purpose :   Allocate all the dynamic arrays of the OPA modules
448      !!
449      !! ** Method  :
450      !!----------------------------------------------------------------------
451      USE diawri    , ONLY : dia_wri_alloc
452      USE dom_oce   , ONLY : dom_oce_alloc
453      !
454      INTEGER :: ierr
455      !!----------------------------------------------------------------------
456      !
457      ierr =        oce_alloc    ()    ! ocean
458      ierr = ierr + dia_wri_alloc()
459      ierr = ierr + dom_oce_alloc()    ! ocean domain
460      !
461      CALL mpp_sum( 'nemogcm', ierr )
462      IF( ierr /= 0 )   CALL ctl_stop( 'STOP', 'nemo_alloc: unable to allocate standard ocean arrays' )
463      !
464   END SUBROUTINE nemo_alloc
465
466
467   SUBROUTINE nemo_set_cfctl(sn_cfctl, setto, for_all )
468      !!----------------------------------------------------------------------
469      !!                     ***  ROUTINE nemo_set_cfctl  ***
470      !!
471      !! ** Purpose :   Set elements of the output control structure to setto.
472      !!                for_all should be .false. unless all areas are to be
473      !!                treated identically.
474      !!
475      !! ** Method  :   Note this routine can be used to switch on/off some
476      !!                types of output for selected areas but any output types
477      !!                that involve global communications (e.g. mpp_max, glob_sum)
478      !!                should be protected from selective switching by the
479      !!                for_all argument
480      !!----------------------------------------------------------------------
481      LOGICAL :: setto, for_all
482      TYPE(sn_ctl) :: sn_cfctl
483      !!----------------------------------------------------------------------
484      IF( for_all ) THEN
485         sn_cfctl%l_runstat = setto
486         sn_cfctl%l_trcstat = setto
487      ENDIF
488      sn_cfctl%l_oceout  = setto
489      sn_cfctl%l_layout  = setto
490      sn_cfctl%l_mppout  = setto
491      sn_cfctl%l_mpptop  = setto
492   END SUBROUTINE nemo_set_cfctl
493
494   !!======================================================================
495END MODULE nemogcm
Note: See TracBrowser for help on using the repository browser.