- Timestamp:
- Jul 12, 2019, 10:31:58 PM (5 years ago)
- Location:
- trunk/tools
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/diag_tools.py
r2674 r2675 1600 1600 1601 1601 if len(theta.shape) == 4: 1602 dx = t as.shape[3]1603 dy = t as.shape[2]1604 dz = t as.shape[1]1605 dt = t as.shape[0]1602 dx = theta.shape[3] 1603 dy = theta.shape[2] 1604 dz = theta.shape[1] 1605 dt = theta.shape[0] 1606 1606 1607 1607 xdiab = np.zeros((dt,dz,dy,dx), dtype=np.float) … … 1623 1623 dxst = dxs.transpose() 1624 1624 dyst = dys.transpose() 1625 dzst = dzs.transpose() 1625 1626 print ' ' + fname + ' Lluis shapes dzs', dzs.shape, 'dz:', dz 1626 1627 1627 1628 pxdiab, pydiab, pzdiab, pxdef, pydef, pzdef, pxtilt, pytilt, pzdiv, pf = \ 1628 1629 fdin.module_fordiagnostics.compute_frontogenesis(theta=thetat, ua=uat, \ 1629 va=vat, wa=wat, press=presst, dsx=dxst, dsy=dyst, dsz=dzs t, dst=dts, d1=dx,\1630 va=vat, wa=wat, press=presst, dsx=dxst, dsy=dyst, dsz=dzs, dst=dts, d1=dx, \ 1630 1631 d2=dy, d3=dz, d4=dt) 1631 1632 xdiab = pxdiab.transpose() -
trunk/tools/diagnostics.inf
r2655 r2675 18 18 fog, fog_RUC, Q2@T2@PSFC 19 19 front, front_R04, T2@U10@V10@WRFdx@WRFdy@params:1.:0.0001 20 frontogenesis, frontogenesis, WRFt@UNua@UNva@UNwa@WRFp@WRFdx@WRFdy@WRFdz@WRFtime 20 21 hur, LMDZrh, pres@t@r 21 22 hur, WRFrh, WRFrh@T@P@PB -
trunk/tools/diagnostics.py
r2674 r2675 106 106 'WRFbils', 'WRFbnds', \ 107 107 'WRFclivi', 'WRFclwvi', 'WRFdens', 'WRFdx', 'WRFdxdy', 'WRFdxdywps', 'WRFdy', \ 108 'WRF geop', 'WRFp', 'WRFtd',\108 'WRFdz', 'WRFgeop', 'WRFp', 'WRFtd', \ 109 109 'WRFpos', 'WRFprc', 'WRFprls', 'WRFrh', 'LMDZrh', 'LMDZrhs', \ 110 110 'WRFrhs', 'WRFrvors', \ … … 173 173 WRFdxdywps_compute = False 174 174 LONLATdxdy_compute = False 175 UNua_compute = False 176 UNva_compute = False 177 UNwa_compute = False 175 178 176 179 # File creation … … 486 489 print ' ' + main + ': Retrieving dz: real distance between grid points ' + \ 487 490 'from WRF as dz=PHB(k+1)+PH(k+1)-(PHB(k)+PH(k))' 491 PH = ncobj.variables['PH'][:] 492 PHB = ncobj.variables['PHB'][:] 493 488 494 dimv = ncobj.variables['PH'].shape 489 495 … … 876 882 elif diagn == 'frontogenesis': 877 883 878 var0 = ncobj.variables[depvars[0]][:] 884 if depvars[0] == 'WRFt': var0 = WRFt 885 else: var0 = ncobj.variables[depvars[0]][:] 886 dx = var0.shape[3] 887 dy = var0.shape[2] 888 dz = var0.shape[1] 889 dt = var0.shape[0] 879 890 var1 = ncobj.variables[depvars[1]][:] 880 891 var2 = ncobj.variables[depvars[2]][:] 881 if depvars[3] == 'WRFpress': var3 = WRFpress 882 else: var3 = ncobj.variables[depvars[3]] 883 if depvars[4] == 'WRFdx': var4 = WRFdx 892 var3 = ncobj.variables[depvars[3]][:] 893 if depvars[4] == 'WRFp': var4 = WRFp 884 894 else: var4 = ncobj.variables[depvars[4]] 885 if depvars[5] == 'WRFd y': var5 = WRFdy895 if depvars[5] == 'WRFdx': var5 = WRFdx 886 896 else: var5 = ncobj.variables[depvars[5]] 887 if depvars[6] == 'WRFd z': var6 = WRFdz[0,:,0,0]897 if depvars[6] == 'WRFdy': var6 = WRFdy 888 898 else: var6 = ncobj.variables[depvars[6]] 889 if depvars[7] == 'WRF time': var7 = WRFtime899 if depvars[7] == 'WRFdz': var7 = WRFdz[0,0:dz,0,0] 890 900 else: var7 = ncobj.variables[depvars[7]] 901 if depvars[8] == 'WRFtime': var08 = WRFtime 902 else: var08 = ncobj.variables[depvars[8]] 903 904 # Assuming monotonic time-axis... 905 var8 = var08[1] - var08[0] 891 906 892 907 diag1, diag2, diag3, diag4, diag5, diag6, diag7, diag8, diag9, diag10, \ 893 908 diagoutd, diagoutvd = diag.Forcompute_frontogenesis(var0, var1, var2, var3,\ 894 var4, var5, var6, var7, dnames,dvnames)909 var4, var5, var6, var7, var8, dnames, dvnames) 895 910 896 911 ncvar.insert_variable(ncobj, 'diabh', diag1, diagoutd, diagoutvd, newnc, \ -
trunk/tools/module_ForDiagnostics.f90
r2674 r2675 1596 1596 INTEGER, INTENT(in) :: d1, d2, d3, d4 1597 1597 REAL(r_k), DIMENSION(d1,d2,d3,d4), INTENT(in) :: theta, ua, va, wa, press 1598 REAL(r_k), DIMENSION(d1,d2), INTENT(in) :: dsx, dsy, dsz, dst 1598 REAL(r_k), INTENT(in) :: dst 1599 REAL(r_k), DIMENSION(d1,d2), INTENT(in) :: dsx, dsy 1600 REAL(r_k), DIMENSION(d3), INTENT(in) :: dsz 1599 1601 REAL(r_k), DIMENSION(d1,d2,d3,d4), INTENT(out) :: xdiab, ydiab, zdiab, xdef, ydef, zdef, & 1600 xtilt, ytilt, zdiv , f1602 xtilt, ytilt, zdiv 1601 1603 REAL(r_k), DIMENSION(d1,d2,d3,d4,3), INTENT(out) :: f 1602 1604 … … 1623 1625 1624 1626 DO it=1, d4 1625 CALL var_Frontogenesis(d x, dy, dz, theta(:,:,:,it), ua(:,:,:,it), va(:,:,:,it), wa(:,:,:,it), &1626 press(:,:,:,it), d dx, ddy, ddz, ddt, xdiab(:,:,:,it), ydiab(:,:,:,it), zdiab(:,:,:,it), &1627 CALL var_Frontogenesis(d1, d2, d3, theta(:,:,:,it), ua(:,:,:,it), va(:,:,:,it), wa(:,:,:,it), & 1628 press(:,:,:,it), dsx, dsy, dsz, dst, xdiab(:,:,:,it), ydiab(:,:,:,it), zdiab(:,:,:,it), & 1627 1629 xdef(:,:,:,it), ydef(:,:,:,it), zdef(:,:,:,it), xtilt(:,:,:,it), ytilt(:,:,:,it), & 1628 1630 zdiv(:,:,:,it), f(:,:,:,it,:)) … … 1631 1633 RETURN 1632 1634 1633 END SUBROUTINE compute_front _R04d31635 END SUBROUTINE compute_frontogenesis 1634 1636 1635 1637 END MODULE module_ForDiagnostics -
trunk/tools/module_ForDiagnosticsVars.f90
r2674 r2675 2059 2059 REAL(r_k), DIMENSION(dx,dy), INTENT(in) :: ddx,ddy 2060 2060 REAL(r_k), DIMENSION(dz), INTENT(in) :: ddz 2061 REAL(r_k), DIMENSION(dx,dy,dz ,), INTENT(in):: theta, ua, va, wa, press2062 REAL(r_k), DIMENSION(dx,dy,dz ,), INTENT(out):: xdiab, ydiab, zdiab2063 REAL(r_k), DIMENSION(dx,dy,dz ,), INTENT(out):: xdef, ydef, zdef2064 REAL(r_k), DIMENSION(dx,dy,dz ,), INTENT(out):: xtilt, ytilt, zdiv2061 REAL(r_k), DIMENSION(dx,dy,dz), INTENT(in) :: theta, ua, va, wa, press 2062 REAL(r_k), DIMENSION(dx,dy,dz), INTENT(out) :: xdiab, ydiab, zdiab 2063 REAL(r_k), DIMENSION(dx,dy,dz), INTENT(out) :: xdef, ydef, zdef 2064 REAL(r_k), DIMENSION(dx,dy,dz), INTENT(out) :: xtilt, ytilt, zdiv 2065 2065 REAL(r_k), DIMENSION(dx,dy,dz,3), INTENT(out) :: f 2066 2066 … … 2110 2110 zdiv(:,:,:) = thetatilt(:,:,:,3) 2111 2111 2112 f(:,:,:,1) = 1./modthteagrad*thetagrad(:,:,:,1)*(xdiab(:,:,:) + xdef(:,:,:) + & 2113 xtilt(:,:,:)) 2112 f(:,:,:,1) = 1./modthetagrad*thetagrad(:,:,:,1)*(xdiab(:,:,:) + xdef(:,:,:) + xtilt(:,:,:)) 2114 2113 f(:,:,:,2) = thetagrad(:,:,:,2)*(ydiab(:,:,:) + ydef(:,:,:) + ytilt(:,:,:)) 2115 2114 f(:,:,:,3) = thetagrad(:,:,:,3)*(zdiab(:,:,:) + zdef(:,:,:) + zdiv(:,:,:)) -
trunk/tools/module_scientific.f90
r2674 r2675 7923 7923 END FUNCTION vecmodule3D 7924 7924 7925 SUBROUTINE FUNCTIONmatmodule3D(d1, d2, d3, mat, matmodule)7925 SUBROUTINE matmodule3D(d1, d2, d3, mat, matmodule) 7926 7926 ! Subroutine to compute the module of a 3D matrix with 3 components 7927 7927 7928 7928 IMPLICIT NONE 7929 7929 7930 INTEGER, INTENT(in) :: d1,d2,d3 7930 7931 REAL(r_k), DIMENSION(d1,d2,d3,3), INTENT(in) :: mat 7931 7932 REAL(r_k), DIMENSION(d1,d2,d3), INTENT(out) :: matmodule … … 7933 7934 fname = 'matmodule3D' 7934 7935 7935 matmodule3D = SQRT(vec(:,:,:,1)*vec(:,:,:,1) + vec(:,:,:,2)*vec(:,:,:,2) + & 7936 vec(:,:,:,3)*vec(:,:,:,3)) 7936 matmodule = SQRT(mat(:,:,:,1)*mat(:,:,:,1) + mat(:,:,:,2)*mat(:,:,:,2) + mat(:,:,:,3)*mat(:,:,:,3)) 7937 7937 7938 7938 END SUBROUTINE matmodule3D … … 7960 7960 def = fillval64 7961 7961 7962 def(:,:,:,1) = - uagrad(:,:,:,1)*vargrad(:,:,:1) - vagrad(:,:,:,1)*vargrad(:,:,:2)7963 def(:,:,:,2) = - uagrad(:,:,:,2)*vargrad(:,:,:1) - vagrad(:,:,:,2)*vargrad(:,:,:2)7964 def(:,:,:,3) = - uagrad(:,:,:,3)*vargrad(:,:,:1) - vagrad(:,:,:,3)*vargrad(:,:,:2)7962 def(:,:,:,1) = -uagrad(:,:,:,1)*vargrad(:,:,:,1) -vagrad(:,:,:,1)*vargrad(:,:,:,2) 7963 def(:,:,:,2) = -uagrad(:,:,:,2)*vargrad(:,:,:,1) -vagrad(:,:,:,2)*vargrad(:,:,:,2) 7964 def(:,:,:,3) = -uagrad(:,:,:,3)*vargrad(:,:,:,1) -vagrad(:,:,:,3)*vargrad(:,:,:,2) 7965 7965 7966 7966 END SUBROUTINE deformation3D … … 7988 7988 tilt = fillval64 7989 7989 7990 tilt(:,:,:,1) = - uagrad(:,:,:,1)*vargrad(:,:,:3)7991 tilt(:,:,:,2) = - vagrad(:,:,:,2)*vargrad(:,:,:3)7992 tilt(:,:,:,3) = - wagrad(:,:,:,3)*vargrad(:,:,:3)7990 tilt(:,:,:,1) = -wagrad(:,:,:,1)*vargrad(:,:,:,3) 7991 tilt(:,:,:,2) = -wagrad(:,:,:,2)*vargrad(:,:,:,3) 7992 tilt(:,:,:,3) = -wagrad(:,:,:,3)*vargrad(:,:,:,3) 7993 7993 7994 7994 END SUBROUTINE tilting3D … … 8000 8000 8001 8001 INTEGER, INTENT(in) :: dx, dy, dz, dt 8002 REAL(r_k), DIMENSION(dx,dy,dz,dt), INTENT(in) :: vargrad 8002 REAL(r_k), INTENT(in) :: ddt 8003 REAL(r_k), DIMENSION(dx,dy,dz,dt), INTENT(in) :: var 8003 8004 CHARACTER(LEN=*), INTENT(in) :: dtkind 8004 8005 REAL(r_k), DIMENSION(dx,dy,dz,dt), INTENT(out) :: vardt … … 8039 8040 END IF 8040 8041 8041 END SUBROUTINE tilting3D8042 END SUBROUTINE deltat3D 8042 8043 8043 8044 END MODULE module_scientific
Note: See TracChangeset
for help on using the changeset viewer.