Changeset 2947
- Timestamp:
- 2011-10-17T17:36:04+02:00 (12 years ago)
- Location:
- branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/run/job.ksh
r2943 r2947 11 11 ##################################################### 12 12 # each configuration is defined by: 13 # - INSPACE: directory where is the coordinate14 # - COOR_FIL: configuration's coordinate 15 # - LIST: configuration's list of section 13 # - INSPACE: directory the coordinate netcdf file is 14 # - COOR_FIL: configuration's coordinate netcdf file 15 # - LIST: configuration's list of sections 16 16 # 17 17 ##################################################### -
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/compute_sections.f90
r2879 r2947 2 2 !!===================================================================== 3 3 !! *** MODULE diadct *** 4 !! Ocean diagnostics: Compute the transport t rough a section4 !! Ocean diagnostics: Compute the transport through a section 5 5 !! 6 6 !! History: 2011: Clement Bricaud, Mercator-Ocean … … 25 25 !! *** ROUTINE compsec *** 26 26 !! 27 !! ** Purpose : Compute the serie of mesh's points that representsthe section27 !! ** Purpose : Compute the series of mesh points that represent the section 28 28 !! defined by its extremities. 29 29 !! 30 30 !! ** Method : 31 !! I. F ound which cells of the mesh the section iscrossing31 !! I. Find which cells of the mesh the section is crossing 32 32 !! II. Classification of the intersections mesh/section 33 !! -first classificationwest to east33 !! -first classification west to east 34 34 !! -second classification south to north 35 35 !! III. Find extremities of section in the mesh 36 !! IV. Find the serie of mesh'spoints that form the section36 !! IV. Find the series of mesh points that form the section 37 37 !! ** Input: sec : the section to compute 38 38 !! … … 40 40 !!--------------------------------------------------------------------- 41 41 !! * Arguments 42 INTEGER,INTENT(IN) :: jsec !number of the section43 TYPE(SECTION), INTENT(INOUT) :: sec !information about the section44 LOGICAL ,INTENT(IN) :: lkdebug ! debug or not debug this section42 INTEGER,INTENT(IN) :: jsec ! number of the section 43 TYPE(SECTION), INTENT(INOUT) :: sec ! information about the section 44 LOGICAL ,INTENT(IN) :: lkdebug ! debug or not debug this section 45 45 46 46 !! * Local variables 47 47 INTEGER :: & 48 48 ji,jj , & ! dummy loop argument 49 jseg , & ! loop on segments t aht form the section50 nb_inmesh , & ! number of intersection betweensection and the mesh49 jseg , & ! loop on segments that form the section 50 nb_inmesh , & ! number of intersections between the section and the mesh 51 51 nmesh ! number of cells in processor domain 52 52 INTEGER :: itest , jtest ! dummy integer 53 REAL(wp),SAVE :: zdistmesh 53 REAL(wp),SAVE :: zdistmesh ! Taller cell of the mesh in ocean 54 54 REAL(wp) :: & 55 55 zdistEst , zdistNorth , zdistWest , zdistSouth , &! temporary scalars 56 56 zdistEst2 , zdistNorth2, zdistWest2, zdistSouth2, &! temporary scalars 57 57 zdistEst3 , zdistNorth3, zdistWest3, zdistSouth3, &! temporary scalars 58 zdistFirst , zdistLast , zdistref , &! "59 zdistante , zdistante2 , zdistnew , zdistnew2 , &! "60 zdeltai , zdeltaj ! "58 zdistFirst , zdistLast , zdistref , &! temporary scalars 59 zdistante , zdistante2 , zdistnew , zdistnew2 , &! temporary scalars 60 zdeltai , zdeltaj ! temporary scalars 61 61 LOGICAL :: & 62 62 ll_overlap_sec_left = .FALSE. , ll_overlap_sec_right = .FALSE. ,&! temporary logical 63 ll_date_domain_left = .FALSE. , ll_date_domain_right = .FALSE. ,&! "64 ll_overlap_sec = .FALSE. , ll_date_domain = .FALSE. ,&! "65 ll_test = .FALSE. ! "63 ll_date_domain_left = .FALSE. , ll_date_domain_right = .FALSE. ,&! temporary logical 64 ll_overlap_sec = .FALSE. , ll_date_domain = .FALSE. ,&! temporary logical 65 ll_test = .FALSE. ! temporary logical 66 66 LOGICAL :: lest, lwest, lnorth, lsouth 67 67 LOGICAL :: l_oldmethod … … 91 91 92 92 nmesh = jpi*jpj ! number of cells in processor domain 93 nb_inmesh = 0 ! initialize number of intersectionbetween section and the mesh93 nb_inmesh = 0 ! initialize number of intersections between section and the mesh 94 94 zdistEst =0. ; zdistNorth=0. ; zdistWest=0. ; zdistSouth=0. ! temporary scalars 95 zdistFirst=0. ; zdistLast =0. ! "96 zdistante =0. ; zdistante2=0. ; zdistnew=0. ; zdistnew2=0. ! "95 zdistFirst=0. ; zdistLast =0. ! temporary scalars 96 zdistante =0. ; zdistante2=0. ; zdistnew=0. ; zdistnew2=0. ! temporary scalars 97 97 zdeltai=0. ; zdeltaj=0. 98 98 coord_a = COORD_SECTION( 0., 0. ) ; coord_b = COORD_SECTION( 0., 0. ) … … 106 106 107 107 IF( jsec == 1 )THEN 108 !F ound the taller cell of the mesh in ocean (used in compsec)108 !Find the taller cell of the mesh in ocean (used in compsec) 109 109 zdistmesh=0. 110 110 DO jj=2,jpj … … 124 124 125 125 !===========================================================! 126 !I. F ound which cells of the mesh the section is crossing !126 !I. Find which cells of the mesh the section is crossing ! 127 127 !===========================================================! 128 128 … … 363 363 364 364 !==========================================================! 365 ! IV. Find the serie of mesh's points that form the section!365 ! IV. Find the series of mesh points that form the section ! 366 366 !==========================================================! 367 367 CALL write_debug(jsec,"Find the serie of mesh's points that form the section") … … 369 369 IF( sec%nb_point .ne. 0 )THEN 370 370 371 !The serie of mesh'spoints that form the section will 'link'371 !The series of mesh points that form the section will 'link' 372 372 !sec%listPoint(1) to endingPoint: it will be stored in 373 373 !sec%listPoint(jseg) 374 374 ! 375 !We take place on the fi st point (sec%listPoint(1))375 !We take place on the first point (sec%listPoint(1)) 376 376 ! a. We find the 4 adjacent points (North, South, East, West) 377 377 ! b. Compute distance between current point and endingPoint … … 452 452 453 453 454 ! we are on end-point454 !Either we are at an end-point 455 455 !-------------------- 456 456 IF( SouthPoint%I==endingPoint%I .AND. SouthPoint%J==endingPoint%J )THEN … … 464 464 465 465 ELSE 466 ! weare NOT on end-point466 !Else we are NOT on end-point 467 467 !------------------------ 468 468 … … 473 473 ! c. compute distance between the 4 adjacent points and endingPoint 474 474 !------------------------------------------------------------------ 475 ! BE CAR REFUL! When the domain crosses the date line (ll_date_domain):475 ! BE CAREFUL! When the domain crosses the date line (ll_date_domain): 476 476 ! When we will compute distances between W/E/S/N points and endingPoint, 477 477 ! we have to check if theses 4 lines crosses the date line 478 478 ! (test: ABS(coordTemp%lon - coordLast%lon).GT. 180) 479 479 ! If it's true,we have to add 360° to coordLast%long to compute the 480 ! gooddistance through the date line and not through the complementary480 ! correct distance through the date line and not through the complementary 481 481 ! in the mesh. 482 482 … … 497 497 IF( sec%listPoint(jseg)%I .EQ. jpi )THEN 498 498 !We test if the current point is on the east side of the mesh 499 ! The method is done such aswe go toward east to link499 ! The method is done such that we go toward east to link 500 500 ! sec%listPoint(1) to endingPoint. 501 501 ! So, if the section crosses the overlapping band (ll_overlap_sec=T), … … 505 505 IF( ll_overlap_sec )THEN 506 506 !section crosses the overlapping band 507 !So E stPoint is on the west side of the mesh507 !So EastPoint is on the west side of the mesh 508 508 EstPoint = POINT_SECTION(3,sec%listPoint(jseg)%J) 509 509 zdistEst2= distance2(pointToCoordF(EstPoint) ,coordLast ,.FALSE.) … … 592 592 CALL write_debug(jsec,cltmp) 593 593 594 !be car reful! we can't go backward.594 !be careful! we can't go backward. 595 595 zdistNorth = zdistNorth2 ; zdistSouth = zdistSouth2 596 596 zdistEst = zdistEst2 ; zdistWest = zdistWest2 … … 677 677 678 678 679 ELSE ! nb_inmesh== 0679 ELSE ! isec%nb_point == 0 680 680 DO jseg=1,nb_point_max 681 681 sec%listPoint(:)=POINT_SECTION(0,0) … … 695 695 ENDDO 696 696 697 !test if we are oneend-point697 !test if we are an end-point 698 698 IF( sec%listPoint(sec%nb_point)%I .NE. endingPoint%J .AND. sec%listPoint(sec%nb_point)%J .NE. endingPoint%J )THEN 699 699 PRINT*,TRIM(sec%name)," NOT ARRIVED TO endingPoint FOR jsec = ",jsec -
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/declarations.f90
r2878 r2947 14 14 INTEGER, PUBLIC, PARAMETER :: nb_class_max = 10 ! Max number of classes 15 15 INTEGER, PUBLIC, PARAMETER :: nb_sec_max = 150 ! Max number of sections 16 INTEGER, PUBLIC, PARAMETER :: nb_point_max = 2000 ! Max number of segment per section16 INTEGER, PUBLIC, PARAMETER :: nb_point_max = 2000 ! Max number of segments per section 17 17 INTEGER, PUBLIC, PARAMETER :: nb_type_class = 14 ! Max number of types of classes 18 18 INTEGER, PUBLIC, PARAMETER :: numnam=3 ! Unit for namelist … … 21 21 22 22 INTEGER, PUBLIC :: jpi,jpj ! domain dimensions 23 INTEGER, PUBLIC :: nb_sec ! Number of section read ininput file23 INTEGER, PUBLIC :: nb_sec ! Number of sections read from input file 24 24 INTEGER, PUBLIC :: nsecdebug = 0 ! Number of the section to debug 25 25 … … 37 37 TYPE SECTION 38 38 CHARACTER(len=60) :: name ! name of the sec 39 LOGICAL :: llstrpond ! true if you want the computation of sal inity and40 ! temperature balanced by thetransport41 LOGICAL :: ll_ice_section ! ice surf and icevolcomputation39 LOGICAL :: llstrpond ! true if you want the computation of salt 40 ! and heat transport 41 LOGICAL :: ll_ice_section ! ice surface and icevolume transport computation 42 42 LOGICAL :: ll_date_line ! = T if the section crosses the date-line 43 TYPE(COORD_SECTION), DIMENSION(2) :: coordSec ! longitude and latitude of the extremities of the sec 43 TYPE(COORD_SECTION), DIMENSION(2) :: coordSec ! longitude and latitude of the extremities of the section 44 44 INTEGER :: nb_class ! number of boundaries for density classes 45 45 INTEGER, DIMENSION(nb_point_max) :: direction ! vector direction of the point in the section 46 CHARACTER(len=40),DIMENSION(nb_class_max) :: classname ! c aracteristics of the class46 CHARACTER(len=40),DIMENSION(nb_class_max) :: classname ! characteristics of the class 47 47 REAL(wp), DIMENSION(nb_class_max) :: zsigi ,&! insitu density classes (99 if you don't want) 48 48 zsigp ,&! potential density classes (99 if you don't want) 49 49 zsal ,&! salinity classes (99 if you don't want) 50 50 ztem ,&! temperature classes(99 if you don't want) 51 zlay ! level classes (99 if you don't want)52 REAL(wp) :: slopeSection ! coeff directeur de la section53 INTEGER :: nb_point ! section's number of point54 TYPE(POINT_SECTION),DIMENSION(nb_point_max) :: listPoint ! list of point in the section51 zlay ! depth level classes (99 if you don't want) 52 REAL(wp) :: slopeSection ! slope of the section 53 INTEGER :: nb_point ! number of points in the section 54 TYPE(POINT_SECTION),DIMENSION(nb_point_max) :: listPoint ! list of points in the section 55 55 END TYPE SECTION 56 56 -
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/diadct_sections.f90
r2878 r2947 24 24 CHARACTER(LEN=80) :: cdum 25 25 INTEGER :: jsec ,&! loop on sections 26 jseg ! loop on se ctions' points26 jseg ! loop on segments (parts of the section) 27 27 CHARACTER(len=40) :: clname 28 28 LOGICAL :: llok … … 87 87 !----------------------! 88 88 DO jsec=1,nb_sec 89 !we use compsec to generate the serie of grid points making the section89 !we use compsec to generate the series of grid points making the section 90 90 IF(jsec == nsecdebug .OR. nsecdebug ==-1)THEN 91 91 CALL compsec(jsec,secs(jsec),.true.) -
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/readcoordmesh.f90
r2878 r2947 21 21 !! *** ROUTINE coord_mesh_read *** 22 22 !! 23 !! ** Purpose : Read a coordinate and a meshmask file in NetCDF format23 !! ** Purpose : Read a coordinate file and a meshmask file in NetCDF format 24 24 !! 25 25 !!--------------------------------------------------------------------- … … 57 57 !! *** ROUTINE getdim *** 58 58 !! 59 !! ** Purpose : get dim sensions of a netcdf file59 !! ** Purpose : get dimensions of a netcdf file 60 60 !! 61 61 !!---------------------------------------------------------------------- … … 68 68 INTEGER :: istatus, id_var ! dummy variable 69 69 CHARACTER(len=30) :: clname ! dimension name 70 INTEGER, ALLOCATABLE,DIMENSION(:) :: ndim ! dimension svalue70 INTEGER, ALLOCATABLE,DIMENSION(:) :: ndim ! dimension value 71 71 !!---------------------------------------------------------------------- 72 72 -
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/readsections.f90
r2878 r2947 23 23 !! 24 24 !! ** Purpose: read ascii file 'list_sections.ascii' that contains 25 !! section s description25 !! section descriptions 26 26 !! 27 27 !!--------------------------------------------------------------------- … … 29 29 30 30 !! * Local declarations 31 INTEGER :: jsec !loop on section snumber31 INTEGER :: jsec !loop on section number 32 32 INTEGER :: iost,ji 33 33 INTEGER :: iclass , jclass … … 48 48 PRINT*,' ' 49 49 50 nb_sec=0 !initialize num er of sections read in list_sections.ascii50 nb_sec=0 !initialize number of sections read in list_sections.ascii 51 51 52 52 !open and read input file … … 75 75 ENDDO 76 76 77 !computation of salinity and temperature balanced by thetransport ?77 !computation of heat and salt transport ? 78 78 llstrpond=.FALSE. ; IF( cdstrpond .EQ. 'okstrpond' ) llstrpond=.TRUE. 79 79 … … 81 81 llice=.FALSE. ; IF( cdice .EQ. 'okice' ) llice=.TRUE. 82 82 83 !store extremities coordinates83 !store coordinates of the extremities 84 84 coord_point1=COORD_SECTION(plon1,plat1) 85 85 coord_point2=COORD_SECTION(plon2,plat2) 86 86 coord_sec=(/coord_point1,coord_point2/) 87 87 88 !Extremities of the sec are classed88 !Extremities of the section are classed 89 89 lldate=.FALSE. 90 90 IF( coord_sec(2)%lon .LT. coord_sec(1)%lon .OR. & … … 102 102 ENDIF 103 103 104 !slope of the sec (equidistant cylindric projection)104 !slope of the section (equidistant cylindric projection) 105 105 zslope=slope_coeff(coord_sec(1),coord_sec(2),lldate) 106 106 107 !!init global array secs107 !!initialise global array secs 108 108 secs(jsec)%llstrpond=.FALSE. 109 109 secs(jsec)%ll_date_line=.FALSE. ; secs(jsec)%nb_class=0 … … 113 113 secs(jsec)%nb_point=0 114 114 115 !store all information sin global array secs115 !store all information in global array secs 116 116 secs(jsec)%name = cdsecname 117 117 secs(jsec)%llstrpond = llstrpond … … 121 121 secs(jsec)%ll_date_line = lldate 122 122 123 !debug information s123 !debug information 124 124 CALL write_debug(jsec,'Informations read in ascii file:') 125 125 CALL write_debug(jsec,'--------------------------------') -
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/sections_tools.f90
r2878 r2947 83 83 !! 84 84 !! B A first point of the section 85 !! / \ B intermedia rpoint on the section85 !! / \ B intermediate point on the section 86 86 !! / | \ C last point of the section 87 87 !! / | \ … … 217 217 ! Compute coefficient b for a straight line y=a*x+b 218 218 ! Usual method: knowing value of a, we compute b with coordinates of 1 point: 219 ! b=latA-a.lonA o u bienb=latB-a.lonB219 ! b=latA-a.lonA or b=latB-a.lonB 220 220 ! Particular case: the straight line crosses the date line; so it is in 2 parts: 221 221 ! one on the left of the date-line and one the right … … 318 318 ! and in [sec%coordSec(1),sec%coordSec(2)] ! 319 319 !==============================================! 320 !Be car reful! The test is not the same for all configurations320 !Be careful! The test is not the same for all configurations 321 321 IF( sec%ll_date_line )THEN 322 322 … … 398 398 REAL(wp), PARAMETER :: fm=7875.,fa=211.,fc=1663.,fmi=1./fm 399 399 INTEGER :: il, ir, i, iq, ist !local integers 400 INTEGER :: jj !loop indice 400 INTEGER :: jj !loop indices 401 401 REAL(wp) :: zfx, za, zb !local real 402 402 INTEGER,DIMENSION(nstack) :: istack(nstack) !temp array … … 515 515 PRINT*,"Can not open TRIM(clfilename)." ; STOP 516 516 ENDIF 517 !ELSE518 ! PRINT*,TRIM(clfilename)//" already opened"519 517 ENDIF 520 518 521 !write522 519 WRITE(iunit,*)TRIM(cd_write) 523 520 -
branches/2011/dev_r2802_MERCATOR10_diadct/NEMOGCM/TOOLS/SECTIONS_DIADCT/src/writesections.f90
r2878 r2947 41 41 LOGICAL :: llok ! 42 42 CHARACTER(len=40) :: clname ! 43 TYPE(POINT_SECTION) :: point ! a point's coordinates43 TYPE(POINT_SECTION) :: point !coordinates of a point 44 44 45 45 !!---------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.