Changeset 13141
- Timestamp:
- 2020-06-22T18:27:34+02:00 (3 years ago)
- Location:
- NEMO/branches/2020/dev_r12973_AGRIF_CMEMS
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
NEMO/branches/2020/dev_r12973_AGRIF_CMEMS/cfgs/SHARED/namelist_ref
r13058 r13141 638 638 &namagrif ! AGRIF zoom ("key_agrif") 639 639 !----------------------------------------------------------------------- 640 ln_agrif_2way = .true. ! activate two way nesting 641 ln_spc_dyn = .true. ! use 0 as special value for dynamics 642 rn_sponge_tra = 2880. ! coefficient for tracer sponge layer [m2/s] 643 rn_sponge_dyn = 2880. ! coefficient for dynamics sponge layer [m2/s] 644 rn_trelax_tra = 0.01 ! inverse of relaxation time (in steps) for tracers [] 645 rn_trelax_dyn = 0.01 ! inverse of relaxation time (in steps) for dynamics [] 646 ln_chk_bathy = .false. ! =T check the parent bathymetry 647 ln_bry_south = .true. ! =T south boundary open 640 ln_agrif_2way = .true. ! activate two way nesting 641 ln_init_chfrpar = .false. ! initialize child grids from parent 642 ln_spc_dyn = .true. ! use 0 as special value for dynamics 643 rn_sponge_tra = 2880. ! coefficient for tracer sponge layer [m2/s] 644 rn_sponge_dyn = 2880. ! coefficient for dynamics sponge layer [m2/s] 645 rn_trelax_tra = 0.01 ! inverse of relaxation time (in steps) for tracers [] 646 rn_trelax_dyn = 0.01 ! inverse of relaxation time (in steps) for dynamics [] 647 ln_chk_bathy = .false. ! =T check the parent bathymetry 648 ln_bry_south = .true. ! =T south boundary open 648 649 / 649 650 !----------------------------------------------------------------------- -
NEMO/branches/2020/dev_r12973_AGRIF_CMEMS/src/NST/agrif_oce.F90
r13026 r13141 19 19 20 20 ! !!* Namelist namagrif: AGRIF parameters 21 LOGICAL , PUBLIC :: ln_init_chfrpar = .FALSE. !: set child grids initial state from parent 21 22 LOGICAL , PUBLIC :: ln_agrif_2way = .TRUE. !: activate two way nesting 22 23 LOGICAL , PUBLIC :: ln_spc_dyn = .FALSE. !: use zeros (.false.) or not (.true.) in -
NEMO/branches/2020/dev_r12973_AGRIF_CMEMS/src/NST/agrif_oce_interp.F90
r13026 r13141 717 717 REAL(wp) :: zhtot 718 718 REAL(wp), DIMENSION(k1:k2,1:jpts) :: tabin 719 REAL(wp), DIMENSION(k1:k2) :: h_in 720 REAL(wp), DIMENSION(1:jpk) :: h_out 719 REAL(wp), DIMENSION(k1:k2) :: h_in, z_in 720 REAL(wp), DIMENSION(1:jpk) :: h_out, z_out 721 721 !!---------------------------------------------------------------------- 722 722 … … 790 790 tabin(jk,:) = ptab(ji,jj,jk,n1:n2-1) 791 791 END DO 792 z_in(1) = 0.5_wp * h_in(1) - zhtot + ht0_parent(ji,jj) 793 DO jk=2,N_in 794 z_in(jk) = z_in(jk-1) + 0.5_wp * h_in(jk) 795 ENDDO 796 792 797 N_out = 0 793 798 DO jk=1,jpk ! jpk of child grid … … 796 801 h_out(jk) = e3t(ji,jj,jk,Krhs_a) 797 802 ENDDO 803 804 z_out(1) = 0.5_wp * h_out(1) - SUM(h_out(1:N_out)) + ht_0(ji,jj) 805 DO jk=2,N_out 806 z_out(jk) = z_out(jk-1) + 0.5_wp * h_out(jk) 807 ENDDO 808 798 809 IF (N_in*N_out > 0) THEN 799 810 IF( l_ini_child ) THEN 800 CALL remap_linear(tabin(1:N_in,1:jpts), h_in(1:N_in),ts(ji,jj,1:N_out,1:jpts,Krhs_a), &801 & h_out(1:N_out),N_in,N_out,jpts)811 CALL remap_linear(tabin(1:N_in,1:jpts),z_in(1:N_in),ts(ji,jj,1:N_out,1:jpts,Krhs_a), & 812 & z_out(1:N_out),N_in,N_out,jpts) 802 813 ELSE 803 814 CALL reconstructandremap(tabin(1:N_in,1:jpts),h_in(1:N_in),ts(ji,jj,1:N_out,1:jpts,Krhs_a), & … … 850 861 REAL(wp) :: zrhoy, zhtot 851 862 ! vertical interpolation: 852 REAL(wp), DIMENSION(k1:k2) :: tabin, h_in 853 REAL(wp), DIMENSION(1:jpk) :: h_out 863 REAL(wp), DIMENSION(k1:k2) :: tabin, h_in, z_in 864 REAL(wp), DIMENSION(1:jpk) :: h_out, z_out 854 865 INTEGER :: N_in, N_out,item 855 866 REAL(wp) :: h_diff … … 924 935 ENDIF 925 936 ENDDO 937 z_in(1) = 0.5_wp * h_in(1) - zhtot + hu0_parent(ji,jj) 938 DO jk=2,N_in 939 z_in(jk) = z_in(jk-1) + 0.5_wp * h_in(jk) 940 ENDDO 926 941 927 942 N_out = 0 … … 931 946 h_out(N_out) = e3u(ji,jj,jk,Krhs_a) 932 947 ENDDO 948 949 z_out(1) = 0.5_wp * h_out(1) - SUM(h_out(1:N_out)) + hu_0(ji,jj) 950 DO jk=2,N_out 951 z_out(jk) = z_out(jk-1) + 0.5_wp * h_out(jk) 952 ENDDO 953 933 954 IF (N_in*N_out > 0) THEN 934 955 IF( l_ini_child ) THEN 935 CALL remap_linear (tabin(1:N_in), h_in(1:N_in),uu(ji,jj,1:N_out,Krhs_a),h_out(1:N_out),N_in,N_out,1)956 CALL remap_linear (tabin(1:N_in),z_in(1:N_in),uu(ji,jj,1:N_out,Krhs_a),z_out(1:N_out),N_in,N_out,1) 936 957 ELSE 937 958 CALL reconstructandremap(tabin(1:N_in),h_in(1:N_in),uu(ji,jj,1:N_out,Krhs_a),h_out(1:N_out),N_in,N_out,1) … … 964 985 REAL(wp) :: zrhox 965 986 ! vertical interpolation: 966 REAL(wp), DIMENSION(k1:k2) :: tabin, h_in 967 REAL(wp), DIMENSION(1:jpk) :: h_out 987 REAL(wp), DIMENSION(k1:k2) :: tabin, h_in, z_in 988 REAL(wp), DIMENSION(1:jpk) :: h_out, z_out 968 989 INTEGER :: N_in, N_out, item 969 990 REAL(wp) :: h_diff, zhtot … … 1029 1050 ENDIF 1030 1051 zhtot = zhtot + h_in(jk) 1031 IF( h_in(jk) .GT. 0. ) THEN 1032 tabin(jk) = ptab(ji,jj,jk,1)/(e1v(ji,jj)*zrhox*h_in(jk)) 1033 ELSE 1034 tabin(jk) = 0. 1035 ENDIF 1036 ENDDO 1037 1052 IF( h_in(jk) .GT. 0. ) THEN 1053 tabin(jk) = ptab(ji,jj,jk,1)/(e1v(ji,jj)*zrhox*h_in(jk)) 1054 ELSE 1055 tabin(jk) = 0. 1056 ENDIF 1057 ENDDO 1058 1059 z_in(1) = 0.5_wp * h_in(1) - zhtot + hv0_parent(ji,jj) 1060 DO jk=2,N_in 1061 z_in(jk) = z_in(jk-1) + 0.5_wp * h_in(jk) 1062 ENDDO 1063 1038 1064 N_out = 0 1039 1065 DO jk=1,jpk 1040 if(vmask(ji,jj,jk) == 0) EXIT1066 IF (vmask(ji,jj,jk) == 0) EXIT 1041 1067 N_out = N_out + 1 1042 1068 h_out(N_out) = e3v(ji,jj,jk,Krhs_a) 1043 END DO 1069 ENDDO 1070 1071 z_out(1) = 0.5_wp * h_out(1) - SUM(h_out(1:N_out)) + hv_0(ji,jj) 1072 DO jk=2,N_out 1073 z_out(jk) = z_out(jk-1) + 0.5_wp * h_out(jk) 1074 ENDDO 1075 1044 1076 IF (N_in*N_out > 0) THEN 1045 1077 IF( l_ini_child ) THEN 1046 CALL remap_linear (tabin(1:N_in), h_in(1:N_in),vv(ji,jj,1:N_out,Krhs_a),h_out(1:N_out),N_in,N_out,1)1078 CALL remap_linear (tabin(1:N_in),z_in(1:N_in),vv(ji,jj,1:N_out,Krhs_a),z_out(1:N_out),N_in,N_out,1) 1047 1079 ELSE 1048 1080 CALL reconstructandremap(tabin(1:N_in),h_in(1:N_in),vv(ji,jj,1:N_out,Krhs_a),h_out(1:N_out),N_in,N_out,1) -
NEMO/branches/2020/dev_r12973_AGRIF_CMEMS/src/NST/agrif_user.F90
r13133 r13141 52 52 INTEGER :: jn 53 53 54 IF(lwp) WRITE(numout,*) ' ' 55 IF(lwp) WRITE(numout,*) 'AGRIF: interp child initial state from parent' 56 IF(lwp) WRITE(numout,*) ' ' 57 54 58 l_ini_child = .TRUE. 55 59 Agrif_SpecialValue = 0._wp 56 60 Agrif_UseSpecialValue = .TRUE. 61 CALL Agrif_childgrid_to_parentgrid() 62 l_ini_child = .TRUE. 63 CALL Agrif_parentgrid_to_childgrid() 57 64 uu(:,:,:,:) = 0. ; vv(:,:,:,:) = 0. ; ts(:,:,:,:,:) = 0. 58 65 … … 61 68 ! Brutal fix to pas 1x1 refinment. 62 69 ! IF(Agrif_Irhox() == 1) THEN 63 CALL Agrif_Init_Variable(tsini_id, procname=agrif_initts)70 ! CALL Agrif_Init_Variable(tsini_id, procname=agrif_initts) 64 71 ! ELSE 65 !CALL Agrif_Init_Variable(tsini_id, procname=interptsn)72 CALL Agrif_Init_Variable(tsini_id, procname=interptsn) 66 73 67 74 ! ENDIF 75 ! just for VORTEX because Parent velocities can actually be exactly zero 76 ! Agrif_UseSpecialValue = .FALSE. 68 77 Agrif_UseSpecialValue = ln_spc_dyn 69 78 use_sign_north = .TRUE. 70 79 sign_north = -1. 71 !CALL Agrif_Init_Variable(uini_id , procname=interpun )72 !CALL Agrif_Init_Variable(vini_id , procname=interpvn )73 80 CALL Agrif_Init_Variable(uini_id , procname=interpun ) 81 CALL Agrif_Init_Variable(vini_id , procname=interpvn ) 82 use_sign_north = .FALSE. 74 83 75 84 Agrif_UseSpecialValue = .FALSE. ! 76 85 l_ini_child = .FALSE. 86 CALL Agrif_childgrid_to_parentgrid() 87 l_ini_child = .FALSE. 88 CALL Agrif_parentgrid_to_childgrid() 89 77 90 Krhs_a = Kaa ; Kmm_a = Kmm 78 91 … … 281 294 mbkv_parent(:,:) = MAX( NINT( zk(:,:) ), 1 ) 282 295 283 284 CALL Agrif_Init_Variable(sshini_id, procname=agrif_initssh) 285 CALL lbc_lnk( 'Agrif_Init_Domain', ssh(:,:,Kbb), 'T', 1. ) 286 DO jk = 1, jpk 287 e3t(:,:,jk,Kbb) = e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) & 288 & / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk) & 289 & + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 290 END DO 296 IF ( ln_init_chfrpar ) THEN 297 CALL Agrif_Init_Variable(sshini_id, procname=agrif_initssh) 298 CALL lbc_lnk( 'Agrif_Init_Domain', ssh(:,:,Kbb), 'T', 1. ) 299 DO jk = 1, jpk 300 e3t(:,:,jk,Kbb) = e3t_0(:,:,jk) * ( ht_0(:,:) + ssh(:,:,Kbb) ) & 301 & / ( ht_0(:,:) + 1._wp - ssmask(:,:) ) * tmask(:,:,jk) & 302 & + e3t_0(:,:,jk) * ( 1._wp - tmask(:,:,jk) ) 303 END DO 304 ENDIF 291 305 292 306 ! check if masks and bathymetries match … … 850 864 ! 851 865 INTEGER :: ios ! Local integer output status for namelist read 852 NAMELIST/namagrif/ ln_agrif_2way, rn_sponge_tra, rn_sponge_dyn, rn_trelax_tra, rn_trelax_dyn, &866 NAMELIST/namagrif/ ln_agrif_2way, ln_init_chfrpar, rn_sponge_tra, rn_sponge_dyn, rn_trelax_tra, rn_trelax_dyn, & 853 867 & ln_spc_dyn, ln_chk_bathy, ln_bry_south 854 868 !!-------------------------------------------------------------------------------------- … … 866 880 WRITE(numout,*) ' Namelist namagrif : set AGRIF parameters' 867 881 WRITE(numout,*) ' Two way nesting activated ln_agrif_2way = ', ln_agrif_2way 882 WRITE(numout,*) ' child initial state from parent ln_init_chfrpar = ', ln_init_chfrpar 868 883 WRITE(numout,*) ' sponge coefficient for tracers rn_sponge_tra = ', rn_sponge_tra, ' m^2/s' 869 884 WRITE(numout,*) ' sponge coefficient for dynamics rn_sponge_tra = ', rn_sponge_dyn, ' m^2/s' -
NEMO/branches/2020/dev_r12973_AGRIF_CMEMS/src/OCE/DOM/istate.F90
r13103 r13141 87 87 #endif 88 88 89 #if defined key_agrif 90 IF ( (.NOT.Agrif_root()).AND.ln_init_chfrpar ) THEN 91 numror = 0 ! define numror = 0 -> no restart file to read 92 ln_1st_euler = .true. ! Set time-step indicator at nit000 (euler forward) 93 CALL day_init 94 CALL agrif_istate( Kbb, Kmm, Kaa ) ! Interp from parent 95 ! 96 ts (:,:,:,:,Kmm) = ts (:,:,:,:,Kbb) 97 ssh (:,:,Kmm) = ssh(:,:,Kbb) 98 uu (:,:,:,Kmm) = uu (:,:,:,Kbb) 99 vv (:,:,:,Kmm) = vv (:,:,:,Kbb) 100 ELSE 101 #endif 89 102 IF( ln_rstart ) THEN ! Restart from a file 90 103 ! ! ------------------- … … 105 118 uu (:,:,:,Kbb) = 0._wp 106 119 vv (:,:,:,Kbb) = 0._wp 107 #if defined key_agrif108 ELSE109 CALL agrif_istate( Kbb, Kmm, Kaa )110 #endif111 120 ENDIF 112 121 ! … … 157 166 ! 158 167 ENDIF 168 #if defined key_agrif 169 ENDIF 170 #endif 159 171 ! 160 172 ! Initialize "now" and "before" barotropic velocities:
Note: See TracChangeset
for help on using the changeset viewer.