Se ha incluido el Hamiltoniano en la base de Chuang. Ademas los perfiles de las
[ptslat.git] / dsdump.f90
blob9889e5368d43b81c7efd9b9c4374088e36b5f061
2 PROGRAM EXTRACT_VALUES
4 USE NETCDF
6 IMPLICIT NONE
8 REAL, DIMENSION(:,:), ALLOCATABLE :: UR,UZ,EZZ,ERR,ERZ,E00, EHID
9 REAL CORTE, ZMIN, ZMAX, ZINC, ZETA, EX, EZ, EX_M, EX_V, &
10 EZ_M, EZ_V, RMIN, RMAX, RHO, RINC,DWL,E15,E31,E33
11 REAL, DIMENSION(:), ALLOCATABLE :: DX,DY
12 INTEGER FILE_ID, D2, DIMX, DIMY, I, J, AUX, err_ID, erz_ID, ezz_ID, &
13 numpar,II, ehid_ID, I_CONT, DX_ID, DY_ID,e00_ID,ur_ID,uz_ID,&
14 FILEU_ID
15 CHARACTER(LEN=80) :: File_OUT
17 call check(nf90_open("STR_QD.nc", nf90_NOWRITE,FILE_ID))
18 call check(nf90_open("DPL_QD.nc", nf90_NOWRITE,FILEU_ID))
20 call check(nf90_Inquire_Dimension(FILE_ID,2,len=DIMX))
21 call check(nf90_Inquire_Dimension(FILE_ID,3,len=DIMY))
24 ALLOCATE (EZZ(DIMX,DIMY),ERR(DIMX,DIMY),E00(DIMX,DIMY), &
25 EHID(DIMX,DIMY), ERZ(DIMX,DIMY),DX(DIMX),DY(DIMY), &
26 UR(DIMX,DIMY),UZ(DIMX,DIMY))
28 call check(nf90_inq_varid(FILE_ID, "err", err_ID))
29 call check(nf90_inq_varid(FILE_ID, "e00", e00_ID))
30 call check(nf90_inq_varid(FILE_ID, "erz", erz_ID))
31 call check(nf90_inq_varid(FILE_ID, "ezz", ezz_ID))
32 call check(nf90_inq_varid(FILEU_ID, "uz", uz_ID))
33 call check(nf90_inq_varid(FILEU_ID, "ur", ur_ID))
34 call check(nf90_inq_varid(FILE_ID, "dimx", DX_ID))
35 call check(nf90_inq_varid(FILE_ID, "dimz", DY_ID))
36 call check(nf90_get_var(FILE_ID, erz_ID, ERZ))
37 call check(nf90_get_var(FILE_ID, ezz_ID, EZZ))
38 call check(nf90_get_var(FILE_ID, err_ID, ERR))
39 call check(nf90_get_var(FILE_ID, e00_ID, E00))
40 call check(nf90_get_var(FILEU_ID, ur_ID, UR))
41 call check(nf90_get_var(FILEU_ID, uz_ID, UZ))
42 call check(nf90_get_var(FILE_ID, DX_ID, DX))
43 call check(nf90_get_var(FILE_ID, DY_ID, DY))
45 CORTE=-0.01
47 FILE_OUT="DPL_STR.dat"
48 OPEN(20,FILE=TRIM(FILE_OUT))
49 DO J=1,DIMY
50 ZETA =DY(J)
51 DO I=1,DIMX
52 RHO=DX(I)
53 ! ONLY inside the WL
54 ! IF(ZETA.LE.0.E0.AND.ZETA.GE.-DWL) THEN
55 ! ONLY inside the DOT
56 ! IF(ZETA.GT.0.E0 .AND. &
57 ! ZETA.LT.(HD(II)+5.) .AND. &
58 ! ABS(RHO).LT.(RB(II)+5.0) ) THEN
59 ! ONLY above the WL
60 ! IF(ZETA.GT.-DWL+0.1.AND.ZETA.LT.HD(II)+0.1) THEN
61 ! ONLY inside the DOT + WL
62 ! IF(ZETA.GT.(-DWL-2.) .AND. &
63 ! ZETA.LT.(HD(II)+5.) ) THEN
65 ! IF(EHID(i,j,II).GT.CORTE) THEN
66 WRITE(20,'(20(E15.8,1X))')RHO,ZETA,UR(I,J),UZ(I,J),ERR(I,J),E00(I,J),EZZ(I,J),ERZ(I,J)
67 ! ELSE
68 ! WRITE(20,'(3(E15.8,1X))')RHO,ZETA,1.E0
69 ! WRITE(30,'(3(E15.8,1X))')RHO,ZETA,1.E0
70 ! END IF
72 ! END IF
73 END DO
74 ! To plot with PM3D
75 WRITE(20,*)""
76 END DO
77 WRITE(6,*)"OUTPUT WRITED TO "//TRIM(FILE_OUT)
78 close(20)
81 DEALLOCATE(EZZ,ERR,E00,ERZ,UR,UZ,DX,DY)
83 call check(nf90_close(FILE_ID))
84 call check(nf90_close(FILEU_ID))
86 CONTAINS
88 subroutine check(status)
89 integer, intent ( in) :: status
91 if(status /= nf90_noerr) then
92 print *, trim(nf90_strerror(status))
93 end if
94 end subroutine check
96 END PROGRAM EXTRACT_VALUES