Changeset 54


Ignore:
Timestamp:
03/31/16 11:01:50 (8 years ago)
Author:
aquiquet
Message:

Tracers back in the code / use notracer unchanged

Location:
trunk/SOURCES
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/SOURCES/Makefile.grisli-gfortran.inc

    r51 r54  
    726726 
    727727beta_iter_vitbil_mod.o : Draggings_modules/beta_iter_vitbil_mod.f90 
    728         $(FT)  Draggings_modules/beta_iter_vitbil_mod.f90 
     728        $(F_NETCDF)  Draggings_modules/beta_iter_vitbil_mod.f90 
    729729 
    730730dragging_stream_impose_vitbil_mod.o : Ant40_files/dragging_stream_impose_vitbil_mod.f90 
     
    15871587        $(diagnoshelf) \ 
    15881588        $(Liste_Netcdf) \ 
    1589         $(routines_communes) steps_time_loop.o $(routine_elliptiques)  
     1589        $(routines_communes) steps_time_loop.o $(routine_elliptiques)  \ 
     1590        $(Liste_BLAS) 
    15901591 
    15911592        $(LK) -o ../bin/Grice2sea \ 
     
    15991600        $(Liste_Netcdf) \ 
    16001601        $(routines_communes) steps_time_loop.o \ 
    1601         $(routine_elliptiques) $(NCDF_LIB)  $(MKL_LIB) 
     1602        $(routine_elliptiques) \ 
     1603        $(Liste_BLAS) 
     1604        $(NCDF_LIB)  $(MKL_LIB) 
    16021605 
    16031606Grice2sea_iterbeta : $(Dim_GrIce2sea) $(mod_dim_communs)   \ 
     
    16281631        $(mod_communs) \ 
    16291632        $(mod_clim_tof) \ 
    1630         $(mod_no_tracers) \ 
     1633        $(mod_tracers) \ 
    16311634        $(mod_ell) $(Liste_hemin40) \ 
    16321635        $(diagnoshelf) \ 
     
    16411644        $(mod_communs) \ 
    16421645        $(mod_clim_tof) \ 
    1643         $(mod_no_tracers) \ 
     1646        $(mod_tracers) \ 
    16441647        $(mod_ell) $(Liste_hemin40) \ 
    16451648        $(diagnoshelf) \ 
  • trunk/SOURCES/Makefile.grisli.inc

    r51 r54  
    16351635        $(mod_communs) \ 
    16361636        $(mod_clim_tof) \ 
    1637         $(mod_no_tracers) \ 
     1637        $(mod_tracers) \ 
    16381638        $(mod_ell) $(Liste_hemin40) \ 
    16391639        $(diagnoshelf) \ 
     
    16481648        $(mod_communs) \ 
    16491649        $(mod_clim_tof) \ 
    1650         $(mod_no_tracers) \ 
     1650        $(mod_tracers) \ 
    16511651        $(mod_ell) $(Liste_hemin40) \ 
    16521652        $(diagnoshelf) \ 
  • trunk/SOURCES/tracer_mod.f90

    r11 r54  
    66!-------------------------------------------------------------- 
    77! Position des forages dans la grille grisli. 
     8! Groenland grille GreeneemXX 
    89! 
    910! Ordre GMT :  
     
    2930  use tracer_vars             ! module de declaration de variables pour les traceurs 
    3031!cdc  use climat_perturb_mois_mod ! on en a besoin, notamment pour NFT 
    31  
     32! afq, new version of tracer, does not require climat_perturb 
     33   
    3234  implicit none 
    3335 
     
    5153  integer :: time_tra    ! temps traceur 
    5254 
    53   integer :: nft         ! declaration locale de NFT : a corriger plus tard pour recuperer la valeur du module climat 
    54   real    :: rappact     ! pour le calcul du rapport 'accumulation : a corriger plus tard pour recuperer la valeur du module climat 
    55   real,dimension(:),allocatable :: tpert ! temperature for climate forcing : a corriger plus tard pour recuperer la valeur du module climat 
    56   real,dimension(:),allocatable :: TDATE ! time for climate forcing : a corriger plus tard pour recuperer la valeur du module climat 
    57  
    5855 
    5956!=============================================================== 
     
    6966  real :: lambdab  ! fusion basale 'artificielle' pour age des couches  
    7067  real :: agemax   ! age maximum de la glace (pour init_tracer) 
    71   
     68 
     69  integer :: pert_type ! 0 we give tpert/coeft/rappact,1 we give acc_pert only / afq 
     70  character(len=200) :: filforc    ! nom du fichier forcage 
     71  character(len=200) :: filin      ! variable intermediaire 
     72  character(len=8) :: control      ! label to check clim. forc. file (filin) is usable 
     73  integer ::  err                  ! pour l'allocation des tableaux 
     74  real :: bidon                    ! to skip sealevel change in fileforc 
     75   
    7276  integer :: kk   ! indice vertical pour definition de E, mais on veut conserver la valeur de k 
    7377!  real,dimension(nz) :: E   ! vertical coordinate in ice, scaled to H zeta 
     78 
     79  ! on lit les parametres par namelist dorenavant 
     80  namelist/tracer/file_tr_dat,file_tr_out,file_tr_dep,lambdab,agemax,coefT_tra,rappact_tra,filforc,pert_type  
    7481 
    7582 
     
    93100  deltracer = dtt           ! sorte de pas de temps du tracer -  multiple de dtt ! 
    94101 
    95  
    96 ! on lit les parametres par namelist dorenavant 
    97   namelist/tracer/file_tr_dat,file_tr_out,file_tr_dep,lambdab,agemax !aurel : a ne pas oublier paramlist 
    98102 
    99103  rewind(num_param)        ! pour revenir au debut du fichier param_list.dat 
     
    111115  write(num_rep_42,'(A,A)')   'tracer .out file : ', file_tr_out 
    112116  write(num_rep_42,'(A,A)')   'tracer dep. file : ', file_tr_dep 
     117  write(num_rep_42,'(A,A)')   'lambdab : ', lambdab 
     118  write(num_rep_42,'(A,A)')   'agemax : ', agemax 
     119  write(num_rep_42,'(A,A)')   'coefT_tra : ', coefT_tra 
     120  write(num_rep_42,'(A,A)')   'rappact_tra : ', rappact_tra 
     121  write(num_rep_42,'(A,A)')   'fileforc : ', filforc 
     122  write(num_rep_42,'(A,A)')   'pert_type : ', pert_type 
    113123  write(num_rep_42,*)'/'                       
    114124  write(num_rep_42,428) 'declaration des repertoires *traceurs*' 
     
    202212 
    203213 
     214  ! afq marion dufresne: 
     215  ! to build accucumul, we read all what is in climat_perturb here now 
     216  ! meaning: nft, tpert, tdate 
     217  ! OR if pert_type = 1 we read nft, acc_pert, tdate 
     218  ! acc_pert should be the ratio acc_palaeo / acc_present 
     219   
     220    filin=trim(dirforcage)//trim(filforc) 
     221 
     222    open(num_forc,file=filin,status='old') 
     223 
     224    read(num_forc,*) control,nft_tra 
     225 
     226    ! Determination of file size (line nb), allocation of perturbation array 
     227    if (control.ne.'nb_lines') then 
     228       write(6,*) filin,'indiquer le nb de ligne en debut de fichier:' 
     229       write(6,*) 'le nb de lignes et le label de control nb_lines' 
     230       stop 
     231    endif 
     232    if (.not.allocated(tdate_tra)) then 
     233       allocate(tdate_tra(nft_tra),stat=err) 
     234       if (err/=0) then 
     235          print *,"erreur a l'allocation du tableau Tdate",err 
     236          stop 4 
     237       end if 
     238    end if 
     239    if (.not.allocated(tpert_tra)) then 
     240       allocate(tpert_tra(nft_tra),stat=err) 
     241       if (err/=0) then 
     242          print *,"erreur a l'allocation du tableau Tpert",err 
     243          stop 4 
     244       end if 
     245    end if 
     246 
     247    do i=1,nft_tra 
     248       read(num_forc,*) tdate_tra(i),bidon,tpert_tra(i) 
     249    end do 
     250    close(num_forc) 
     251 
     252   
    204253 2009 format(21(f12.1)) 
    205254    
     
    209258  ! chaque indice d'accucumul vaut 100 ans. 
    210259  ! 0 pour le present, 10 pour 1000 ans 
    211    allocate(accucumul(0:nft-1)); accucumul = 0.0 
     260   allocate(accucumul(0:nft_tra-1)); accucumul = 0.0 
    212261   ! watch out its size !!! 
    213262   ! note: tpert(1) = tpert at -422700yr 
     
    217266   ! a la rigueur je pourrais modifier le fichier d'interpolation pour  
    218267   ! l'adapter a tdate 
    219    accucumul(nft-1) =  0. 
    220  
    221 ! todo0710 : marge d'amelioration en tenant compte des accum de depot ?   
    222    do k=2,nft 
    223       accucumul(nft-k) = accucumul(nft-k+1) + (exp(rappact  * tpert(k) )) 
    224    end do 
    225          
    226    time_max_accu = tdate(1) 
    227    !print*, tdate(1), nft , nftnl, rappact 
    228    !print*, tdate(1), nft , rappact!, nftnl, rappact 
     268   accucumul(nft_tra-1) =  0. 
     269 
     270   ! todo0710 : marge d'amelioration en tenant compte des accum de depot ? 
     271 
     272   if (type_accum.eq.0) then   !Tpert is given, needs to be converted in accumulation ratio 
     273      tpert_tra(:)=tpert_tra(:)*coefT_tra 
     274      do k=2,nft_tra 
     275         accucumul(nft_tra-k) = accucumul(nft_tra-k+1) + (exp(rappact_tra  * tpert_tra(k) )) 
     276      end do 
     277   else if (type_accum.eq.1) then ! accum ration is given, nothing to do 
     278      do k=2,nft_tra 
     279         accucumul(nft_tra-k) = accucumul(nft_tra-k+1) + tpert_tra(k) 
     280      end do 
     281   else 
     282      write (*,*) "Problem in tracer, do you provide tpert or accpert???" 
     283      STOP 
     284   end if 
     285   time_max_accu = tdate_tra(1) 
    229286   uxsave(:,:,:) = 0.0 
    230287   uysave(:,:,:) = 0.0 
     
    233290   ydep(:,:,:)=ydepk(:,:,:) 
    234291   tdep(:,:,:)=tdepk(:,:,:) 
    235    freezeon(:,:) = 0.   ! variable added on 19/03/03 
    236  
    237 !   print*, 'tpert ',tpert(:) 
    238 !   print*, 'accucumul ', accucumul(:) 
     292   freezeon(:,:) = 0.     ! variable added on 19/03/03 
     293 
    239294   print*, 'tbegin, tend : ',tbegin, tend 
    240295 
     
    266321        do i=1,nx 
    267322           ! added on 16/12/03: somehow worked before too 
    268            if (h(i,j)>1.5) &     
    269                 uzrsave(i,j,:) = uzrsave(i,j,:) + uzr(i,j,:) *real(dtt) / h(i,j) 
     323           if (h(i,j)>1.5) & 
     324             uzrsave(i,j,:) = uzrsave(i,j,:) + uzr(i,j,:) *real(dtt) / h(i,j) 
    270325        end do 
    271326     end do 
     
    288343     do j=2,ny-1 
    289344        i_jj = j-1 
    290         xdep(:,1,i_jj) = xgrid(2) 
     345        xdep(:,1,i_jj) = xgrid(2) 
    291346        xdep(:,nx-2,i_jj) = xgrid(nx-1) 
    292         ydep(:,1,i_jj) = ygrid(j) 
     347        ydep(:,1,i_jj) = ygrid(j) 
    293348        ydep(:,nx-2,i_jj) = ygrid(j) 
    294349!        tdep(:,1,i_jj) = time_ 
     
    300355     do i=2,nx-1 
    301356        i_ij = i-1 
    302         xdep(:,i_ij,1) = xgrid(i) 
     357        xdep(:,i_ij,1) = xgrid(i) 
    303358        xdep(:,i_ij,ny-2) = xgrid(i) 
    304         ydep(:,i_ij,1) = ygrid(2) 
    305         ydep(:,i_ij,ny-2) = ygrid(ny-1) 
     359        ydep(:,i_ij,1) = ygrid(2) 
     360        ydep(:,i_ij,ny-2) = ygrid(ny-1) 
    306361!       tdep(:,i_ij,1) =  time_ 
    307362!       tdep(:,i_ij,ny-2) =  time_ 
    308         tdep(:,i_ij,1) =  time    
    309         tdep(:,i_ij,ny-2) =  time 
     363        tdep(:,i_ij,1) =  time    
     364        tdep(:,i_ij,ny-2) =  time 
    310365     end do 
    311366 
     
    318373 
    319374! nl 11/03/04 
    320           if (h(i,j)<=1.5) then 
     375          if (h(i,j)<=1.5) then 
    321376            xdep(:,i_ij,i_jj) = xgrid(i) 
    322377            ydep(:,i_ij,i_jj) = ygrid(j) 
    323378            tdep(:,i_ij,i_jj) =  time   
    324             cycle 
    325           end if 
     379            cycle 
     380          end if 
    326381          freezeon(i_ij,i_jj) = max(0.0, freezeon(i_ij,i_jj)-bmelt(i,j) ) 
    327            
     382           
    328383          ip = i+1 
    329384          jp = j+1 
     
    333388            v_zij       = uzrsave(i,j,k) 
    334389 
    335             x_tra       = xgrid(i) - v_xij      !* real(deltracer) 
    336             y_tra       = ygrid(j) - v_yij      !* real(deltracer) 
    337             e_tra       = e(k) - v_zij          !* real(deltracer) 
     390            x_tra       = xgrid(i) - v_xij      !* real(deltracer) 
     391            y_tra       = ygrid(j) - v_yij      !* real(deltracer) 
     392            e_tra       = e(k) - v_zij          !* real(deltracer) 
    338393 
    339394            if ((k==nz).and.(bmelt(i,j)<-1.e-4)) then   ! bottom freezeon 
    340395               xdep(k,i_ij,i_jj) = xgrid(i) 
    341396               ydep(k,i_ij,i_jj) = ygrid(j) 
    342                if (h(i,j)>100.) then 
     397               if (h(i,j)>100.) then 
    343398                 tdep(k,i_ij,i_jj) =  tdepk(k,i_ij,i_jj) - & 
    344                         min( abs( (tdepk(k-1,i_ij,i_jj)-tdepk(k,i_ij,i_jj)) *  & 
    345                           bmelt(i,j)  / ( ( e(k)-e(k-1) )*h(i,j) ) ), 2.) * deltracer 
    346                   ! this added 26/03/04 so that not more 2.*deltracer new years of refreezing  
    347                else 
    348                 tdep(k,i_ij,i_jj) =  tdepk(k,i_ij,i_jj) 
     399                        min( abs( (tdepk(k-1,i_ij,i_jj)-tdepk(k,i_ij,i_jj)) *  & 
     400                          bmelt(i,j)  / ( ( e(k)-e(k-1) )*h(i,j) ) ), 2.) * deltracer 
     401                  ! this added 26/03/04 so that not more 2.*deltracer new years of refreezing  
     402               else 
     403                tdep(k,i_ij,i_jj) =  tdepk(k,i_ij,i_jj) 
    349404                  
    350                end if  
     405               end if  
    351406                !fix:    need to track where freeze-on happens 
    352407                ! *1.001        proven to be dumb 
     
    375430                !print*,'i,j,k avt interp',i,j,k 
    376431 
    377                 call interpolate(i_ij, i_jj, k, im-1, jm-1, km, fx,fy,fz, e_tra, nft)  
     432                call interpolate(i_ij, i_jj, k, im-1, jm-1, km, fx,fy,fz, e_tra, nft_tra)  
    378433 
    379434                if((tdep(k,i_ij,i_jj)<=time  -  1500000.) .or. (tdep(k,i_ij,i_jj)> time   )) then 
     
    469524 
    470525 
    471  
    472  
    473  
    474  
    475  
    476526!======================================================================== 
    477527!======================================================================== 
  • trunk/SOURCES/tracer_vars_mod.f90

    r4 r54  
    2525  integer :: nspectimes 
    2626  real :: time_max_accu 
     27 
     28  ! afq marion dufresne: tracer with no climat perturb 
     29  ! i.e. we read the Forcage Tpert to compute past accumulation via 
     30  ! rappact 
     31  ! OR we read directly past accum (choice in namelist) 
     32  ! if past accum is given it will still be read with the name Tpert 
     33  ! the past accum given should be the ratio acc_palaeo / acc_present 
     34  integer :: nft_tra                         ! number of snapshot Tpert 
     35  integer :: type_accum                      ! Tpert is given (=0) or accpert (1) 
     36  real    :: rappact_tra                     ! accumulation ratio to convert Tpert 
     37  real    :: coeft_tra                       ! coeft to convert Tpert 
     38  real,dimension(:),allocatable :: tpert_tra ! temperature perturbation 
     39  real,dimension(:),allocatable :: tdate_tra ! time for Tpert 
     40 
    2741   
    2842  integer, dimension(maxspectimes) :: trout 
Note: See TracChangeset for help on using the changeset viewer.