Subroutine to save the information controlled by code of the whole mesh.
The genertaed file is a ```.sur``` file.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(MS_FE_FILM), | intent(in) | :: | ms_fe_f | |||
character(len=*), | intent(in) | :: | file_name | filename like "./out/pressure.sur" |
||
integer(kind=I4), | intent(in) | :: | code | saved information like P_N |
||
logical(kind=I4), | intent(in) | :: | nodal | if false : cell value, if true : nodal value |
subroutine save_ms_field(ms_fe_f, file_name, code, nodal)
implicit none
type(MS_FE_FILM), intent(in) :: ms_fe_f
character(len=*), intent(in) :: file_name !! *filename like "./out/pressure.sur"*
integer(kind=I4), intent(in) :: code !! *saved information like P_N*
logical(kind=I4), intent(in) :: nodal !! *if false : cell value, if true : nodal value*
integer(kind=I4) :: nnx, nny
character(len=8) :: unit_z, string
integer(kind=I4), dimension(1) :: i1, i2
real(kind=R8), allocatable, dimension(:,:) :: mat
call ms_fe_f_2_mat(ms_fe_f, code, nodal, mat)
nnx = ubound(mat, 1)
nny = ubound(mat, 2)
call empty(unit_z)
if (nodal) then
string = trim(ms_fe_f%ts_fe_f%vn_name(code))
else
string = trim(ms_fe_f%ts_fe_f%vc_name(code))
endif
i1 = index(string, '(') +1
i2 = index(string, ')') -1
unit_z = string(i1(1):i2(1))
call init_scal(scal = scal_tmp, & !
nx = nnx, & !
ny = nny, & !
lx = ms_fe_f%ts_fe_f%m%lx, & ! default unit : m
ly = ms_fe_f%ts_fe_f%m%ly, & !
unit_z = unit_z ) !
call write_surf(nom_fic = file_name, & !
tab_s = mat, & !
scal = scal_tmp )
deallocate(mat)
return
endsubroutine save_ms_field