Changeset 21


Ignore:
Timestamp:
09/17/15 11:24:47 (9 years ago)
Author:
dumas
Message:

correction bug (depassement tableau) dans climat-forcage-insolation_mod.f90

Location:
trunk/SOURCES
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/SOURCES/GrIce2sea_files/module_choix_GrIce2sea.f90

    r11 r21  
    109109! use dragging_vit_bil_CISM_gen 
    110110! use dragging_calc_beta           ! tourne en "no_spinup" qui contient les fake 
    111 use dragging_prescr_beta 
    112 !use beta_iter_vitbil_mod 
     111!use dragging_prescr_beta 
     112use beta_iter_vitbil_mod 
    113113!use dragging_LGM 
    114114!use dragging_plastic_LGM 
  • trunk/SOURCES/climat-forcage-insolation_mod.f90

    r20 r21  
    3535character(len=12) :: interpolation_ice='nonlinear'   !Choose between linear and nonlinear 
    3636integer :: rayon_interpolation_ice=60  !(In km) Choose a multiple of nx. 
     37 
    3738!real :: poids_nb_points=0.5 
    3839!real :: poids_proximity=0.5 
     
    322323      !value, the proximity parameter associated with each point within the 
    323324      !radius of search. 
    324       allocate(maillage_prox(2*grid_int+1,2*grid_int+1),stat=error) 
     325      allocate(maillage_prox(-grid_int:grid_int,-grid_int:grid_int),stat=error) 
    325326      if (error.ne.0) then 
    326327         print *,'error: could not allocate memory for array' 
     
    344345      !of exponential functions. 
    345346!cdc      do k=1,grid_int 
    346          do d2=-grid_int,grid_int 
    347             do d1=-grid_int,grid_int 
    348                distsq=(abs(d1)*(dx/1000.))**2+(abs(d2)*(dx/1000.))**2 
     347      do d2=-grid_int,grid_int 
     348        do d1=-grid_int,grid_int 
     349          distsq=(abs(d1)*(dx/1000.))**2+(abs(d2)*(dx/1000.))**2 
    349350               !print *,'distsq = ',distsq,'real_rayon_ice =',real_rayon_ice 
    350                if ((sqrt(distsq).le.real_rayon_ice).and.((d1/=0).or.(d2/=0))) then 
     351          if ((sqrt(distsq).le.real_rayon_ice).and.((d1/=0).or.(d2/=0))) then 
    351352                  !nb_points_max(k)=nb_points_max(k)+1 
    352353!cdc                  prox_max(k)=prox_max(k)+100*exp(-((-1*log(0.001))/real_rayon_ice)*(sqrt(distsq)))/exp(-((-1*log(0.001))/real_rayon_ice)*(dx/1000.)) 
    353354                  !Indexes displacement to match elements  
    354                   maillage_prox(d1+(k+1),d2+(k+1))=100*exp(-((-1*log(0.001))/real_rayon_ice)*(sqrt(distsq)))/exp(-((-1*log(0.001))/real_rayon_ice)*(dx/1000.)) 
     355              maillage_prox(d1,d2)=100*exp(-((-1*log(0.001))/real_rayon_ice)*(sqrt(distsq)))/exp(-((-1*log(0.001))/real_rayon_ice)*(dx/1000.)) 
    355356                  !print *,'nb_points_max = ',nb_points_max(k),'prox_max = ',prox_max(k),'maillage_prox = ',maillage_prox(k,d1+(k+1),d2+(k+1)) 
    356                endif 
    357             enddo  
    358          enddo 
     357          endif 
     358        enddo 
     359      enddo 
    359360!cdc      enddo 
    360361 
    361       do j=1,ny 
    362          do i=1,nx 
    363             do d2=max(j-grid_int,1),min(j+grid_int,ny) 
    364                do d1=max(i-grid_int,1),min(i+grid_int,nx) 
    365                   distsq=(abs(d1-i)*(dx/1000.))**2+(abs(d2-j)*(dx/1000.))**2 
    366                   if ((sqrt(distsq).le.real_rayon_ice).and.((d1/=0).or.(d2/=0))) then 
    367                      prox_max(i,j)=prox_max(i,j)+100*exp(-((-1*log(0.001))/real_rayon_ice)*(sqrt(distsq)))/exp(-((-1*log(0.001))/real_rayon_ice)*(dx/1000.)) 
    368                   endif 
    369                enddo 
    370             enddo 
    371          enddo 
    372       enddo 
    373       !do k=1,grid_int 
    374       !   print *,'k =',k,'nb_points_max =',nb_points_max(k),'prox_max =',prox_max(k),'maillage_prox =',maillage_prox(k,:,:) 
    375       !enddo 
    376  
     362       
     363      prox_max(:,:)=SUM(maillage_prox(:,:)) 
     364!      PRINT *,'maillage_prox =',maillage_prox(:,:) 
     365!      PRINT*,'sum(maillage_prox)',SUM(maillage_prox(:,:)) 
     366!      PRINT*,'fin calcul maillage prox'  
    377367   end select 
    378368end select 
     
    751741                  if (Mask(i,j).eq.1) then 
    752742                     !print *,'i = ',i,'j = ',j,'Mask = ',Mask(i,j) 
    753                      do m2=max(1,-grid_int),min(grid_int,ny)  !cdc 
    754                         do m1=max(-grid_int,1),min(grid_int,nx)  !cdc 
    755                            Mask2(i+m1,j+m2) = 1. 
     743                     do m2=max(1,j-grid_int),min(j+grid_int,ny)  !cdc 
     744                        do m1=max(i-grid_int,1),min(i+grid_int,nx)  !cdc 
     745                           Mask2(m1,m2) = 1. 
    756746                        end do 
    757747                     end do 
     
    768758                     !Same for the proximity parameter, prox. 
    769759                     !nb_points=0 
    770                      prox=0 
     760!                     prox=0 
    771761                     !Case where indice = 0, on the edges of the grid. 
    772762                     !We actually dont care here because Antarctica is far from the 
     
    839829!                           enddo 
    840830!                        enddo 
     831 
     832!                        maillage_prox_ij(i-grid_int:i+grid_int:1,j-grid_int:j+grid_int:1)=maillage_prox 
     833 
     834 
     835 
    841836                        prox=sum(maillage_prox,mask=Hlarge(i-grid_int:i+grid_int:1,j-grid_int:j+grid_int:1).ge.5) 
    842837                         
     
    852847                        !coeff1(i,j)=nb_points/nb_points_max(indice(i,j)) 
    853848                        coeff2(i,j)=prox/prox_max(i,j) 
     849!                        PRINT*,'i=',i,'j=',j 
     850!                        PRINT*,'prox=',prox 
     851!                        PRINT*,'prox_max=',prox_max(i,j) 
     852!                        PRINT*,'coeff2=',coeff2(i,j) 
     853!                        DO m1=j+grid_int,j-grid_int,-1 
     854!                          PRINT*,'Hlarge',Hlarge(i-grid_int:i+grid_int:1,m1) 
     855!                        ENDDO 
     856!                        PRINT* 
     857 
    854858                        !if (((j.eq.154).and.(i.eq.154)).or.((j.eq.184).and.(i.eq.184)).or.((j.eq.117).and.(i.eq.200))) then 
    855859                        !       print *,'time = ',time,'i = ',i,'j = ',j,'coeff1 = ',coeff1(i,j),'coeff2 = ',coeff2(i,j) 
Note: See TracChangeset for help on using the changeset viewer.