Changeset 4222 for palm/trunk/TUTORIALS/cases/lsm_short/USER_CODE
 Timestamp:
 Sep 9, 2019 12:55:23 PM (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/TUTORIALS/cases/lsm_short/USER_CODE/user_module.f90
r4002 r4222 120 120 ! REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: u2_av !< user defined array 121 121 ! REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: ustvst !< user defined array 122 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: v_h, v_h_av !< user defined arra123 122 REAL(wp), DIMENSION(:,:,:), ALLOCATABLE :: v_h, v_h_av !< user defined array 123 124 124 SAVE 125 125 … … 452 452 ! unit = 'm2/s2' 453 453 454 CASE ( 'v_h' ) 455 unit = 'm/s' 456 454 CASE ( 'v_h' ) 455 unit = 'm/s' 457 456 ! 458 457 ! CASE ( 'u*v*' ) … … 485 484 ! ALLOCATE( u2(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 486 485 ! ALLOCATE( ustvst(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 487 486 ALLOCATE( v_h(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 488 487 489 488 ! … … 521 520 ! Sample for userdefined output 522 521 ! ustvst = 0.0_wp 522 v_h = 0.0_wp 523 523 524 524 … … 560 560 ! grid_z = 'zu' 561 561 562 CASE ( 'v_h', 'v_h_xy', 'v_h_xz', 'v_h_yz', 'v_h_av' ) 563 found = .TRUE. 564 grid_x = 'xu' 565 grid_y = 'y' 566 grid_z = 'zu' 567 562 563 CASE ( 'v_h', 'v_h_xy', 'v_h_xz', 'v_h_yz', 'v_h_av' ) 564 found = .TRUE. 565 grid_x = 'xu' 566 grid_y = 'y' 567 grid_z = 'zu' 568 568 569 CASE DEFAULT 569 570 found = .FALSE. … … 633 634 CHARACTER (LEN=*) :: location !< 634 635 635 INTEGER(iwp) :: i !< 636 INTEGER(iwp) :: j !< 637 INTEGER(iwp) :: k !< 636 INTEGER(iwp) :: i !< 637 INTEGER(iwp) :: j !< 638 INTEGER(iwp) :: k !< 638 639 639 640 CALL cpu_log( log_point(24), 'user_actions', 'start' ) … … 793 794 CHARACTER (LEN=*) :: variable !< 794 795 795 INTEGER(iwp) :: i !< 796 INTEGER(iwp) :: j !< 797 INTEGER(iwp) :: k !< 796 INTEGER(iwp) :: i !< 797 INTEGER(iwp) :: j !< 798 INTEGER(iwp) :: k !< 798 799 799 800 IF ( mode == 'allocate' ) THEN … … 879 880 ! ENDIF 880 881 881 CASE ( 'v_h' )882 IF ( ALLOCATED( v_h_av ) ) THEN883 DO i = nxlg, nxrg884 DO j = nysg, nyng885 DO k = nzb, nzt+1886 v_h_av(k,j,i) = v_h_av(k,j,i) / REAL( average_count_3d, KIND=wp )887 ENDDO888 ENDDO889 ENDDO890 ENDIF882 CASE ( 'v_h' ) 883 IF ( ALLOCATED( v_h_av ) ) THEN 884 DO i = nxlg, nxrg 885 DO j = nysg, nyng 886 DO k = nzb, nzt+1 887 v_h_av(k,j,i) = v_h_av(k,j,i) / REAL( average_count_3d, KIND=wp ) 888 ENDDO 889 ENDDO 890 ENDDO 891 ENDIF 891 892 892 893 END SELECT … … 929 930 ! Next line is to avoid compiler warning about unused variables. Please remove. 930 931 IF ( av == 0 .OR. local_pf(nxl,nys,nzb_do) == 0.0_wp .OR. two_d ) CONTINUE 931 932 932 933 933 found = .TRUE. … … 965 965 ! grid = 'zu' 966 966 967 CASE ( 'v_h_xy', 'v_h_xz', 'v_h_yz' )968 IF ( av == 0 ) THEN969 DO i = nxl, nxr970 DO j = nys, nyn971 DO k = nzb_do, nzt_do972 local_pf(i,j,k) = v_h(k,j,i)973 ENDDO974 ENDDO975 ENDDO976 ELSE977 IF ( .NOT. ALLOCATED( v_h_av ) ) THEN978 ALLOCATE( v_h_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )979 v_h_av = REAL( fill_value, KIND = wp )980 ENDIF981 DO i = nxl, nxr982 DO j = nys, nyn983 DO k = nzb_do, nzt_do984 local_pf(i,j,k) = v_h_av(k,j,i)985 ENDDO986 ENDDO987 ENDDO988 ENDIF989 990 grid = 'zu'967 CASE ( 'v_h_xy', 'v_h_xz', 'v_h_yz' ) 968 IF ( av == 0 ) THEN 969 DO i = nxl, nxr 970 DO j = nys, nyn 971 DO k = nzb_do, nzt_do 972 local_pf(i,j,k) = v_h(k,j,i) 973 ENDDO 974 ENDDO 975 ENDDO 976 ELSE 977 IF ( .NOT. ALLOCATED( v_h_av ) ) THEN 978 ALLOCATE( v_h_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 979 v_h_av = REAL( fill_value, KIND = wp ) 980 ENDIF 981 DO i = nxl, nxr 982 DO j = nys, nyn 983 DO k = nzb_do, nzt_do 984 local_pf(i,j,k) = v_h_av(k,j,i) 985 ENDDO 986 ENDDO 987 ENDDO 988 ENDIF 989 990 grid = 'zu' 991 991 ! 992 992 ! In case twodimensional surface variables are output, the user … … 1046 1046 1047 1047 INTEGER(iwp) :: av !< 1048 INTEGER(iwp) :: i !< 1049 INTEGER(iwp) :: j !< 1050 INTEGER(iwp) :: k !< 1048 INTEGER(iwp) :: i !< 1049 INTEGER(iwp) :: j !< 1050 INTEGER(iwp) :: k !< 1051 1051 INTEGER(iwp) :: nzb_do !< lower limit of the data output (usually 0) 1052 1052 INTEGER(iwp) :: nzt_do !< vertical upper limit of the data output (usually nz_do3d) … … 1057 1057 1058 1058 REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) :: local_pf !< 1059 1060 !1061 ! Next line is to avoid compiler warning about unused variables. Please remove.1062 IF ( av == 0 .OR. local_pf(nxl,nys,nzb_do) == 0.0_wp ) CONTINUE1063 1059 1064 1060 … … 1094 1090 ! ENDDO 1095 1091 ! ENDIF 1096 ! 1097 1098 CASE ( 'v_h' )1099 IF ( av == 0 ) THEN1100 DO i = nxl, nxr1101 DO j = nys, nyn1102 DO k = nzb_do, nzt_do1103 local_pf(i,j,k) = v_h(k,j,i)1104 ENDDO1105 ENDDO1106 ENDDO1107 ELSE1108 IF ( .NOT. ALLOCATED( v_h_av ) ) THEN1109 ALLOCATE( v_h_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )1110 v_h_av = REAL( fill_value, KIND = wp )1111 ENDIF1112 DO i = nxl, nxr1113 DO j = nys, nyn1114 DO k = nzb_do, nzt_do1115 local_pf(i,j,k) = v_h_av(k,j,i)1116 ENDDO1117 ENDDO1118 ENDDO1119 ENDIF1120 1121 1092 1093 1094 CASE ( 'v_h' ) 1095 IF ( av == 0 ) THEN 1096 DO i = nxl, nxr 1097 DO j = nys, nyn 1098 DO k = nzb_do, nzt_do 1099 local_pf(i,j,k) = v_h(k,j,i) 1100 ENDDO 1101 ENDDO 1102 ENDDO 1103 ELSE 1104 IF ( .NOT. ALLOCATED( v_h_av ) ) THEN 1105 ALLOCATE( v_h_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ) 1106 v_h_av = REAL( fill_value, KIND = wp ) 1107 ENDIF 1108 DO i = nxl, nxr 1109 DO j = nys, nyn 1110 DO k = nzb_do, nzt_do 1111 local_pf(i,j,k) = v_h_av(k,j,i) 1112 ENDDO 1113 ENDDO 1114 ENDDO 1115 ENDIF 1116 ! 1117 1122 1118 CASE DEFAULT 1123 1119 found = .FALSE.
Note: See TracChangeset
for help on using the changeset viewer.