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.
opa.F90 in trunk/NEMO/OFF_SRC – NEMO

source: trunk/NEMO/OFF_SRC/opa.F90 @ 338

Last change on this file since 338 was 325, checked in by opalod, 19 years ago

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 7.7 KB
Line 
1MODULE opa
2   !!==============================================================================
3   !!                       ***  MODULE opa   ***
4   !! Ocean system   : OPA ocean dynamics (including on-line tracers and sea-ice)
5   !!==============================================================================
6
7   !!----------------------------------------------------------------------
8   !!   opa_model      : solve ocean dynamics, tracer and/or sea-ice
9   !!----------------------------------------------------------------------
10   !! * Modules used
11   USE dom_oce         ! ocean space domain variables
12   USE oce             ! dynamics and tracers variables
13   USE daymod          ! calendar
14   USE in_out_manager  ! I/O manager
15   USE lib_mpp         ! distributed memory computing
16
17   USE domcfg          ! domain configuration               (dom_cfg routine)
18   USE mppini          ! shared/distributed memory setting (mpp_init routine)
19   USE domain          ! domain initialization             (dom_init routine)
20   USE istate          ! initial state setting          (istate_init routine)
21   USE eosbn2          ! equation of state            (eos bn2 routine)
22   USE zpshde          ! partial step: hor. derivative (zps_hde routine)
23
24   ! ocean physics
25   USE ldftra          ! lateral diffusivity setting    (ldftra_init routine)
26   USE zdfini
27   USE traqsr          ! solar radiation penetration   (tra_qsr_init routine)
28
29   USE phycst          ! physical constant                  (par_cst routine)
30   USE dtadyn          ! Lecture and Interpolation of the dynamical fields
31   USE initrc          ! Initilization of the passive tracers
32   USE prtctl_trc      ! Print control passive tracers (prt_ctl_trc_init routine)
33   USE step            ! OPA time-stepping                  (stp     routine)
34
35   IMPLICIT NONE
36   PRIVATE
37
38   !! * Routine accessibility
39   PUBLIC opa_model      ! called by model.F90
40   !!----------------------------------------------------------------------
41   !!  OPA 9.0 , LODYC-IPSL (2003)
42   !!----------------------------------------------------------------------
43
44CONTAINS
45
46   SUBROUTINE opa_model
47      !!----------------------------------------------------------------------
48      !!                     ***  ROUTINE opa  ***
49      !!
50      !! ** Purpose :   opa solves the primitive equations on an orthogonal
51      !!      curvilinear mesh on the sphere.
52      !!
53      !! ** Method  : - model general initialization
54      !!              - launch the time-stepping (stp routine)
55      !!
56      !! References :
57      !!      Madec, Delecluse,Imbard, and Levy, 1997: reference manual.
58      !!              internal report, IPSL.
59      !!
60      !! History :
61      !!   4.0  !  90-10  (C. Levy, G. Madec)  Original code
62      !!   7.0  !  91-11  (M. Imbard, C. Levy, G. Madec)
63      !!   7.1  !  93-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
64      !!                   M. Guyon, A. Lazar, P. Delecluse, C. Perigaud,
65      !!                   G. Caniaux, B. Colot, C. Maes ) release 7.1
66      !!        !  92-06  (L.Terray) coupling implementation
67      !!        !  93-11  (M.A. Filiberti) IGLOO sea-ice
68      !!   8.0  !  96-03  (M. Imbard, C. Levy, G. Madec, O. Marti,
69      !!                   M. Guyon, A. Lazar, P. Delecluse, L.Terray,
70      !!                   M.A. Filiberti, J. Vialar, A.M. Treguier,
71      !!                   M. Levy)  release 8.0
72      !!   8.1  !  97-06  (M. Imbard, G. Madec)
73      !!   8.2  !  99-11  (M. Imbard, H. Goosse)  LIM sea-ice model
74      !!        !  99-12  (V. Thierry, A-M. Treguier, M. Imbard, M-A. Foujols)  OPEN-MP
75      !!        !  00-07  (J-M Molines, M. Imbard)  Open Boundary Conditions  (CLIPPER)
76      !!   9.0  !  02-08  (G. Madec)  F90: Free form and modules
77      !!----------------------------------------------------------------------
78      !! * Local declarations
79      INTEGER ::   istp       ! time step index
80      CHARACTER (len=64) ::        &
81         cform_aaa="( /, 'AAAAAAAA', / ) "     ! flag for output listing
82      !!----------------------------------------------------------------------
83     
84     
85      ! Initializations
86      ! ===============
87     
88      ! open listing and namelist units
89      IF ( numout /= 0 .AND. numout /= 6 ) THEN
90         OPEN( UNIT=numout, FILE='ocean.output', FORM='FORMATTED' )
91      ENDIF
92
93      ! Nodes selection
94      narea = mynode()
95      narea = narea + 1    ! mynode return the rank of proc (0 --> jpnij -1 )
96      lwp   = narea == 1
97
98      OPEN( UNIT=numnam, FILE='namelist', FORM='FORMATTED', STATUS='OLD' )
99
100      IF(lwp) THEN
101         WRITE(numout,*)
102         WRITE(numout,*) '                 L O D Y C - I P S L'
103         WRITE(numout,*) '                     O P A model'
104         WRITE(numout,*) '            Ocean General Circulation Model'
105         WRITE(numout,*) '               version OPA 9.0  (2003)'
106         WRITE(numout,*)
107      ENDIF
108
109      !                                     ! ============================== !
110      !                                     !  Model general initialization  !
111      !                                     ! ============================== !
112
113      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
114
115                                            ! Domain decomposition
116      IF( jpni*jpnj == jpnij ) THEN
117         CALL mpp_init                          ! standard cutting out
118      ELSE
119         CALL mpp_init2                         ! eliminate land processors
120      ENDIF
121     
122      CALL phy_cst                          ! Physical constants
123
124      CALL dom_cfg                          ! Domain configuration
125     
126      CALL dom_init                         ! Domain
127
128      CALL day( nit000 )                    ! Calendar
129
130      CALL istate_init                      ! ocean initial state (Dynamics and tracers)
131!!add
132                       CALL eos( tn, sn, rhd, rhop )        ! before potential and in situ densities
133
134                       CALL bn2( tn, sn, rn2 )              ! before Brunt-Vaisala frequency
135
136      IF( lk_zps    )   CALL zps_hde( nit000, tn, sn, rhd,  &  ! Partial steps: before Horizontal DErivative
137                                          gtu, gsu, gru, &  ! of t, s, rd at the bottom ocean level
138                                          gtv, gsv, grv )
139
140!!add
141
142      ! Initialization for the dynamics
143      !
144      CALL dta_dyn(nit000)     
145
146#if defined key_passivetrc
147      CALL ini_trc                           ! Passive tracers
148      IF( ln_ctl )    CALL prt_ctl_trc_init   ! Print control
149#endif
150
151      !                                     ! Ocean physics
152      CALL tra_qsr_init                         ! Solar radiation penetration
153
154      CALL ldf_tra_init                         ! Lateral ocean tracer physics
155
156      CALL zdf_init                             ! Vertical ocean physics
157
158      !                                     ! Ocean trends
159
160      !                                     ! =============== !
161      !                                     !  time stepping  !
162      !                                     ! =============== !
163
164      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
165
166      istp = nit000
167      DO WHILE ( istp <= nitend .AND. nstop == 0 )
168         CALL stp( istp )
169         istp = istp + 1
170      END DO
171      !                                     ! ========= !
172      !                                     !  Job end  !
173      !                                     ! ========= !
174
175      IF(lwp) WRITE(numout,cform_aaa)       ! Flag AAAAAAA
176
177      IF( nstop /= 0 ) THEN                 ! error print
178      IF(lwp) WRITE(numout,cform_err)
179      IF(lwp) WRITE(numout,*) nstop, ' error have been found' 
180      ENDIF
181
182      IF( lk_mpp )   CALL mppstop                          ! Close all files (mpp)
183
184   END SUBROUTINE opa_model
185
186   !!======================================================================
187END MODULE opa
Note: See TracBrowser for help on using the repository browser.