- Timestamp:
- 2016-10-21T19:24:28+02:00 (8 years ago)
- Location:
- branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/SAS_SRC
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/SAS_SRC/daymod.F90
r5564 r7069 268 268 269 269 ! since we no longer call rst_opn, need to define nitrst here, used by ice restart routine 270 IF( kt == nit000 ) nitrst = nitend 270 IF( kt == nit000 ) THEN 271 nitrst = nitend 272 lrst_oce = .FALSE. ! init restart ocean (done in rst_opn when not SAS) 273 ENDIF 274 271 275 IF( MOD( kt - 1, nstock ) == 0 ) THEN 272 276 ! we use kt - 1 and not kt - nit000 to keep the same periodicity from the beginning of the experiment -
branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/SAS_SRC/nemogcm.F90
r7060 r7069 49 49 USE step ! NEMO time-stepping (stp routine) 50 50 USE lib_mpp ! distributed memory computing 51 #if defined key_nosignedzero52 51 USE lib_fortran ! Fortran utilities (allows no signed zero when 'key_nosignedzero' defined) 53 #endif54 52 #if defined key_iomput 55 53 USE xios … … 58 56 USE sbcssm 59 57 USE lbcnfd, ONLY: isendto, nsndto, nfsloop, nfeloop ! Setup of north fold exchanges 58 USE icbini ! handle bergs, initialisation 60 59 USE icbstp ! handle bergs, calving, themodynamics and transport 61 #if defined key_bdy 60 62 61 USE bdyini ! open boundary cond. setting (bdy_init routine). clem: mandatory for LIM3 63 USE bdydta ! open boundary cond. setting (bdy_dta_init routine). clem: mandatory for LIM3 64 #endif 62 USE bdydta ! open boundary cond. setting (bdy_dta_init routine) - - 65 63 USE bdy_par 66 64 67 65 IMPLICIT NONE 68 66 PRIVATE … … 98 96 ! 99 97 #if defined key_agrif 100 101 #endif 102 98 CALL Agrif_Init_Grids() ! AGRIF: set the meshes 99 #endif 100 103 101 ! !-----------------------! 104 102 CALL nemo_init !== Initialisations ==! … … 113 111 CALL Agrif_Declare_Var_lim2 ! " " " " " LIM 114 112 # endif 113 # if defined key_lim3 114 CALL Agrif_Declare_Var_lim3 ! " " " " " LIM3 clem: useless? 115 # endif 115 116 #endif 116 117 ! check that all process are still there... If some process have an error, … … 124 125 ! !-----------------------! 125 126 istp = nit000 127 128 #if defined key_agrif 129 CALL Agrif_Regrid() 130 #endif 126 131 127 132 DO WHILE ( istp <= nitend .AND. nstop == 0 ) 128 133 #if defined key_agrif 129 CALL Agrif_Step( stp )! AGRIF: time stepping134 CALL stp ! AGRIF: time stepping 130 135 #else 131 136 CALL stp( istp ) ! standard time stepping … … 148 153 ! 149 154 #if defined key_agrif 150 CALL Agrif_ParentGrid_To_ChildGrid() 151 IF( nn_timing == 1 ) CALL timing_finalize 152 CALL Agrif_ChildGrid_To_ParentGrid() 155 IF( .NOT. Agrif_Root() ) THEN 156 CALL Agrif_ParentGrid_To_ChildGrid() 157 IF( nn_timing == 1 ) CALL timing_finalize 158 CALL Agrif_ChildGrid_To_ParentGrid() 159 ENDIF 153 160 #endif 154 161 IF( nn_timing == 1 ) CALL timing_finalize … … 287 294 jpnij = jpni*jpnj 288 295 #endif 289 END 296 ENDIF 290 297 291 298 ! Calculate domain dimensions given calculated jpni and jpnj … … 301 308 #endif 302 309 ENDIF 303 jpk = jpkdta ! third dim 310 #if defined key_sas2D 311 jpk = 1 ! third dim 312 jpkm1 = 1 ! " " 313 #else 314 jpk = jpkdta ! third dim 315 jpkm1 = jpk-1 ! " " 316 #endif 317 #if defined key_agrif 318 ! simple trick to use same vertical grid as parent 319 ! but different number of levels: 320 ! Save maximum number of levels in jpkdta, then define all vertical grids 321 ! with this number. 322 ! Suppress once vertical online interpolation is ok 323 IF(.NOT.Agrif_Root()) jpkdta = Agrif_Parent(jpkdta) 324 #endif 304 325 jpim1 = jpi-1 ! inner domain indices 305 326 jpjm1 = jpj-1 ! " " 306 jpkm1 = jpk-1 ! " "307 327 jpij = jpi*jpj ! jpi x j 308 328 … … 330 350 ENDIF 331 351 332 ! Now we know the dimensions of the grid and numout has been set we can 333 ! allocate arrays 352 ! Now we know the dimensions of the grid and numout has been set we can allocate arrays 334 353 CALL nemo_alloc() 335 354 … … 353 372 CALL dom_init ! Domain 354 373 355 IF( ln_nnogather )CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined)356 357 IF( ln_ctl )CALL prt_ctl_init ! Print control374 IF( ln_nnogather ) CALL nemo_northcomms ! Initialise the northfold neighbour lists (must be done after the masks are defined) 375 376 IF( ln_ctl ) CALL prt_ctl_init ! Print control 358 377 CALL day_init ! model calendar (using both namelist and restart infos) 359 378 360 379 CALL sbc_init ! Forcings : surface module 361 380 362 381 ! ==> clem: open boundaries init. is mandatory for LIM3 because ice BDY is not decoupled from 363 382 ! the environment of ocean BDY. Therefore bdy is called in both OPA and SAS modules. … … 366 385 IF( lk_bdy ) CALL bdy_dta_init 367 386 ! ==> 387 CALL icb_init( rdt, nit000) ! initialise icebergs instance 368 388 369 389 IF(lwp) WRITE(numout,*) 'Euler time step switch is ', neuler … … 514 534 USE diawri , ONLY: dia_wri_alloc 515 535 USE dom_oce , ONLY: dom_oce_alloc 536 USE oce 516 537 #if defined key_bdy 517 538 USE bdy_oce , ONLY: bdy_oce_alloc 518 USE oce ! clem: mandatory for LIM3 because needed for bdy arrays 519 #else 520 USE oce , ONLY : sshn, sshb, snwice_mass, snwice_mass_b, snwice_fmass 521 #endif 522 ! 523 INTEGER :: ierr,ierr1,ierr2,ierr3,ierr4,ierr5,ierr6,ierr7,ierr8 524 INTEGER :: jpm 539 #endif 540 ! 541 INTEGER :: ierr 525 542 !!---------------------------------------------------------------------- 526 543 ! 527 544 ierr = dia_wri_alloc () 528 545 ierr = ierr + dom_oce_alloc () ! ocean domain 546 ierr = ierr + oce_alloc () ! (tsn...) needed for agrif and/or lim3 and bdy 529 547 #if defined key_bdy 530 548 ierr = ierr + bdy_oce_alloc () ! bdy masks (incl. initialization) 531 ierr = ierr + oce_alloc () ! (tsn...)532 #endif533 534 #if ! defined key_bdy535 ALLOCATE( snwice_mass(jpi,jpj) , snwice_mass_b(jpi,jpj), &536 & snwice_fmass(jpi,jpj) , STAT= ierr1 )537 !538 ! lim code currently uses surface temperature and salinity in tsn array for initialisation539 ! and ub, vb arrays in ice dynamics, so allocate enough of arrays to use540 ! clem: should not be needed. To be checked out541 jpm = MAX(jp_tem, jp_sal)542 ALLOCATE( tsn(jpi,jpj,1,jpm) , STAT=ierr2 )543 ALLOCATE( ub(jpi,jpj,1) , STAT=ierr3 )544 ALLOCATE( vb(jpi,jpj,1) , STAT=ierr4 )545 ALLOCATE( tsb(jpi,jpj,1,jpm) , STAT=ierr5 )546 ALLOCATE( sshn(jpi,jpj) , STAT=ierr6 )547 ALLOCATE( un(jpi,jpj,1) , STAT=ierr7 )548 ALLOCATE( vn(jpi,jpj,1) , STAT=ierr8 )549 ierr = ierr + ierr1 + ierr2 + ierr3 + ierr4 + ierr5 + ierr6 + ierr7 + ierr8550 549 #endif 551 550 ! … … 618 617 INTEGER :: ifac, jl, inu 619 618 INTEGER, PARAMETER :: ntest = 14 620 INTEGER :: ilfax(ntest) 619 INTEGER, DIMENSION(ntest) :: ilfax 620 !!---------------------------------------------------------------------- 621 621 ! 622 622 ! lfax contains the set of allowed factors. 623 data (ilfax(jl),jl=1,ntest) / 16384, 8192, 4096, 2048, 1024, 512, 256, & 624 & 128, 64, 32, 16, 8, 4, 2 / 625 !!---------------------------------------------------------------------- 623 ilfax(:) = (/(2**jl,jl=ntest,1,-1)/) 626 624 627 625 ! Clear the error flag and initialise output vars … … 721 719 nsndto = nsndto + 1 722 720 isendto(nsndto) = jn 723 END 721 ENDIF 724 722 END DO 725 723 nfsloop = 1 -
branches/2016/dev_v3_6_STABLE_r6506_AGRIF_LIM3/NEMOGCM/NEMO/SAS_SRC/sbcssm.F90
r6861 r7069 82 82 ! 83 83 IF( nn_timing == 1 ) CALL timing_start( 'sbc_ssm') 84 85 IF ( l_sasread ) THEN 86 IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d ) !== read data at kt time step ==! 87 IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d ) !== read data at kt time step ==! 88 ! 89 IF( ln_3d_uve ) THEN 90 ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 91 ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 92 IF( lk_vvl ) e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 84 85 IF ( l_sasread ) THEN 86 IF( nfld_3d > 0 ) CALL fld_read( kt, 1, sf_ssm_3d ) !== read data at kt time step ==! 87 IF( nfld_2d > 0 ) CALL fld_read( kt, 1, sf_ssm_2d ) !== read data at kt time step ==! 88 ! 89 IF( ln_3d_uve ) THEN 90 IF( lk_vvl ) e3t_m(:,:) = sf_ssm_3d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 91 ssu_m(:,:) = sf_ssm_3d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 92 ssv_m(:,:) = sf_ssm_3d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 93 ELSE 94 IF( lk_vvl ) e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 95 ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 96 ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 97 ENDIF 98 ! 99 sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1) ! temperature 100 sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1) ! salinity 101 ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1) ! sea surface height 102 IF( ln_read_frq ) THEN 103 frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1) ! solar penetration 104 ELSE 105 frq_m(:,:) = 1._wp 106 ENDIF 93 107 ELSE 94 ssu_m(:,:) = sf_ssm_2d(jf_usp)%fnow(:,:,1) * umask(:,:,1) ! u-velocity 95 ssv_m(:,:) = sf_ssm_2d(jf_vsp)%fnow(:,:,1) * vmask(:,:,1) ! v-velocity 96 IF( lk_vvl ) e3t_m(:,:) = sf_ssm_2d(jf_e3t)%fnow(:,:,1) * tmask(:,:,1) ! v-velocity 97 ENDIF 98 ! 99 sst_m(:,:) = sf_ssm_2d(jf_tem)%fnow(:,:,1) * tmask(:,:,1) ! temperature 100 sss_m(:,:) = sf_ssm_2d(jf_sal)%fnow(:,:,1) * tmask(:,:,1) ! salinity 101 ssh_m(:,:) = sf_ssm_2d(jf_ssh)%fnow(:,:,1) * tmask(:,:,1) ! sea surface height 102 IF( ln_read_frq ) frq_m(:,:) = sf_ssm_2d(jf_frq)%fnow(:,:,1) * tmask(:,:,1) ! sea surface height 103 104 ELSE 105 sst_m(:,:) = 0. 106 sss_m(:,:) = 0. 107 ssu_m(:,:) = 0. 108 ssv_m(:,:) = 0. 109 ssh_m(:,:) = 0. 110 ENDIF 111 ! 108 sst_m(:,:) = 0._wp 109 sss_m(:,:) = 0._wp 110 ssu_m(:,:) = 0._wp 111 ssv_m(:,:) = 0._wp 112 ssh_m(:,:) = 0._wp 113 e3t_m(:,:) = e3t_0(:,:,1) !clem: necessary at least for sas2D 114 frq_m(:,:) = 1._wp ! - - 115 sshn (:,:) = 0._wp ! - - 116 ENDIF 117 112 118 IF ( nn_ice == 1 ) THEN 113 119 tsn(:,:,1,jp_tem) = sst_m(:,:) … … 118 124 ub (:,:,1) = ssu_m(:,:) 119 125 vb (:,:,1) = ssv_m(:,:) 120 126 121 127 IF(ln_ctl) THEN ! print control 122 128 CALL prt_ctl(tab2d_1=sst_m, clinfo1=' sst_m - : ', mask1=tmask, ovlap=1 ) … … 300 306 301 307 CALL sbc_ssm( nit000 ) ! need to define ss?_m arrays used in limistate 302 IF( .NOT. ln_read_frq ) frq_m(:,:) = 1.303 308 l_initdone = .TRUE. 304 309 !
Note: See TracChangeset
for help on using the changeset viewer.