146 |
C | | | |-INI_SALT :: Set model initial salinity field. |
C | | | |-INI_SALT :: Set model initial salinity field. |
147 |
C | | | |-INI_PSURF :: Set model initial free-surface height/pressure. |
C | | | |-INI_PSURF :: Set model initial free-surface height/pressure. |
148 |
C | | | |-INI_PRESSURE :: Compute model initial hydrostatic pressure |
C | | | |-INI_PRESSURE :: Compute model initial hydrostatic pressure |
149 |
C | | | |
C | | | |-READ_CHECKPOINT :: Read the checkpoint |
|
C | | |-INI_TR1 :: Set initial tracer 1 distribution. |
|
150 |
C | | | |
C | | | |
151 |
C | | |-THE_CORRECTION_STEP :: Step forward to next time step. |
C | | |-THE_CORRECTION_STEP :: Step forward to next time step. |
152 |
C | | | | :: Here applied to move restart conditions |
C | | | | :: Here applied to move restart conditions |
225 |
C/\ | | | | |
C/\ | | | | |
226 |
C/\ | | | |-EXCH :: Sync forcing. in overlap regions. |
C/\ | | | |-EXCH :: Sync forcing. in overlap regions. |
227 |
C/\ | | |-SEAICE_MODEL :: Compute sea-ice terms. ( pkg/seaice ) |
C/\ | | |-SEAICE_MODEL :: Compute sea-ice terms. ( pkg/seaice ) |
228 |
|
C/\ | | |-FREEZE :: Limit surface temperature. |
229 |
C/\ | | |-GCHEM_FIELD_LOAD :: load tracer forcing fields (pkg/gchem) |
C/\ | | |-GCHEM_FIELD_LOAD :: load tracer forcing fields (pkg/gchem) |
230 |
C/\ | | | |
C/\ | | | |
231 |
C/\ | | |-THERMODYNAMICS :: theta, salt + tracer equations driver. |
C/\ | | |-THERMODYNAMICS :: theta, salt + tracer equations driver. |
278 |
C/\ | | | | |
C/\ | | | | |
279 |
C/\ | | | |-TIMESTEP_TRACER :: Step tracer field forward in time |
C/\ | | | |-TIMESTEP_TRACER :: Step tracer field forward in time |
280 |
C/\ | | | | |
C/\ | | | | |
|
C/\ | | | |-CALC_GTR1 :: Calculate other tracer(s) tendency terms |
|
|
C/\ | | | | | |
|
|
C/\ | | | | |-GAD_CALC_RHS :: Generalised advection package |
|
|
C/\ | | | | | :: ( see pkg/gad ) |
|
|
C/\ | | | | | |
|
|
C/\ | | | | |-EXTERNAL_FORCING_TR:: Problem specific forcing for tracer. |
|
|
C/\ | | | | |-ADAMS_BASHFORTH2 :: Extrapolate tendencies forward in time. |
|
|
C/\ | | | | |-FREESURF_RESCALE_G :: Re-scale Gs for free-surface height. |
|
|
C/\ | | | | |
|
281 |
C/\ | | | |-TIMESTEP_TRACER :: Step tracer field forward in time |
C/\ | | | |-TIMESTEP_TRACER :: Step tracer field forward in time |
282 |
C/\ | | | | |
C/\ | | | | |
283 |
C/\ | | | |-PTRACERS_INTEGRATE :: Integrate other tracer(s) ( see pkg/ptracers ). |
C/\ | | | |-PTRACERS_INTEGRATE :: Integrate other tracer(s) ( see pkg/ptracers ). |
294 |
C/\ | | | | |-TIMESTEP_TRACER :: Step tracer field forward in time |
C/\ | | | | |-TIMESTEP_TRACER :: Step tracer field forward in time |
295 |
C/\ | | | | |
C/\ | | | | |
296 |
C/\ | | | |-OBCS_APPLY_TS :: Open bndy. package (see pkg/obcs ). |
C/\ | | | |-OBCS_APPLY_TS :: Open bndy. package (see pkg/obcs ). |
|
C/\ | | | |-FREEZE :: Limit range of temperature. |
|
297 |
C/\ | | | | |
C/\ | | | | |
298 |
C/\ | | | |-IMPLDIFF :: Solve vertical implicit diffusion equation. |
C/\ | | | |-IMPLDIFF :: Solve vertical implicit diffusion equation. |
299 |
C/\ | | | |-OBCS_APPLY_TS :: Open bndy. package (see pkg/obcs ). |
C/\ | | | |-OBCS_APPLY_TS :: Open bndy. package (see pkg/obcs ). |
368 |
C/\ | | | |-KPP_DO_DIAGS :: KPP diags. see pkg/kpp |
C/\ | | | |-KPP_DO_DIAGS :: KPP diags. see pkg/kpp |
369 |
C/\ | | | |-SBO_CALC :: SBO diags. see pkg/sbo |
C/\ | | | |-SBO_CALC :: SBO diags. see pkg/sbo |
370 |
C/\ | | | |-SBO_DIAGS :: SBO diags. see pkg/sbo |
C/\ | | | |-SBO_DIAGS :: SBO diags. see pkg/sbo |
371 |
|
C/\ | | | |-SEAICE_DO_DIAGS :: SEAICE diags. see pkg/seaice |
372 |
C/\ | | | |-GCHEM_DIAGS :: gchem diags. see pkg/gchem |
C/\ | | | |-GCHEM_DIAGS :: gchem diags. see pkg/gchem |
373 |
C/\ | | | |
C/\ | | | |
374 |
C/\ | | |-WRITE_CHECKPOINT :: Do I/O for restart files. |
C/\ | | |-WRITE_CHECKPOINT :: Do I/O for restart files. |
529 |
_BEGIN_MASTER( mythid ) |
_BEGIN_MASTER( mythid ) |
530 |
IF (myProcId .eq. 0) THEN |
IF (myProcId .eq. 0) THEN |
531 |
inquire( file='costfinal', exist=exst ) |
inquire( file='costfinal', exist=exst ) |
532 |
IF ( .NOT. exst ) THEN |
IF ( .NOT. exst .AND. niter0 .EQ. 0 ) THEN |
533 |
CALL TIMER_START('CTRL_UNPACK [THE_MODEL_MAIN]',mythid) |
IF ( optimcycle.NE.0 ) THEN |
534 |
CALL CTRL_UNPACK( .TRUE. , mythid ) |
CALL TIMER_START('CTRL_UNPACK [THE_MODEL_MAIN]',mythid) |
535 |
CALL TIMER_STOP ('CTRL_UNPACK [THE_MODEL_MAIN]',mythid) |
CALL CTRL_UNPACK( .TRUE. , mythid ) |
536 |
|
CALL TIMER_STOP ('CTRL_UNPACK [THE_MODEL_MAIN]',mythid) |
537 |
|
ENDIF |
538 |
IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN |
IF ( optimcycle.EQ.0 .AND. mycurrentiter.EQ.niter0 ) THEN |
539 |
CALL TIMER_START('CTRL_PACK [THE_MODEL_MAIN]',mythid) |
CALL TIMER_START('CTRL_PACK [THE_MODEL_MAIN]',mythid) |
540 |
CALL CTRL_PACK( .TRUE. , mythid ) |
CALL CTRL_PACK( .TRUE. , mythid ) |
568 |
CALL COST_FINAL_STORE ( mythid, lastdiva ) |
CALL COST_FINAL_STORE ( mythid, lastdiva ) |
569 |
ELSE |
ELSE |
570 |
CALL TIMER_START('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
CALL TIMER_START('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
571 |
CALL ADTHE_MAIN_LOOP ( mythid ) |
CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid ) |
572 |
CALL TIMER_STOP ('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
CALL TIMER_STOP ('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
573 |
CALL COST_FINAL_RESTORE ( mythid, lastdiva ) |
CALL COST_FINAL_RESTORE ( mythid, lastdiva ) |
574 |
ENDIF |
ENDIF |
575 |
c-- |
c-- |
576 |
# else /* ALLOW_DIVIDED_ADJOINT undef */ |
# else /* ALLOW_DIVIDED_ADJOINT undef */ |
577 |
CALL TIMER_START('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
CALL TIMER_START('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
578 |
CALL ADTHE_MAIN_LOOP ( mythid ) |
CALL ADTHE_MAIN_LOOP ( myCurrentTime, myCurrentIter, mythid ) |
579 |
|
cph CALL ADTHE_MAIN_LOOP ( mythid ) |
580 |
CALL TIMER_STOP ('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
CALL TIMER_STOP ('ADTHE_MAIN_LOOP [ADJOINT RUN]', mythid) |
581 |
# endif /* ALLOW_DIVIDED_ADJOINT */ |
# endif /* ALLOW_DIVIDED_ADJOINT */ |
582 |
c |
c |
616 |
|
|
617 |
#endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM_RUN */ |
#endif /* ALLOW_TANGENTLINEAR_RUN ALLOW_ADJOINT_RUN ALLOW_ADMTLM_RUN */ |
618 |
|
|
|
C-- Sea-ice checkpoint (in case the in-loop checkpoint was missed) |
|
|
#ifdef ALLOW_SEAICE |
|
|
IF ( useSEAICE ) |
|
|
& CALL SEAICE_WRITE_PICKUP( |
|
|
& .TRUE., myCurrentTime, myCurrentIter, myThid ) |
|
|
#endif |
|
|
|
|
619 |
C-- Final checkpoint (in case the in-loop checkpoint was missed) |
C-- Final checkpoint (in case the in-loop checkpoint was missed) |
620 |
CALL TIMER_START('WRITE_CHECKPOINT [THE_MODEL_MAIN]',myThid) |
CALL TIMER_START('WRITE_CHECKPOINT [THE_MODEL_MAIN]',myThid) |
621 |
|
CALL PACKAGES_WRITE_PICKUP( |
622 |
|
I .TRUE., myCurrentTime, myCurrentIter, myThid ) |
623 |
CALL WRITE_CHECKPOINT( |
CALL WRITE_CHECKPOINT( |
624 |
& .TRUE., myCurrentTime, myCurrentIter, myThid ) |
I .TRUE., myCurrentTime, myCurrentIter, myThid ) |
625 |
CALL TIMER_STOP ('WRITE_CHECKPOINT [THE_MODEL_MAIN]',myThid) |
CALL TIMER_STOP ('WRITE_CHECKPOINT [THE_MODEL_MAIN]',myThid) |
626 |
|
|
627 |
CALL TIMER_STOP ('ALL [THE_MODEL_MAIN]',myThid) |
CALL TIMER_STOP ('ALL [THE_MODEL_MAIN]',myThid) |
628 |
|
|
629 |
|
#ifdef ALLOW_MNC |
630 |
|
IF (useMNC) THEN |
631 |
|
C Close all open NetCDF files |
632 |
|
_BEGIN_MASTER( mythid ) |
633 |
|
CALL MNC_FILE_CLOSE_ALL( myThid ) |
634 |
|
_END_MASTER( mythid ) |
635 |
|
ENDIF |
636 |
|
#endif |
637 |
|
|
638 |
C-- Write timer statistics |
C-- Write timer statistics |
639 |
IF ( myThid .EQ. 1 ) THEN |
IF ( myThid .EQ. 1 ) THEN |
640 |
CALL TIMER_PRINTALL( myThid ) |
CALL TIMER_PRINTALL( myThid ) |