- Timestamp:
- 06/20/17 14:46:35 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SOURCES/spinup_mod.f90
r65 r115 23 23 use deformation_mod_2lois 24 24 use interface_input 25 use io_netcdf_grisli 26 25 27 implicit none 26 28 … … 39 41 real, dimension(nx,ny) :: Vsl_x !< 40 42 real, dimension(nx,ny) :: Vsl_y !< 43 44 integer :: type_vitbil ! defini le type de fichier a lire : lect_vitbil ou lect_vitbil_Lebrocq 41 45 42 46 contains … … 47 51 !< 48 52 subroutine init_spinup 49 namelist/spinup/ispinup 53 namelist/spinup/ispinup,type_vitbil 50 54 51 55 ! put here which type of spinup … … 79 83 write(num_rep_42,*)'! ispinup = 2 conservation de la masse avec vitesses bilan ' 80 84 write(num_rep_42,*)'! ispinup = 3 equilibre temperature avec vitesses bilan' 85 write(num_rep_42,*)'! type_vitbil type de lecture des vitesses de bilan 1: lect_vitbil, 2 : lect_vitbil_Lebrocq' 81 86 write(num_rep_42,*) 82 87 … … 88 93 endif 89 94 90 91 call lect_vitbil 95 select case (type_vitbil) 96 case (1) 97 !cdc Methode Cat lecture fichier selon x et y sur grille stag 98 call lect_vitbil 99 case(2) 100 !cdc Methode Tof lecture fichier Lebrocq vitesse et direction 101 call lect_vitbil_Lebrocq 102 case default 103 print*,'type_vitbil valeur invalide dans spinup_vitbil' 104 end select 92 105 93 106 if (itracebug.eq.1) call tracebug(' fin routine init_spinup de spinup_vitbil') … … 96 109 subroutine lect_vitbil 97 110 98 99 111 character(len=100) :: balance_Ux_file ! balance velocity file Ux 100 112 character(len=100) :: balance_Uy_file ! balance velocity file Uy 101 113 real*8, dimension(:,:), pointer :: tab !< tableau 2d real pointer 114 102 115 namelist/vitbil_upwind/balance_Ux_file, balance_Uy_file 103 116 … … 122 135 balance_Ux_file = trim(dirnameinp)//trim(balance_Ux_file) 123 136 balance_Uy_file = trim(dirnameinp)//trim(balance_Uy_file) 124 125 call lect_input(1,'Vcol_x',1,Vcol_x,balance_Ux_file,"") 126 call lect_input(1,'Vcol_y',1,Vcol_y,balance_Uy_file,"") 137 138 call Read_Ncdf_var('Vcol_x',balance_Ux_file,tab) 139 Vcol_x(:,:)=tab(:,:) 140 call Read_Ncdf_var('Vcol_y',balance_Uy_file,tab) 141 Vcol_y(:,:)=tab(:,:) 127 142 128 143 ! call lect_input(2,'Vcol',1,Vcol_x,balance_vel_file,trim(dirnameinp)//trim(runname)//'.nc') !read Vcol_x … … 135 150 136 151 end subroutine lect_vitbil 152 153 subroutine lect_vitbil_Lebrocq 154 155 156 character(len=100) :: vit_balance_file ! balance velocity file 157 character(len=100) :: flowdir_balance_file ! balance flow direction file 158 real*8, dimension(:,:), pointer :: tab !< tableau 2d real pointer 159 real, dimension(nx,ny) :: V_Lebrocq !< vertically averaged velocity (balance) 160 real, dimension(nx,ny) :: flowdir_Lebrocq !< flow direction (degree) 161 real, dimension(nx,ny) :: Vx_Lebrocq, Vy_Lebrocq ! vitesses selon x et y 162 163 namelist/vitbil_Lebrocq/vit_balance_file, flowdir_balance_file 164 165 if (itracebug.eq.1) call tracebug(' Subroutine lect_vitbil_Lebrocq') 166 167 ! lecture des parametres du run 168 !-------------------------------------------------------------------- 169 170 rewind(num_param) ! pour revenir au debut du fichier param_list.dat 171 428 format(A) 172 read(num_param,vitbil_Lebrocq) 173 174 write(num_rep_42,428) '!___________________________________________________________' 175 write(num_rep_42,428) '!read balance velocities from Lebrocq code' 176 write(num_rep_42,vitbil_Lebrocq) 177 write(num_rep_42,428) '! vit_balance_file : balance velocity file' 178 write(num_rep_42,428) '! flowdir_balance_file : balance flow direction file' 179 write(num_rep_42,*) 180 181 ! read balance velocities on staggered nodes 182 183 vit_balance_file = trim(dirnameinp)//trim(vit_balance_file) 184 flowdir_balance_file = trim(dirnameinp)//trim(flowdir_balance_file) 185 186 call Read_Ncdf_var('z',vit_balance_file,tab) 187 V_Lebrocq(:,:)=tab(:,:) 188 call Read_Ncdf_var('z',flowdir_balance_file,tab) 189 flowdir_Lebrocq(:,:)=tab(:,:)*PI/180. 190 191 ! calcul des vitesses selon x et selon y : 192 where (V_Lebrocq(:,:).ge.0.) 193 Vx_Lebrocq(:,:) = V_Lebrocq(:,:)*sin(flowdir_Lebrocq(:,:)) 194 Vy_Lebrocq(:,:) = V_Lebrocq(:,:)*cos(flowdir_Lebrocq(:,:)) 195 elsewhere 196 Vx_Lebrocq(:,:) = 0. 197 Vy_Lebrocq(:,:) = 0. 198 endwhere 199 200 ! calcul des vitesses sur les points staggered 201 202 do j=2,ny 203 do i=2,nx 204 Vcol_x(i,j) = (Vx_Lebrocq(i-1,j) + Vx_Lebrocq(i,j))/2. 205 Vcol_y(i,j) = (Vy_Lebrocq(i,j-1) + Vy_Lebrocq(i,j))/2. 206 enddo 207 enddo 208 209 end subroutine lect_vitbil_Lebrocq 137 210 !____________________________________________________________________________________ 138 211
Note: See TracChangeset
for help on using the changeset viewer.