Changeset 784 for codes/icosagcm


Ignore:
Timestamp:
11/21/18 16:16:06 (6 years ago)
Author:
jisesh
Message:

devel/unstructured : laplacian operator

Location:
codes/icosagcm/devel
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • codes/icosagcm/devel/Python/src/kernels_transport.jin

    r687 r784  
    310310    END_BLOCK 
    311311END_BLOCK 
     312 
     313KERNEL(scalar_laplacian) 
     314 
     315  FORALL_CELLS_EXT() 
     316    ON_EDGES 
     317       grad(EDGE) = SIGN*(b(CELL2)-b(CELL1)) 
     318    END_BLOCK 
     319  END_BLOCK 
     320 
     321  FORALL_CELLS_EXT() 
     322    ON_PRIMAL 
     323      div_ij=0. 
     324      FORALL_EDGES 
     325        div_ij = div_ij + SIGN*LE_DE*grad(EDGE) 
     326      END_BLOCK 
     327      divu(CELL) = div_ij / AI 
     328    END_BLOCK 
     329  END_BLOCK 
     330 
     331END_BLOCK 
  • codes/icosagcm/devel/Python/src/unstructured.pyx

    r747 r784  
    7777                     ['dynamico_init_hybrid', c_void_p,3], 
    7878                     ['dynamico_caldyn_unstructured', c_num, c_void_p,20], 
     79                     ['dynamico_scalar_laplacian', c_void_p,2], 
    7980                     ['dynamico_partition_graph', c_int,2, c_void_p,3, c_int, c_void_p], 
    8081                     ['dynamico_init_transfer', c_int, c_int,2,c_void_p,3, c_int,2,c_void_p,3], 
  • codes/icosagcm/devel/src/unstructured/caldyn_unstructured.F90

    r749 r784  
    236236END SUBROUTINE 
    237237 
     238SUBROUTINE compute_scalar_laplacian(b,grad,divu) 
     239  FIELD_MASS   :: b, divu ! IN, OUT 
     240  FIELD_U      :: grad ! BUF 
     241  DECLARE_INDICES 
     242  DECLARE_EDGES 
     243  NUM :: div_ij 
     244  START_TRACE(id_scalar_laplacian, 0,0,1) 
     245#include "../kernels_unst/scalar_laplacian.k90" 
     246  STOP_TRACE 
     247END SUBROUTINE compute_scalar_laplacian 
     248 
    238249END MODULE caldyn_unstructured_mod 
  • codes/icosagcm/devel/src/unstructured/data_unstructured.F90

    r759 r784  
    4646  INTEGER, PARAMETER :: id_dev1=1, id_dev2=2, & 
    4747       id_pvort_only=3, id_slow_hydro=4, id_fast=5, id_coriolis=6, id_theta=7, id_geopot=8, id_vert=9, & 
    48        id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, id_halo=15, nb_routines=15  
     48       id_solver=10, id_slow_NH=11, id_NH_geopot=12, id_vert_NH=13, id_update=14, id_halo=15, & 
     49       id_scalar_laplacian=16, nb_routines=16  
    4950  TIME, PRIVATE :: start_time, time_spent(nb_routines) ! time spent in each kernel 
    5051  INTEGER, PRIVATE :: current_id, nb_calls(nb_routines) 
     
    5354       (/'dev1      ', 'dev2      ', & 
    5455       'pvort_only', 'slow_hydro', 'fast      ', 'coriolis  ', 'theta     ', 'geopot    ', 'vert      ', & 
    55        'solver    ', 'slow_NH   ', 'NH_geopot ', 'vert_NH   ',  'update    ', 'halo_xchg ' /) 
     56       'solver    ', 'slow_NH   ', 'NH_geopot ', 'vert_NH   ',  'update    ', 'halo_xchg ', 'scalar_lap' /) 
    5657 
    5758  INTEGER, PARAMETER ::transfer_primal=1, transfer_edge=2, transfer_dual=3, transfer_max=3 
  • codes/icosagcm/devel/src/unstructured/timestep_unstructured.F90

    r775 r784  
    2121#define HASNAN(field) (ANY(.NOT.ABS(field)<1e20)) 
    2222 
     23   SUBROUTINE scalar_laplacian(s,laps) BINDC(scalar_laplacian) 
     24     FIELD_MASS   :: s,laps ! IN, OUT 
     25     FIELD_U      :: grads  ! BUF 
     26     !$OMP PARALLEL NUM_THREADS(nb_threads) 
     27     CALL update_halo(transfer_primal, s) 
     28     CALL compute_scalar_laplacian(s,grads,laps) 
     29     !$OMP END PARALLEL 
     30   END SUBROUTINE scalar_laplacian 
     31 
     32  ! 
    2333  SUBROUTINE caldyn_unstructured(tau, mass_col,rhodz,theta_rhodz,u,geopot,w, & ! IN : flow state 
    2434                                 theta,ps,pk,hflux,qv, &    ! OUT : diags (except surface geopot : IN) 
Note: See TracChangeset for help on using the changeset viewer.