Index: NEMO/trunk/tests/STATION_ASF/MY_SRC/nemogcm.F90
===================================================================
--- NEMO/trunk/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 12377)
+++ NEMO/trunk/tests/STATION_ASF/MY_SRC/nemogcm.F90	(revision 12615)
@@ -2,5 +2,5 @@
    !!======================================================================
    !!                       ***  MODULE nemogcm   ***
-   !! StandAlone Surface module : surface fluxes
+   !!                      STATION_ASF (SAS meets C1D)
    !!======================================================================
    !! History :  3.6  ! 2011-11  (S. Alderson, G. Madec) original code
@@ -19,16 +19,14 @@
    !!----------------------------------------------------------------------
    USE step_oce       ! module used in the ocean time stepping module (step.F90)
-   USE sbc_oce        ! surface boundary condition: ocean #LB: rm?
    USE phycst         ! physical constant                  (par_cst routine)
    USE domain         ! domain initialization   (dom_init & dom_cfg routines)
    USE closea         ! treatment of closed seas (for ln_closea)
    USE usrdef_nam     ! user defined configuration
+   USE istate         ! initial state setting          (istate_init routine)
    USE step, ONLY : Nbb, Nnn, Naa, Nrhs ! time level indices
    USE daymod         ! calendar
    USE restart        ! open  restart file
-   !LB:USE step           ! NEMO time-stepping                 (stp     routine)
    USE c1d            ! 1D configuration
    USE step_c1d       ! Time stepping loop for the 1D configuration
-   USE sbcssm         !
    !
    USE lib_mpp        ! distributed memory computing
@@ -49,5 +47,5 @@
    !!----------------------------------------------------------------------
    !! NEMO/OCE 4.0 , NEMO Consortium (2018)
-   !! $Id: nemogcm.F90 11536 2019-09-11 13:54:18Z smasson $
+   !! $Id: nemogcm.F90 12489 2020-02-28 15:55:11Z davestorkey $
    !! Software governed by the CeCILL license (see ./LICENSE)
    !!----------------------------------------------------------------------
@@ -84,4 +82,7 @@
       !                            !==   time stepping   ==!
       !                            !-----------------------!
+      !
+      !                                               !== set the model time-step  ==!
+      !
       istp = nit000
       !
@@ -106,8 +107,7 @@
       !
 #if defined key_iomput
-      CALL xios_finalize  ! end mpp communications with xios
+                                    CALL xios_finalize  ! end mpp communications with xios
 #else
-      IF( lk_mpp   ) THEN   ;   CALL mppstop      ! end mpp communications
-      ENDIF
+      IF( lk_mpp )                  CALL mppstop      ! end mpp communications
 #endif
       !
@@ -161,9 +161,9 @@
       IF( lwm )   CALL ctl_opn(     numout,        'ocean.output', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
       ! open reference and configuration namelist files
-      CALL load_nml( numnam_ref,        'namelist_ref',                                           -1, lwm )
-      CALL load_nml( numnam_cfg,        'namelist_cfg',                                           -1, lwm )
+                  CALL load_nml( numnam_ref,        'namelist_ref',                                           -1, lwm )
+                  CALL load_nml( numnam_cfg,        'namelist_cfg',                                           -1, lwm )
       IF( lwm )   CALL ctl_opn(     numond, 'output.namelist.dyn', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
       ! open /dev/null file to be able to supress output write easily
-      CALL ctl_opn(     numnul,           '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
+                  CALL ctl_opn(     numnul,           '/dev/null', 'REPLACE', 'FORMATTED', 'SEQUENTIAL', -1, -1, .FALSE. )
       !
       !                             !--------------------!
@@ -235,5 +235,5 @@
 903   IF( ios /= 0 )   CALL ctl_nam ( ios , 'namcfg in reference namelist' )
       READ  ( numnam_cfg, namcfg, IOSTAT = ios, ERR = 904 )
-904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )
+904   IF( ios >  0 )   CALL ctl_nam ( ios , 'namcfg in configuration namelist' )   
       !
       IF( ln_read_cfg ) THEN            ! Read sizes in domain configuration file
@@ -266,26 +266,16 @@
       IF( ln_timing    )   CALL timing_start( 'nemo_init')
       !
-      CALL     phy_cst         ! Physical constants
-      CALL     eos_init        ! Equation of state
+                           CALL     phy_cst         ! Physical constants
+                           CALL     eos_init        ! Equation of state
       IF( lk_c1d       )   CALL     c1d_init        ! 1D column configuration
-      CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
+                           CALL     dom_init( Nbb, Nnn, Naa, "OPA") ! Domain
       IF( sn_cfctl%l_prtctl )   &
          &                 CALL prt_ctl_init        ! Print control
-
-      IF( ln_rstart ) THEN                    ! Restart from a file                                                                                 
-         !                                    ! -------------------                                                                                 
-         CALL rst_read( Nbb, Nnn )            ! Read the restart file                                                                               
-         CALL day_init                        ! model calendar (using both namelist and restart infos)                                              
-         !                                                                                                                                          
-      ELSE                                    ! Start from rest                                                                                     
-         !                                    ! ---------------                                                                                     
-         numror = 0                           ! define numror = 0 -> no restart file to read                                                        
-         neuler = 0                           ! Set time-step indicator at nit000 (euler forward)                                                   
-         CALL day_init                        ! model calendar (using both namelist and restart infos)                                              
-      ENDIF
-      !
-
-      !                                      ! external forcing
-      CALL     sbc_init( Nbb, Nnn, Naa )    ! surface boundary conditions (including sea-ice)
+      !
+      
+                           CALL  istate_init( Nbb, Nnn, Naa )    ! ocean initial state (Dynamics and tracers)
+
+      !                                      ! external forcing 
+                           CALL     sbc_init( Nbb, Nnn, Naa )    ! surface boundary conditions (including sea-ice)
 
       !
@@ -321,8 +311,8 @@
          WRITE(numout,*) '                              sn_cfctl%l_prttrc  = ', sn_cfctl%l_prttrc
          WRITE(numout,*) '                              sn_cfctl%l_oasout  = ', sn_cfctl%l_oasout
-         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin
-         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax
-         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr
-         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr
+         WRITE(numout,*) '                              sn_cfctl%procmin   = ', sn_cfctl%procmin  
+         WRITE(numout,*) '                              sn_cfctl%procmax   = ', sn_cfctl%procmax  
+         WRITE(numout,*) '                              sn_cfctl%procincr  = ', sn_cfctl%procincr 
+         WRITE(numout,*) '                              sn_cfctl%ptimincr  = ', sn_cfctl%ptimincr 
          WRITE(numout,*) '      level of print                  nn_print   = ', nn_print
          WRITE(numout,*) '      Start i indice for SUM control  nn_ictls   = ', nn_ictls
@@ -439,5 +429,5 @@
       !!----------------------------------------------------------------------
       !
-      ierr =        oce_alloc    ()    ! ocean
+      ierr =        oce_alloc    ()    ! ocean 
       ierr = ierr + dia_wri_alloc()
       ierr = ierr + dom_oce_alloc()    ! ocean domain
@@ -448,5 +438,5 @@
    END SUBROUTINE nemo_alloc
 
-
+   
    SUBROUTINE nemo_set_cfctl(sn_cfctl, setto, for_all )
       !!----------------------------------------------------------------------
@@ -479,2 +469,3 @@
    !!======================================================================
 END MODULE nemogcm
+
