save_ms_field Subroutine

public subroutine save_ms_field(ms_fe_f, file_name, code, nodal)

Arguments

Type IntentOptional AttributesName
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


Calls

proc~~save_ms_field~~CallsGraph proc~save_ms_field save_ms_field proc~write_surf write_surf proc~save_ms_field->proc~write_surf proc~empty empty proc~save_ms_field->proc~empty proc~ms_fe_f_2_mat ms_fe_f_2_mat proc~save_ms_field->proc~ms_fe_f_2_mat proc~init_scal init_scal proc~save_ms_field->proc~init_scal proc~lower lower proc~write_surf->proc~lower proc~scal2surf scal2surf proc~write_surf->proc~scal2surf proc~surf2scal surf2scal proc~write_surf->proc~surf2scal proc~get_unit get_unit proc~write_surf->proc~get_unit proc~init_scal->proc~empty proc~c_f_string c_f_string proc~surf2scal->proc~c_f_string proc~c_f_string->proc~empty

Called by

proc~~save_ms_field~~CalledByGraph proc~save_ms_field save_ms_field proc~solve_ms_prob solve_ms_prob proc~solve_ms_prob->proc~save_ms_field proc~test_slider_ms test_slider_ms proc~test_slider_ms->proc~solve_ms_prob proc~test_rough_ms test_rough_ms proc~test_rough_ms->proc~solve_ms_prob proc~run_test run_test proc~run_test->proc~test_slider_ms proc~run_test->proc~test_rough_ms program~main main program~main->proc~run_test

Contents

Source Code


Source Code

   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