Changeset 452


Ignore:
Timestamp:
12/01/23 15:52:04 (6 months ago)
Author:
aquiquet
Message:

Cleaning branch: unified climat_GrIce2sea_years_perturb with a new name - old version removed

Location:
branches/GRISLIv3/SOURCES
Files:
1 deleted
6 edited
1 moved

Legend:

Unmodified
Added
Removed
  • branches/GRISLIv3/SOURCES/Ant16_files/module_choix-ant16km.f90

    r450 r452  
    4242!use climat_forcage_mois_mod ! forcage mensuel GCM 1 Snapshot Fev 2015 
    4343!use climat_perturb_mod   ! climat perturbe a reverifier Dec 2015 
    44 !use climat_Grice2sea_years_mod  ! climat force par fichier SMB directement (grice2sea) 
    45 !use climat_Grice2sea_years_perturb_mod ! climat force par fichier SMB directement (grice2sea) + index temperature carotte de glace 
     44!use climat_smb_perturb_mod ! climat force par fichier SMB directement (grice2sea) + index temperature carotte de glace 
    4645use climat_InitMIP_years_perturb_mod ! climat pour simules initMIP asmb et abmb 
    4746 
  • branches/GRISLIv3/SOURCES/Ant40_files/module_choix-antar40-0.4.f90

    r450 r452  
    4040!use climat_forcage_mois_mod ! forcage mensuel GCM 1 Snapshot Fev 2015 
    4141!use climat_perturb_mod   ! climat perturbe a reverifier Dec 2015 
    42 !use climat_Grice2sea_years_mod  ! climat force par fichier SMB directement (grice2sea) 
    43 use climat_Grice2sea_years_perturb_mod ! climat force par fichier SMB directement (grice2sea) + index temperature carotte de glace 
     42use climat_smb_perturb_mod ! climat force par fichier SMB directement (grice2sea) + index temperature carotte de glace 
    4443 
    4544 
  • branches/GRISLIv3/SOURCES/Climate_modules/climat_smb_perturb_mod.f90

    r451 r452  
    1 !> \file climat_GrIce2sea_mod.f90 
    2 ! forcage avec BM 
    3 !! Module ou les variations temporelles des variables climatiques 
    4 !! sont directement imposees 
     1!> \file climat_smb_perturb_mod.f90 
     2!! Direct SMB forcing + perturbation with glacial index 
    53!< 
    64 
    7 !> \namespace  climat_Grice2sea_mod 
    8 !! Module ou les variations temporelles des variables climatiques 
    9 !! sont directement imposees 
    10 !! \author Cat 
    11 !! \date 31 oct 
     5!> \namespace  climat_smb_perturb_mod 
     6!! Direct SMB forcing + perturbation with glacial index 
     7!! \author Many 
     8!! \date old 
    129!! @note Used modules: 
    1310!! @note   - use module3D_phy 
    1411!< 
    15 module climat_Grice2sea_years_perturb_mod 
    16  
    17  
    18 use module3d_phy,only: S,S0,H,Bsoc,acc,abl,BM,Tann,Tjuly,Ts,time,dt,num_param,num_rep_42,num_forc,tafor,time,sealevel,sealevel_2d,coefbmshelf 
    19 use geography, only: nx,ny,dirnameinp,dirforcage 
    20 !use lect_climref_Ice2sea 
    21 use netcdf 
    22 use io_netcdf_grisli 
     12module climat_smb_perturb_mod 
     13 
     14use geography, only: nx,ny 
     15 
    2316implicit none 
    2417 
    25  
    2618real :: T_lapse_rate              !< pour la temperature 
    2719 
    28  
    29 ! declarations specifiques year by year 
    30  
    31 real,dimension(:),allocatable        :: time_snap         !> date des snapshots  indice : nb de nb_snap) 
    32 real,dimension(:,:,:),allocatable    :: smb_snap          !> bilan de masse des snapshots indices : nx,ny,nb_snap  
    33 real                                 :: ecart_snap        !> ecart temporel entre les snapshots 
    34 real                                 :: time_depart_snaps !> temps du debut premier snapshot 
    35 integer                              :: nb_snap           !> nombre de snapshots 
    36  
    37 ! declaration pour le bilan de masse 
    3820real,dimension(nx,ny)                :: bm_0              !> bilan de masse initial equ. S_0ref de Tamsin 
    39 real,dimension(nx,ny)                :: bm_time           !> bilan de masse interpole entre 2 snapshots (~ S_t^RCM) 
    40  
    41 ! calcul du gradient 
    42 real,dimension(nx,ny)                :: bm_ref_t          !> bilan de masse de reference au temps t 
    43 real,dimension(nx,ny,10)             :: bm_ref_10         !> tableau des bm_ref pour moyenne 10 ans 
    44 real                                 :: time_prec         !> temps du precedent snapshot 
    45 integer                              :: icum              !> pour le test stockage dans bm_ref_10  
    46 integer                              :: i_moy             !> nombre de snapshots stockes 
    47  
    48 real,dimension(nx,ny)                :: grad_bm           !> gradient du bilan de masse  
    49 real,dimension(nx,ny)                :: S_ref             !> surface de reference 
    50  
    51 real                                 :: grad_N_smb_neg    !> SMB < 0 North 
    52 real                                 :: grad_N_smb_pos    !> SMB >= 0 North 
    53 real                                 :: grad_S_smb_neg    !> SMB < 0 South 
    54 real                                 :: grad_S_smb_pos    !> SMB >= 0 South 
    5521real                                 :: coef_smb_unit     ! pour corriger l'unite 
    56  
    5722real,dimension(nx,ny)                :: TA0               !> Temp annuelle sur S0 
    5823 
     
    7237 
    7338 
    74  
    7539! pour les lectures ncdf 
    7640real*8, dimension(:,:,:),  pointer   :: tab3D             !< tableau 3d real pointer 
     
    8145 
    8246integer                              :: massb_time        !< pour selectionner le type de calcul de smb 
    83 ! On a deux routines : celle avec un seul fichier (donnees observees) : massb_Ice2sea_fixe 
    84 ! Celle avec le bilan de masse sur plusieurs snapshots (annuels par ex.) entre lesquels on interpole. 
     47 
    8548 
    8649contains 
     
    9457subroutine input_clim   
    9558 
     59  use io_netcdf_grisli, only: read_ncdf_var 
     60  use geography, only: dirnameinp,dirforcage 
     61  use module3d_phy,only: acc,abl,BM,Tann,Tjuly,num_param,num_rep_42,num_forc 
     62 
     63  implicit none 
     64 
    9665  character(len=100) :: smb_file           ! fichier smb 
    9766  character(len=100) :: temp_annual_file   ! temperature annuelles 
     
    10675 
    10776  namelist/clim_smb_T_gen/smb_file,coef_smb_unit,temp_annual_file 
    108   namelist/clim_snap/nb_snap,time_depart_snaps,ecart_snap,file_smb_snap,massb_time 
    10977 
    11078  rewind(num_param)                     ! pour revenir au debut du fichier param_list.dat 
     
    134102  !   bm(:,:) = -0.1 
    135103  !end where 
    136 !cdc test debug Hemin15 et Greeneem15 
    137 !  where (bm(:,:).lt.-1000) bm(:,:)=0. 
    138104  where (bm(:,:).eq.0) bm(:,:)=-5. !afq 
    139105   
     
    154120  call Read_Ncdf_var('Tann',temp_annual_file,tab) 
    155121  Tann(:,:)  = tab(:,:) 
    156 !  call lect_input(3,'Tann',1,Tann,temp_annual_file,trim(dirnameinp)//trim(runname)//'.nc') 
    157  
    158 !cdc test debug Hemin15 
    159 !  where (Tann(:,:).lt.-100.) Tann(:,:)=10. 
    160   where (Tann(:,:).lt.-100.) Tann(:,:)=10. !afq 
     122 
     123  where (Tann(:,:).lt.-100.) Tann(:,:)=10. 
    161124 
    162125  ta0(:,:)   = Tann(:,:) 
    163126  Tjuly(:,:) = Tann(:,:) 
    164  
    165   rewind(num_param)                     ! pour revenir au debut du fichier param_list.dat 
    166   read(num_param,clim_snap) 
    167  
    168   write(num_rep_42,'(A)')'!  module climat_Grice2sea_years_perturb_mod                            ' 
    169   write(num_rep_42,clim_snap) 
    170   write(num_rep_42,'(A)')'! nb_snap           = nombre de snapshots                               ' 
    171   write(num_rep_42,'(A)')'! time_depart_snaps = debut du forçage                                  ' 
    172   write(num_rep_42,'(A)')'! ecart_snap        = ecart entre les snapshots                         ' 
    173   write(num_rep_42,'(A)')'! file_smb_snap     = fichier serie temp anomalie SMB de GCM            ' 
    174   write(num_rep_42,'(A)')'! massb_time        = 0:fixe, 1:interp snapshots, 2:snapsh+interp vert  ' 
    175   write(num_rep_42,'(A)')'!_______________________________________________________________________'  
    176  
    177   if (massb_time == 1) then ! lecture des snapshots 
    178 ! allocation dynamique de time_snap 
    179      if (allocated(time_snap)) then  
    180         deallocate(time_snap,stat=err) 
    181         if (err/=0) then 
    182            print *,"Erreur à la desallocation de time_snap",err 
    183            stop  
    184         end if 
    185      end if 
    186  
    187      allocate(time_snap(nb_snap),stat=err) 
    188      if (err/=0) then 
    189         print *,"erreur a l'allocation du tableau time_snap ",err 
    190         print *,"nb_snap = ",nb_snap 
    191         stop  
    192      end if 
    193  
    194 ! remplissage de time_snap 
    195 !write(6,*) 'time_snap' 
    196      do i=1,nb_snap 
    197         time_snap(i) = time_depart_snaps + ecart_snap * (i-1) 
    198 !   write(6,*) i,time_snap(i) 
    199      end do 
    200  
    201 ! allocation dynamique de smb_snap 
    202      if (allocated(smb_snap)) then  
    203         deallocate(smb_snap,stat=err) 
    204         if (err/=0) then 
    205            print *,"Erreur à la desallocation de smb_snap",err 
    206            stop  
    207         end if 
    208      end if 
    209  
    210      allocate(smb_snap(nx,ny,nb_snap),stat=err) 
    211      if (err/=0) then 
    212         print *,"erreur a l'allocation du tableau smb_snap ",err 
    213         print *,"nx,ny,nb_snap = ",nx,',',ny,',',nb_snap 
    214         stop  
    215      end if 
    216  
    217 ! lecture de smb_snap 
    218      file_smb_snap  = trim(dirnameinp)//trim(file_smb_snap) 
    219      call Read_Ncdf_var('z',file_smb_snap,tab3D) 
    220      smb_snap (:,:,:) = Tab3D(:,:,:) * coef_smb_unit 
    221  
    222 ! ce sont des anomalies : ajoute les valeurs de reference 
    223      do k = 1,nb_snap 
    224         do j = 1,ny 
    225            do i = 1,nx 
    226               smb_snap (i,j,k) = smb_snap(i,j,k) + bm(i,j) 
    227            end do 
    228         end do 
    229      end do 
    230  
    231 ! copie la valeur de reference dans bm_0 
    232 !     bm_0(:,:) = bm(:,:) 
    233   endif 
    234 ! copie la valeur de reference dans bm_0 
    235   bm_0(:,:) = bm(:,:) !afq marion dufresne: we do it even if we don't read any snapshot 
     127  bm_0(:,:) = bm(:,:) 
    236128   
    237129  filin=trim(dirforcage)//trim(filforc) 
     
    296188  bpert(:)=max(1.+bpert(:)*coefbmb,0.01) !freezing is not allowed 
    297189 
    298   if (massb_time == 1) then ! lecture gradients smb 
    299      call init_grad_smb 
    300   endif 
    301     
    302190end subroutine input_clim 
    303191 
     
    308196subroutine init_forclim 
    309197 
     198  use module3d_phy,only: num_param,num_rep_42 
     199 
    310200  implicit none 
    311201  namelist/lapse_rates/T_lapse_rate 
     
    318208  write(num_rep_42,lapse_rates) 
    319209  write(num_rep_42,'(A)')'!T_lapse_rate       = lapse rate temp annuelle                   ' 
    320   write(num_rep_42,'(A)')'!________________________________________________________________'  
    321  
    322    
     210  write(num_rep_42,'(A)')'!________________________________________________________________' 
     211 
     212 
    323213  rewind(num_param)   
    324214  read(num_param,clim_pert_massb) 
     
    348238subroutine forclim               !  au temps considere (time)  
    349239 
     240  use module3d_phy,only: tafor,time,sealevel,sealevel_2d,coefbmshelf,acc,abl,BM,Tann,Tjuly,S,S0,Ts,time 
     241 
    350242  implicit none 
    351243 
    352244  integer i,ift 
    353245 
    354   select case (massb_time) 
    355      case(0) 
    356         ! smb fixe et Tann avec lapse rate + Tafor 
     246  ! smb fixe et Tann avec lapse rate + Tafor 
    357247         
    358         if(time.lt.tdate(1)) then 
    359            tafor=tpert(1) 
    360            sealevel=spert(1) 
    361            coefbmshelf=bpert(1) 
    362            ift=1 
    363  
    364         else if (time.ge.tdate(nft)) then 
    365            tafor=tpert(nft) 
    366            sealevel=spert(nft) 
    367            coefbmshelf=bpert(nft) 
    368            ift=nft 
     248  if(time.lt.tdate(1)) then 
     249     tafor=tpert(1) 
     250     sealevel=spert(1) 
     251     coefbmshelf=bpert(1) 
     252     ift=1 
     253 
     254  else if (time.ge.tdate(nft)) then 
     255     tafor=tpert(nft) 
     256     sealevel=spert(nft) 
     257     coefbmshelf=bpert(nft) 
     258     ift=nft 
    369259            
    370         else 
    371            do i=1,nft-1 
    372               if((time.ge.tdate(i)).and.(time.lt.tdate(i+1))) then ! entre i et i+1 : cas general 
    373                  tafor=tpert(i)+(tpert(i+1)-tpert(i))*       & 
    374                       (time-tdate(i))/(tdate(i+1)-tdate(i)) 
    375                  sealevel=spert(i)+(spert(i+1)-spert(i))*    & 
    376                       (time-tdate(i))/(tdate(i+1)-tdate(i)) 
    377                  coefbmshelf=bpert(i)+(bpert(i+1)-bpert(i))*    & 
    378                       (time-tdate(i))/(tdate(i+1)-tdate(i)) 
    379                  ift=i 
    380                  goto 100 
    381               endif 
    382            end do 
     260  else 
     261     do i=1,nft-1 
     262        if((time.ge.tdate(i)).and.(time.lt.tdate(i+1))) then ! entre i et i+1 : cas general 
     263           tafor=tpert(i)+(tpert(i+1)-tpert(i))*       & 
     264                (time-tdate(i))/(tdate(i+1)-tdate(i)) 
     265           sealevel=spert(i)+(spert(i+1)-spert(i))*    & 
     266                (time-tdate(i))/(tdate(i+1)-tdate(i)) 
     267           coefbmshelf=bpert(i)+(bpert(i+1)-bpert(i))*    & 
     268                (time-tdate(i))/(tdate(i+1)-tdate(i)) 
     269           ift=i 
     270           goto 100 
    383271        endif 
    384 100     continue 
    385  
    386         sealevel_2d(:,:) = sealevel 
    387  
    388         Tann (:,:) = Ta0 (:,:) + T_lapse_rate * (S(:,:)-S0(:,:)) +Tafor 
    389         Ts(:,:)    = Tann(:,:) 
    390  
    391         ! aurel marion dufresne: we might want to decrease the SMB during glacials..? 
    392         if (pertsmb.eq.1) then 
    393            bm(:,:) = bm_0(:,:) * exp( rapsmb *(Tann(:,:)-Ta0(:,:))) 
    394            if (Tafor.lt.0.) then 
    395               where(bm(:,:).lt.0.) bm(:,:)=min(bm(:,:)-Tafor*0.05,1.) !10 degrees less give 0.5 meter more ? 
    396            end if 
    397         end if 
    398  
    399         !afq -- as in Pollard and Deconto, melt is more efficient at high temperature... -> 
    400         if (coefbmshelf.gt.1.) then 
    401            coefbmshelf = 1. + ( coefbmshelf - 1. ) * 1.5 !afq.... tuning for the degla?... 
    402         end if 
     272     end do 
     273  endif 
     274100 continue 
     275 
     276  sealevel_2d(:,:) = sealevel 
     277 
     278  Tann (:,:) = Ta0 (:,:) + T_lapse_rate * (S(:,:)-S0(:,:)) +Tafor 
     279  Tjuly(:,:) = Tann(:,:) 
     280  Ts(:,:)    = Tann(:,:) 
     281 
     282  ! aurel marion dufresne: we might want to decrease the SMB during glacials..? 
     283  if (pertsmb.eq.1) then 
     284     bm(:,:) = bm_0(:,:) * exp( rapsmb *(Tann(:,:)-Ta0(:,:))) 
     285     if (Tafor.lt.0.) then 
     286        where(bm(:,:).lt.0.) bm(:,:)=min(bm(:,:)-Tafor*0.05,1.) !10 degrees less give 0.5 meter more ? 
     287     end if 
     288  end if 
     289 
     290  !afq -- as in Pollard and Deconto, melt is more efficient at high temperature... -> 
     291  if (coefbmshelf.gt.1.) then 
     292     coefbmshelf = 1. + ( coefbmshelf - 1. ) * 1.5 !afq.... tuning for the degla?... 
     293  end if 
    403294         
    404295!afq --old:        ! coefmshelf est un coefficient qui fait varier bmgrz et bmshelf en fonction de tafor 
     
    406297!afq --old:        coefbmshelf=max(coefbmshelf,0.)   
    407298!afq --old:        coefbmshelf=min(coefbmshelf,2.) 
    408          
    409 !        coefbmshelf=1.  !afq for calibration Greenland 
    410    
    411      case(1) 
    412         call massb_Ice2sea_RCM 
    413      case default 
    414         print *, 'Numero de massb invalide dans climat_Grice2sea_years_mod' 
    415         stop 
    416      end select 
     299   
     300  where (bm(:,:).gt.0.) 
     301     acc(:,:) = bm(:,:)   ! accumulation quand positif 
     302  elsewhere 
     303     abl(:,:) = - bm(:,:) ! ablation quand negatif 
     304  end where 
     305 
    417306end subroutine forclim 
    418307 
    419308 
    420 subroutine massb_Ice2sea_RCM                ! calcule le mass balance  
    421  
    422   implicit none 
    423   integer             :: k_snap               ! pour calculer les indices de temps 
    424   integer             :: k 
    425  
    426 ! calcul smb a partir fichier snapshots massb_Ice2sea_RCM 
    427 ! Calcule le mass balance d'apres un fichier de snapshots 
    428 ! avec la temperature parametree 
    429 !     surface temperature et accumulation 
    430   Tann (:,:) = Ta0 (:,:) + T_lapse_rate * (S(:,:)-S0(:,:))  
    431   Ts(:,:)    = Tann(:,:) 
    432 ! calcule bm_time par interpolation entre deux snapshots 
    433 ! avant prend la valeur de reference 
    434 ! apres prend la derniere valeur 
    435 ! en general les snapshots vont de 2000 a 2200 
    436   if(time.lt.time_snap(1)) then              ! time avant le forcage 
    437      bm_time(:,:) = bm_0(:,:) 
    438      k_snap       = 1 
    439      S_ref(:,:)   = S(:,:)                   ! du coup sera la surface de reference avant le forcage 
    440      icum         = 0 
    441      i_moy        = 0 
    442      bm_ref_t(:,:)=  bm_0(:,:)               ! bilan de masse de reference 
    443      time_prec    = time 
    444   else if (time.ge.time_snap(nb_snap)) then  ! time apres le forcage 
    445      k_snap       = nb_snap 
    446      bm_time(:,:) =  smb_snap (:,:,k_snap) 
    447      if (abs(time-time_prec-1.).lt.dt) then   !  
    448         time_prec = time_prec + 1 
    449         icum      = 1 
    450      else 
    451         icum      = 0 
    452      endif 
    453   else                                       ! cas general 
    454      do k = 1 , nb_snap-1 
    455         if((time.ge.time_snap(k)).and.(time.lt.time_snap(k+1))) then ! entre k et k+1  
    456            bm_time(:,:) = smb_snap(:,:,k)+(smb_snap(:,:,k+1)-smb_snap(:,:,k)) *   & 
    457                 (time-time_snap(k))/(time_snap(k+1)-time_snap(k)) 
    458 ! exactement sur le snapshot et avec un ecart 1 an par rapport au precedent stockage 
    459 !           write(6,*) 'time,tests',k,time,time-time_snap(k),time-time_prec-1. 
    460            if ((abs(time-time_snap(k)).le.dt).and.(abs(time-time_prec-1.).lt.dt)) then     
    461               k_snap    = k 
    462               icum      = 1 
    463               time_prec = time_snap(k)     ! time_prec est le temps du precedent 
    464                                                  ! snapshot garde 
    465            else 
    466               icum    = 0 
    467            endif 
    468            exit 
    469         endif 
    470      end do 
    471   endif 
    472   call  grad_smb              !-----------------------------> A faire 
    473  
    474   if (massb_time == 1) then ! pas d'interpolation verticale 
    475      bm(:,:) = bm_time(:,:) 
    476   else if (massb_time == 2) then ! interpolation verticale 
    477      ! ajuste bm en fonction du temps et du gradient 
    478      bm(:,:) = bm_time(:,:) + grad_bm(:,:) *(S(:,:) - S_ref(:,:)) 
    479      write(6,897) time, time_prec, icum, i_moy 
    480 897  format('test temps smb   ',2(f0.3,1x),2(i0,1x)) 
    481   endif 
    482  
    483 ! garde les 10 dernieres annees et calcule la moyenne 
    484   if (icum.eq.1) then                           ! stockage dans le tableau bm_ref_10 
    485      do k = 9,1,-1 
    486         bm_ref_10(:,:,k+1) = bm_ref_10(:,:,k)   ! on decale tous les elements 
    487      end do 
    488      bm_ref_10(:,:,k+1) = bm(:,:)               ! le plus recent est en position 1 
    489      i_moy              = i_moy +1              ! compte combien il y en a pour la moyenne 
    490      i_moy              = min(i_moy,10) 
    491      bm_ref_t(:,:)   = 0. 
    492      do k = 1,i_moy 
    493         bm_ref_t(:,:) = bm_ref_t(:,:) + bm_ref_10(:,:,k) 
    494      end do 
    495      bm_ref_t(:,:)    = bm_ref_t(:,:)/i_moy 
    496      write(6,898) time, time_prec, icum, i_moy 
    497 898  format('cumul pour gradient  ',2(f0.3,1x),2(i0,1x)) 
    498   end if 
    499 end subroutine massb_Ice2sea_RCM 
    500   
    501 !------------------------------------------------------------------------------ 
    502 !> initialise le calcul du gradient vertical de smb 
    503 subroutine init_grad_smb  
    504  
    505   use module3D_phy 
    506   implicit none 
    507  
    508   character(len=120)       ::  file_grad_smb ! nom du fichier gradients de Tamsin 
    509   character(len=40)        ::  fin_ligne     ! fin de la ligne 
    510   real                     ::  grad 
    511  
    512   namelist/grad_smb/file_grad_smb 
    513  
    514 ! Dans lequel sont : 
    515 ! grad_N_smb_pos,grad_N_smb_neg,grad_S_smb_pos,grad_S_smb_neg,lim_lat 
    516  
    517   rewind(num_param)        ! pour revenir au debut du fichier param_list.dat 
    518   read(num_param,grad_smb) 
    519  
    520  
    521 ! formats pour les ecritures dans 42 
    522 428 format(A) 
    523  
    524   rewind(num_param)                     ! pour revenir au debut du fichier param_list.dat 
    525   read(num_param,grad_smb) 
    526  
    527   write(num_rep_42,428)'!________________________________________________________________'  
    528   write(num_rep_42,428)'!  gradient smb climat_Grice2sea_years_mod                       ' 
    529   write(num_rep_42,grad_smb) 
    530   write(num_rep_42,428)'!grad_smb       = fichier gradient SMB                           ' 
    531   write(num_rep_42,428)'!________________________________________________________________'  
    532  
    533  
    534   file_grad_smb=trim(dirnameinp)//'SMB-H-Feedback/gradients_18_07_2012/'//trim(file_grad_smb) 
    535   open(622,file=file_grad_smb) 
    536   do i=1,4 
    537      read(622,'(f9.4,A)') grad,fin_ligne 
    538      write(6,*) grad,fin_ligne 
    539  
    540      if (index(fin_ligne, "North").ne.0) then       ! North est dans la ligne 
    541         if (index(fin_ligne, "<").ne.0)  then       ! smb negatif 
    542            grad_N_smb_neg = grad 
    543         else if (index(fin_ligne, ">=").ne.0) then  ! smb positif 
    544            grad_N_smb_pos = grad 
    545         else 
    546            write(6,*) 'probleme lecture North fichier smb', file_grad_smb 
    547            STOP 
    548         end if 
    549  
    550      else if (index(fin_ligne, "South").ne.0) then   !South est dans la ligne 
    551         if (index(fin_ligne, "<").ne.0)  then        ! smb negatif 
    552            grad_S_smb_neg = grad 
    553         else if (index(fin_ligne, ">=").ne.0) then   ! smb positif 
    554            grad_S_smb_pos = grad 
    555         else 
    556            write(6,*) 'probleme lecture South fichier smb  ', file_grad_smb 
    557            STOP 
    558         end if 
    559  
    560      else  
    561         write(6,*) 'probleme lecture ni North ni South fichier smb  ', file_grad_smb 
    562         write(6,*) 'fin_ligne',fin_ligne,'   index North', index(fin_ligne, "North"),'   index South', index(fin_ligne, "South") 
    563         STOP 
    564      end if 
    565   end do 
    566  
    567   write(6,*) 'coefficients lus ' 
    568   write(6,*) 'grad_N_smb_pos', grad_N_smb_pos 
    569   write(6,*) 'grad_N_smb_neg', grad_N_smb_neg 
    570   write(6,*) 'grad_S_smb_pos', grad_S_smb_pos 
    571   write(6,*) 'grad_S_smb_neg', grad_S_smb_neg 
    572  
    573   grad_N_smb_pos = coef_smb_unit * grad_N_smb_pos 
    574   grad_N_smb_neg = coef_smb_unit * grad_N_smb_neg 
    575   grad_S_smb_pos = coef_smb_unit * grad_S_smb_pos 
    576   grad_S_smb_neg = coef_smb_unit * grad_S_smb_neg 
    577  
    578   write(6,*) 'coefficients *coef_smb_unit ' 
    579   write(6,*) 'grad_N_smb_pos', grad_N_smb_pos 
    580   write(6,*) 'grad_N_smb_neg', grad_N_smb_neg 
    581   write(6,*) 'grad_S_smb_pos', grad_S_smb_pos 
    582   write(6,*) 'grad_S_smb_neg', grad_S_smb_neg 
    583  
    584  
    585 end subroutine init_grad_smb 
    586  
    587  
    588 !------------------------------------------------------------------------------ 
    589 !> Calcule le gradient vertical de smb 
    590  
    591 subroutine grad_smb  
    592  
    593   use module3D_phy 
    594   implicit none 
    595  
    596   do j = 1,ny 
    597      do i = 1,nx 
    598         if (Ylat(i,j).gt.77.) then                     ! region nord 
    599            if (bm_ref_t(i,j).lt. 0.) then              ! smb negatif 
    600               grad_bm (i,j) = grad_N_smb_neg 
    601  
    602            else if (bm_ref_t(i,j).ge. 0.) then         ! smb positif 
    603               grad_bm (i,j) = grad_N_smb_pos  
    604  
    605            end if 
    606  
    607         else if (Ylat(i,j).le.77.) then                ! region sud 
    608            if (bm_ref_t(i,j).lt. 0.) then              ! smb negatif 
    609               grad_bm (i,j) = grad_S_smb_neg 
    610  
    611            else if (bm_ref_t(i,j).ge. 0.) then         ! smb positif 
    612               grad_bm (i,j) = grad_S_smb_pos  
    613  
    614            end if 
    615         end if 
    616      end do 
    617   end do 
    618  
    619 end subroutine grad_smb 
    620  
    621 end module  climat_Grice2sea_years_perturb_mod 
     309end module  climat_smb_perturb_mod 
  • branches/GRISLIv3/SOURCES/GrIce2sea_files/module_choix_GrIce2sea.f90

    r450 r452  
    6161!use climat_Grice2sea_mod    ! pour les experiences ice2sea 
    6262 
    63 use climat_Grice2sea_years_mod 
     63use climat_smb_perturb_mod 
    6464 
    6565! calcul de l'ablation 
  • branches/GRISLIv3/SOURCES/Grismip6_files/module_choix-grismip6.f90

    r450 r452  
    4343!use climat_forcage_mois_mod ! forcage mensuel GCM 1 Snapshot Fev 2015 
    4444!use climat_perturb_mod   ! climat perturbe a reverifier Dec 2015 
    45 use climat_Grice2sea_years_mod  ! climat force par fichier SMB directement (grice2sea) 
    46 !use climat_Grice2sea_years_perturb_mod ! climat force par fichier SMB directement (grice2sea) + index temperature carotte de glace 
     45use climat_smb_perturb_mod ! climat force par fichier SMB directement (grice2sea) + index temperature carotte de glace 
    4746!use climat_InitMIP_years_perturb_mod ! climat pour experiences initMIP 
    4847 
  • branches/GRISLIv3/SOURCES/Hemin40_files/module_choix-hemin40-0.4.f90

    r450 r452  
    4545!--------------Module climat --------------- 
    4646!use climat_forcage_mois_mod ! forcage mensuel GCM 1 Snapshot Fev 2015 
    47 !use climat_Grice2sea_years_mod ! forcage avec SMB type MAR Fev2015 
    48 !use climat_Grice2sea_years_perturb_mod ! forcage avec SMB type MAR + perturbation temperature 
     47!use climat_smb_perturb_mod ! forcage avec SMB type MAR + perturbation temperature 
    4948use climat_forcage_mod 
    5049 
  • branches/GRISLIv3/SOURCES/Makefile.grisli.inc

    r451 r452  
    3535# module de forcage climatique C. Dumas 
    3636mod_clim_tof = climat-forcage-insolation_mod_oneway.o climat-forcage-insolation_mod.o \ 
    37   climat_GrIce2sea_years_mod.o climat_GrIce2sea_years_perturb_mod.o \ 
     37        climat_smb_perturb_mod.o \ 
    3838        climat_InitMIP_years_perturb_mod.o \ 
    3939        climat-perturb_mod-0.4.o climat_forcage_mod.o climat_transient_GCM_mod.o \ 
Note: See TracChangeset for help on using the changeset viewer.