Changeset 665 for codes/icosagcm/devel
- Timestamp:
- 01/20/18 18:46:10 (6 years ago)
- Location:
- codes/icosagcm/devel/src/unstructured
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/devel/src/unstructured/caldyn_unstructured.F90
r658 r665 46 46 SUBROUTINE compute_NH_geopot(tau, m_ik, m_il, theta, W_il, Phi_il) 47 47 FIELD_MASS :: m_ik, theta ! IN*2 48 FIELD_GEOPOT :: m_il, W_il, Phi_il, Phi_star_il ! IN,INOUT*2, LOCAL *548 FIELD_GEOPOT :: m_il, W_il, Phi_il, Phi_star_il ! IN,INOUT*2, LOCAL 49 49 DBL :: tau, gamma, tau2_g, tau2_g2, g2, gm2, vreff, Rd_preff 50 50 INTEGER :: iter … … 83 83 END SUBROUTINE compute_NH_geopot 84 84 85 SUBROUTINE compute_caldyn_slow_NH(u,rhodz,Phi,W, hflux,du,dPhi,dW)85 SUBROUTINE compute_caldyn_slow_NH(u,rhodz,Phi,W, w_il,berni,gradPhi2,DePhil,v_el,G_el,F_el, hflux,du,dPhi,dW) 86 86 FIELD_U :: u, hflux, du ! IN, OUT, OUT 87 FIELD_MASS :: rhodz, berni ! IN, LOCAL88 FIELD_GEOPOT :: Phi,W,dPhi,dW, w_il, gradPhi2 ! IN,IN, OUT,OUT, LOCAL89 FIELD_UL :: DePhil, v_el, G_el, F_el ! LOCAL87 FIELD_MASS :: rhodz, berni ! IN, BUF 88 FIELD_GEOPOT :: Phi,W,dPhi,dW, w_il, gradPhi2 ! IN,IN, OUT,OUT, BUF*2 89 FIELD_UL :: DePhil, v_el, G_el, F_el ! BUF*4 90 90 DECLARE_INDICES 91 91 DECLARE_EDGES … … 96 96 END SUBROUTINE compute_caldyn_slow_NH 97 97 98 SUBROUTINE compute_caldyn_solver(tau,rhodz,theta, pk,geopot,W,dPhi,dW,du)98 SUBROUTINE compute_caldyn_solver(tau,rhodz,theta, berni,pres,m_il, pk,geopot,W,dPhi,dW,du) 99 99 DBL, INTENT(IN) :: tau 100 FIELD_MASS :: rhodz,pk,berni,pres ! IN, OUT, LOCAL100 FIELD_MASS :: rhodz,pk,berni,pres ! IN, OUT, BUF*2 101 101 FIELD_THETA :: theta ! IN 102 FIELD_GEOPOT :: geopot,W,dPhi,dW, m_il ! INOUT,INOUT, OUT,OUT, LOCAL102 FIELD_GEOPOT :: geopot,W,dPhi,dW, m_il ! INOUT,INOUT, OUT,OUT, BUF 103 103 FIELD_U :: du ! OUT 104 104 DECLARE_INDICES … … 113 113 END SUBROUTINE compute_caldyn_solver 114 114 115 SUBROUTINE compute_caldyn_vert_NH(mass,geopot,W,wflux, du,dPhi,dW)116 FIELD_MASS :: mass, eta_dot, wcov, W_etadot 117 FIELD_GEOPOT :: geopot,W,wflux,dPhi,dW 118 FIELD_U :: du 115 SUBROUTINE compute_caldyn_vert_NH(mass,geopot,W,wflux, eta_dot,wcov,W_etadot, du,dPhi,dW) 116 FIELD_MASS :: mass, eta_dot, wcov, W_etadot ! IN, BUF*3 117 FIELD_GEOPOT :: geopot,W,wflux,dPhi,dW ! IN*3, INOUT*2 118 FIELD_U :: du ! INOUT 119 119 DECLARE_INDICES 120 120 DBL :: w_ij, wflux_ij -
codes/icosagcm/devel/src/unstructured/data_unstructured.F90
r663 r665 58 58 !---------------------------- PROFILING -------------------------- 59 59 60 SUBROUTINE init_trace() 60 SUBROUTINE init_trace() BINDC(init_trace) 61 !$OMP MASTER 61 62 time_spent(:)=0. 62 63 bytes(:)=0 63 64 nb_calls(:)=0 65 !$OMP END MASTER 64 66 END SUBROUTINE init_trace 65 67 … … 67 69 INTEGER :: id 68 70 DBL :: total_spent 71 !$OMP MASTER 69 72 total_spent=SUM(time_spent) 70 PRINT *, '========================= Performance metrics =========================' 71 PRINT *, 'Total time spent in instrumented code (seconds) :', total_spent 72 PRINT *, 'Name, #calls, %time, microsec/call, MB/sec' 73 DO id=1,nb_routines 74 IF(nb_calls(id)>0) PRINT *, id_name(id), nb_calls(id), INT(100.*time_spent(id)/total_spent), & 75 INT(1e6*time_spent(id)/nb_calls(id)), INT(1e-6*bytes(id)/time_spent(id)) 76 END DO 77 CALL init_trace() 73 IF(total_spent>.01) THEN 74 PRINT *, '========================= Performance metrics =========================' 75 PRINT *, 'Total time spent in instrumented code (seconds) :', total_spent 76 PRINT *, 'Name, #calls, %time, microsec/call, MB/sec' 77 DO id=1,nb_routines 78 IF(nb_calls(id)>0) PRINT *, id_name(id), nb_calls(id), INT(100.*time_spent(id)/total_spent), & 79 INT(1e6*time_spent(id)/nb_calls(id)), INT(1e-6*bytes(id)/time_spent(id)) 80 END DO 81 CALL init_trace() 82 END IF 83 !$OMP END MASTER 78 84 END SUBROUTINE print_trace 79 85 80 86 SUBROUTINE enter_trace(id, nbytes) 81 87 INTEGER :: id, nbytes 88 !$OMP MASTER 82 89 current_id = id 83 90 bytes(id) = bytes(id) + nbytes 84 91 nb_calls(id)=nb_calls(id)+1 85 92 start_time = OMP_GET_WTIME() 93 !$OMP END MASTER 86 94 END SUBROUTINE enter_trace 87 95 88 96 SUBROUTINE exit_trace() 89 97 DBL :: elapsed 98 !$OMP MASTER 90 99 elapsed = OMP_GET_WTIME()-start_time 91 100 IF(elapsed<0.) elapsed=0. 92 101 time_spent(current_id) = time_spent(current_id) + elapsed 102 !$OMP END MASTER 93 103 END SUBROUTINE exit_trace 94 104 -
codes/icosagcm/devel/src/unstructured/timestep_unstructured.F90
r658 r665 45 45 FIELD_GEOPOT :: wflux, w, geopot, & ! DIAG, INOUT 46 46 dPhi_fast, dPhi_slow, dW_fast, dW_slow ! OUT 47 FIELD_U :: u,du_fast,du_slow,hflux, Ftheta,qu! INOUT,OUT,OUT,DIAG47 FIELD_U :: u,du_fast,du_slow,hflux,qu ! INOUT,OUT,OUT,DIAG 48 48 FIELD_Z :: qv ! DIAG 49 49 FIELD_PS :: ps,dmass_col,mass_col ! OUT,OUT,IN (if eta_mass) or OUT,UNUSED,UNUSED (if eta_lag) 50 FIELD_UL :: wwuu 50 ! buffers for fields that need to be shared among OpenMP threads 51 ! vertical size is allocated as llm+1 even if only llm is needed 52 FIELD_GEOPOT :: bufm1, bufm2, bufm3 53 FIELD_UL :: bufu1, bufu2, bufu3,bufu4 54 51 55 DBL :: time1,time2 52 56 INTEGER :: ij 53 57 54 CALL init_trace()55 58 ! CALL CPU_TIME(time1) 56 59 time1=OMP_GET_WTIME() … … 72 75 CALL compute_pvort_only(rhodz,u,qv,qu) 73 76 CALL compute_caldyn_slow_hydro(rhodz,theta,u, berni,hflux,du_slow) 74 CALL compute_coriolis(hflux,theta,qu, Ftheta, drhodz,dtheta_rhodz,du_slow)77 CALL compute_coriolis(hflux,theta,qu, bufu1, drhodz,dtheta_rhodz,du_slow) 75 78 IF(caldyn_eta == eta_mass) THEN 76 CALL caldyn_vert(drhodz,rhodz,theta,u, dmass_col,wflux,dtheta_rhodz,du_slow, wwuu)79 CALL caldyn_vert(drhodz,rhodz,theta,u, dmass_col,wflux,dtheta_rhodz,du_slow,bufu1) 77 80 END IF 78 81 !$OMP END PARALLEL … … 88 91 END DO 89 92 CALL compute_theta(mass_col,rhodz,theta_rhodz, theta) 90 CALL compute_caldyn_solver(tau,rhodz,theta, pk,geopot,W,dPhi_fast,dW_fast,du_fast)93 CALL compute_caldyn_solver(tau,rhodz,theta, bufm1,bufm2,bufm3, pk,geopot,W,dPhi_fast,dW_fast,du_fast) 91 94 CALL compute_caldyn_fast(tau, pk,berni,theta,geopot, du_fast,u) 92 95 CALL compute_pvort_only(rhodz,u,qv,qu) 93 CALL compute_caldyn_slow_NH(u,rhodz,geopot,W, hflux,du_slow,dPhi_slow,dW_slow)94 CALL compute_coriolis(hflux,theta,qu, Ftheta, drhodz,dtheta_rhodz,du_slow)96 CALL compute_caldyn_slow_NH(u,rhodz,geopot,W, bufm1,bufm2,bufm3,bufu1,bufu2,bufu3,bufu4, hflux,du_slow,dPhi_slow,dW_slow) 97 CALL compute_coriolis(hflux,theta,qu, bufu1, drhodz,dtheta_rhodz,du_slow) 95 98 IF(caldyn_eta == eta_mass) THEN 96 CALL caldyn_vert(drhodz,rhodz,theta,u, dmass_col,wflux,dtheta_rhodz,du_slow, wwuu)97 CALL compute_caldyn_vert_NH(rhodz,geopot,W,wflux, du_slow,dPhi_slow,dW_slow)99 CALL caldyn_vert(drhodz,rhodz,theta,u, dmass_col,wflux,dtheta_rhodz,du_slow,bufu1) 100 CALL compute_caldyn_vert_NH(rhodz,geopot,W,wflux, bufm1,bufm2,bufm3, du_slow,dPhi_slow,dW_slow) 98 101 END IF 99 102 END IF … … 117 120 FIELD_MASS :: rhodz, pk, berni ! IN, DIAG 118 121 FIELD_THETA :: theta_rhodz, theta ! IN, DIAG 119 FIELD_U :: u,hflux,qu ,Ftheta ! INOUT,DIAG*3120 FIELD_GEOPOT :: geopot, w, wflux , w_il ! IN, INOUT, DIAG, DIAG122 FIELD_U :: u,hflux,qu ! INOUT,DIAG*2 123 FIELD_GEOPOT :: geopot, w, wflux ! IN, INOUT, DIAG 121 124 FIELD_Z :: qv ! DIAG 122 125 DOUBLE2( primal_num, max_nb_stage) :: dmass_col ! OUT … … 126 129 DOUBLE3(llm+1, primal_num, max_nb_stage) :: & 127 130 dPhi_fast, dPhi_slow, dW_fast, dW_slow ! OUT 128 FIELD_UL :: DePhil, v_el, G_el, wwuu ! DIAG*4 131 ! buffers for fields that need to be shared among OpenMP threads 132 ! vertical size is allocated as llm+1 even if only llm is needed 133 FIELD_GEOPOT :: bufm1, bufm2, bufm3 134 FIELD_UL :: bufu1, bufu2, bufu3,bufu4 129 135 DBL :: time1,time2 130 136 INTEGER :: step, stage, ij 131 137 132 CALL init_trace()133 138 !CALL CPU_TIME(time1) 134 139 time1=OMP_GET_WTIME() … … 154 159 CALL compute_pvort_only(rhodz,u,qv,qu) 155 160 CALL compute_caldyn_slow_hydro(rhodz,theta,u, berni,hflux,du_slow(:,:,stage)) 156 CALL compute_coriolis(hflux,theta,qu, Ftheta, drhodz(:,:,stage), dtheta_rhodz(:,:,:,stage),du_slow(:,:,stage))161 CALL compute_coriolis(hflux,theta,qu, bufu1, drhodz(:,:,stage), dtheta_rhodz(:,:,:,stage),du_slow(:,:,stage)) 157 162 IF(caldyn_eta == eta_mass) THEN 158 163 CALL caldyn_vert(drhodz(:,:,stage),rhodz,theta,u, & 159 dmass_col(:,stage),wflux,dtheta_rhodz(:,:,:,stage),du_slow(:,:,stage), wwuu)164 dmass_col(:,stage),wflux,dtheta_rhodz(:,:,:,stage),du_slow(:,:,stage),bufu1) 160 165 END IF 161 166 … … 168 173 !$OMP END DO 169 174 CALL compute_theta(mass_col,rhodz,theta_rhodz, theta) 170 CALL compute_caldyn_solver(tauj(stage),rhodz,theta, pk,geopot,W, &175 CALL compute_caldyn_solver(tauj(stage),rhodz,theta, bufm1,bufm2,bufm3, pk,geopot,W, & 171 176 dPhi_fast(:,:,stage), dW_fast(:,:,stage), du_fast(:,:,stage)) 172 177 CALL compute_caldyn_fast(tauj(stage), pk,berni,theta,geopot, du_fast(:,:,stage),u) 173 178 CALL compute_pvort_only(rhodz,u,qv,qu) 174 CALL compute_caldyn_slow_NH(u,rhodz,geopot,W, hflux, du_slow(:,:,stage), dPhi_slow(:,:,stage), dW_slow(:,:,stage)) 175 CALL compute_coriolis(hflux,theta,qu,Ftheta, drhodz(:,:,stage),dtheta_rhodz(:,:,:,stage), du_slow(:,:,stage)) 179 CALL compute_caldyn_slow_NH(u,rhodz,geopot,W, bufm1,bufm2,bufm3,bufu1,bufu2,bufu3,bufu4, hflux, & 180 du_slow(:,:,stage), dPhi_slow(:,:,stage), dW_slow(:,:,stage)) 181 CALL compute_coriolis(hflux,theta,qu, bufu1, drhodz(:,:,stage),dtheta_rhodz(:,:,:,stage), du_slow(:,:,stage)) 176 182 IF(caldyn_eta == eta_mass) THEN 177 183 CALL caldyn_vert(drhodz(:,:,stage),rhodz,theta,u, & 178 dmass_col(:,stage),wflux,dtheta_rhodz(:,:,:,stage), du_slow(:,:,stage), wwuu) 179 CALL compute_caldyn_vert_NH(rhodz,geopot,W,wflux, du_slow(:,:,stage), dPhi_slow(:,:,stage), dW_slow(:,:,stage) ) 184 dmass_col(:,stage),wflux,dtheta_rhodz(:,:,:,stage), du_slow(:,:,stage), bufu1) 185 CALL compute_caldyn_vert_NH(rhodz,geopot,W,wflux, bufm1,bufm2,bufm3, & 186 du_slow(:,:,stage), dPhi_slow(:,:,stage), dW_slow(:,:,stage) ) 180 187 END IF 181 188 END IF ! NH
Note: See TracChangeset
for help on using the changeset viewer.