- Timestamp:
- 07/03/23 15:32:49 (11 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GRISLIv3/SOURCES/bmelt-beckmann-gcm_mod.f90
r346 r442 29 29 implicit none 30 30 31 integer, parameter :: nbassins = 10 !< number of sectors in the ocean 31 real*8,parameter :: cpw = 4182.d0 32 integer :: nbassins !< number of sectors in the ocean 32 33 integer :: nzoc !< number of vertical levels in the ocean (read in netcdf T/S file) 33 34 real*8 :: coef_OM !combined coefficient by DeConto et Pollard (m/yr/C2) … … 45 46 real*8, dimension (nx,ny) :: ice_draft !< ice draft (S-H) 46 47 character(len=200) :: TO_file, SO_file, Bassin_file ! fichiers de forcage 47 logical, dimension( nbassins):: mask_bassin_vide ! mask true if bassin without any GCM data48 logical, dimension(:), allocatable :: mask_bassin_vide ! mask true if bassin without any GCM data 48 49 49 50 contains … … 70 71 integer, dimension(:,:,:), allocatable :: mask_gcm ! mask were T S are defined 71 72 integer, dimension(:,:,:), allocatable :: mask_gcm_init ! mask were T S are defined in GCM before interpolation 72 integer, dimension( nbassins):: max_depth_bassin ! max level were T S are defined for every bassins73 integer, dimension(:), allocatable :: max_depth_bassin ! max level were T S are defined for every bassins 73 74 integer :: nmax ! to avoid inifite loop 74 75 integer :: err 75 namelist/bmelt_beckmann_gcm_mod/ TO_file,SO_file,Bassin_file,bmelt_empty76 namelist/bmelt_beckmann_gcm_mod/K_t,TO_file,SO_file,Bassin_file,nbassins,bmelt_empty 76 77 77 78 rewind(num_param) ! loop back at the beginning of the param_list.dat file … … 81 82 write(num_rep_42,bmelt_beckmann_gcm_mod) 82 83 83 K_t = 15.7784 !K_t = 15.77 84 85 85 86 file_inputs=TRIM(DIRNAMEINP)//'Snapshots-GCM/'//TRIM(TO_file) … … 97 98 end if 98 99 end if 100 if (.not.allocated(mask_bassin_vide)) then 101 allocate(mask_bassin_vide(nbassins),stat=err) 102 if (err/=0) then 103 print *,"erreur a l'allocation du tableau mask_bassin_vide",err 104 stop 4 105 end if 106 end if 99 107 if (.not.allocated(temp_ocean)) then 100 108 allocate(temp_ocean(nx,ny,nzoc),stat=err) … … 136 144 if (err/=0) then 137 145 print *,"erreur a l'allocation du tableau mask_gcm_init",err 146 stop 4 147 end if 148 end if 149 if (.not.allocated(max_depth_bassin)) then 150 allocate(max_depth_bassin(nbassins),stat=err) 151 if (err/=0) then 152 print *,"erreur a l'allocation du tableau max_depth_bassin",err 138 153 stop 4 139 154 end if … … 178 193 179 194 depth_max_grid=maxval(depth_max(:,:)) ! max depth were T and S are defined in the grid 180 195 181 196 !$OMP PARALLEL 182 197 if (depth_max_grid.lt.nzoc) then … … 310 325 !temp_ocean(:,:,:) = temp_ocean(:,:,:) - 273.15 311 326 312 coef_OM = K_t * 0.01420418516 327 !coef_OM = K_t * 0.01420418516 328 coef_OM = K_t * row * cpw / (cl * ro) 313 329 314 330 if ( ubound(zoc,dim=1).ne.nzoc) then … … 394 410 do i=1,nx 395 411 if ( TO_draft(i,j) .gt. -9000.d0 ) then ! floating points 396 if (mask_bassin_vide(bassin(i,j)) .or. (bassin(i,j).eq.1)) then ! bassins without any GCM data or bassin 1 412 !if (mask_bassin_vide(bassin(i,j)) .or. (bassin(i,j).eq.1)) then ! bassins without any GCM data or bassin 1 413 !if (mask_bassin_vide(bassin(i,j)) .or. (bassin(i,j).eq.1)) then !bassins without any GCM data 414 if (mask_bassin_vide(bassin(i,j))) then !bassins without any GCM data 397 415 bmelt(i,j) = bmelt_empty 398 416 else ! Bassins with GCM data … … 412 430 ngr=0 413 431 bmloc=0.d0 414 if (TO_draft(i+1,j) .le. -9000.d0 ) then 432 !if (TO_draft(i+1,j) .le. -9000.d0 ) then 433 if (flot(i+1,j)) then 415 434 ngr=ngr+1 416 435 bmloc=bmloc+bmelt(i+1,j) 417 436 endif 418 if (TO_draft(i-1,j) .le. -9000.d0 ) then 437 !if (TO_draft(i-1,j) .le. -9000.d0 ) then 438 if (flot(i-1,j)) then 419 439 ngr=ngr+1 420 440 bmloc=bmloc+bmelt(i-1,j) 421 441 endif 422 if (TO_draft(i,j+1) .le. -9000.d0 ) then 442 !if (TO_draft(i,j+1) .le. -9000.d0 ) then 443 if (flot(i,j+1)) then 423 444 ngr=ngr+1 424 445 bmloc=bmloc+bmelt(i,j+1) 425 446 endif 426 if (TO_draft(i,j-1) .le. -9000.d0 ) then 447 !if (TO_draft(i,j-1) .le. -9000.d0 ) then 448 if (flot(i,j-1)) then 427 449 ngr=ngr+1 428 450 bmloc=bmloc+bmelt(i,j-1) 429 451 endif 452 ngr=0 ! afq -- I do not allow subgrid ocean melt 430 453 bmelt(i,j)=(ngr/4.)*bmloc+(1-ngr/4.)*bmelt(i,j) 431 454 endif
Note: See TracChangeset
for help on using the changeset viewer.